public SwarmCluster(IOptions <SwarmOptions> options, ISharding sharding, IClientStore clientStore, ILoggerFactory loggerFactory) { _options = options.Value; _sharding = sharding; _clientStore = clientStore; _logger = loggerFactory.CreateLogger <SwarmCluster>(); }
public static IHydra Create(ISharding sharding, params CloudStorageAccount[] accounts) { var hydra = new Hydra().SetSharding(sharding); foreach (var account in accounts) { hydra.AddAccount(account); } return hydra; }
public static IHydra Create(ISharding sharding, params CloudStorageAccount[] accounts) { var hydra = new Hydra().SetSharding(sharding); foreach (var account in accounts) { hydra.AddAccount(account); } return(hydra); }
public JobService(ISharding sharding, ISchedCache schedulerCache, ILoggerFactory loggerFactory, ISwarmStore store, IHubContext <ClientHub> hubContext, IOptions <SwarmOptions> options) { _sharding = sharding; _logger = loggerFactory.CreateLogger <JobService>(); _store = store; _hubContext = hubContext; _schedCache = schedulerCache; _options = options.Value; }
public static void DataBaseSharding(this IDataBaseSharding dataBaseSharding, int id = MatchedID.All, string tableIndex = null) { if (dataBaseSharding == null) { return; } var shardingValues = dataBaseSharding.GetShardingColumnValues(); var fatabaseShardingAttribute = dataBaseSharding.GetDataBaseShardingAttribute(id); if (fatabaseShardingAttribute == null) { return; } var algorithm = fatabaseShardingAttribute.ShardingAlgorithm; var shardingTotal = fatabaseShardingAttribute.ShardingMaxCount; ISharding sharding = Activator.CreateInstance(Type.GetType(algorithm)) as ISharding; dataBaseSharding.__DataBaseIndex__ = sharding.SharingByObject(shardingValues, shardingTotal); }
private string GetAuthenticationConnectionString(ISharding sharding) { var configuration = sharding.Configuration; var builder = new SqlConnectionStringBuilder() { IntegratedSecurity = configuration.IntegrationSecurity, PersistSecurityInfo = true, ConnectTimeout = configuration.ConnectTimeout, Pooling = configuration.Pooling, MaxPoolSize = configuration.MaxPoolSize, ApplicationName = configuration.ApplicationName }; if (!configuration.IntegrationSecurity) { builder.UserID = configuration.Username; builder.Password = configuration.Password; } return(builder.ConnectionString); }
public static void TableSharding(this ITableSharding tableSharding, int id = MatchedID.All, string tableIndex = null) { if (tableSharding == null) { return; } var shardingValues = tableSharding.GetShardingColumnValues(); var tableShardingAttribute = tableSharding.GetTableShardingAttribute(id); if (tableShardingAttribute == null) { return; } var algorithm = tableShardingAttribute.ShardingAlgorithm; var shardingTotal = tableShardingAttribute.ShardingTotalCount; ISharding sharding = Activator.CreateInstance(Type.GetType(algorithm)) as ISharding; var tableIndexSharding = sharding.SharingByObject(shardingValues, shardingTotal); if (!string.IsNullOrEmpty(tableIndexSharding)) { tableSharding.__TableIndex__ = tableIndexSharding; } }
public IHydra SetSharding(ISharding sharding) { _sharding = sharding; return this; }
public static IHydra Create(ISharding sharding) { return new Hydra().SetSharding(sharding); }
public IHydra SetSharding(ISharding sharding) { _sharding = sharding; return(this); }
public static IHydra Create(ISharding sharding) { return(new Hydra().SetSharding(sharding)); }