public ComplexShardingStrategyConfiguration(string shardingColumns, IComplexKeysShardingAlgorithm <IComparable> shardingAlgorithm) { ShardingAssert.If(string.IsNullOrWhiteSpace(shardingColumns), "ShardingColumns is required."); ShardingAssert.ShouldBeNotNull(shardingAlgorithm, "ShardingAlgorithm is required."); this.ShardingColumns = shardingColumns; this.ShardingAlgorithm = shardingAlgorithm; }
public ComplexShardingStrategy(ComplexShardingStrategyConfiguration complexShardingStrategyConfig) { ShardingAssert.ShouldBeNotNull(complexShardingStrategyConfig.ShardingColumns, "Sharding columns cannot be null."); ShardingAssert.ShouldBeNotNull(complexShardingStrategyConfig.ShardingAlgorithm, "Sharding algorithm cannot be null."); shardingColumns = new SortedSet <string>(StringComparer.OrdinalIgnoreCase); shardingColumns.AddAll(complexShardingStrategyConfig.ShardingColumns.Split(new [] { ',' }, StringSplitOptions.RemoveEmptyEntries)); shardingAlgorithm = complexShardingStrategyConfig.ShardingAlgorithm; }