Пример #1
0
		public ShardStrategy(IDictionary<string, RavenFileSystemClient> shards)
		{
			if (shards == null) throw new ArgumentNullException("shards");
			if (shards.Count == 0)
				throw new ArgumentException("Shards collection must have at least one item", "shards");

			this.shards = new Dictionary<string, RavenFileSystemClient>(shards, StringComparer.OrdinalIgnoreCase);


			Conventions = shards.First().Value.Convention.Clone();

			ShardAccessStrategy = new SequentialShardAccessStrategy();
			ShardResolutionStrategy = new DefaultShardResolutionStrategy(shards.Keys, this);
			ModifyFileName = (convention, shardId, documentId) => convention.IdentityPartsSeparator + shardId + convention.IdentityPartsSeparator + documentId;
		}
Пример #2
0
        public ShardStrategy(IDictionary <string, RavenFileSystemClient> shards)
        {
            if (shards == null)
            {
                throw new ArgumentNullException("shards");
            }
            if (shards.Count == 0)
            {
                throw new ArgumentException("Shards collection must have at least one item", "shards");
            }

            this.shards = new Dictionary <string, RavenFileSystemClient>(shards, StringComparer.OrdinalIgnoreCase);


            Conventions = shards.First().Value.Convention.Clone();

            ShardAccessStrategy     = new SequentialShardAccessStrategy();
            ShardResolutionStrategy = new DefaultShardResolutionStrategy(shards.Keys, this);
            ModifyFileName          = (convention, shardId, documentId) => convention.IdentityPartsSeparator + shardId + convention.IdentityPartsSeparator + documentId;
        }