public DefaultShardResolutionStrategy(IEnumerable <string> shardIds, ShardStrategy shardStrategy)
 {
     this.shardStrategy = shardStrategy;
     ShardIds           = new List <string>(shardIds);
     if (ShardIds.Count == 0)
     {
         throw new ArgumentException("shardIds must have at least one value", "shardIds");
     }
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ShardedDocumentStore"/> class.
        /// </summary>
        /// <param name="shardStrategy">The shard strategy.</param>
        public ShardedDocumentStore(ShardStrategy shardStrategy)
        {
            if (shardStrategy == null)
            {
                throw new ArgumentException("Must have shard strategy", "shardStrategy");
            }

            this.ShardStrategy = shardStrategy;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShardedDocumentSession"/> class.
        /// </summary>
        /// <param name="shardStrategy">The shard strategy.</param>
        /// <param name="shardDbCommands">The shard IDatabaseCommands.</param>
        /// <param name="id"></param>
        /// <param name="documentStore"></param>
        /// <param name="listeners"></param>
        public ShardedDocumentSession(ShardedDocumentStore documentStore, DocumentSessionListeners listeners, Guid id,
                                      ShardStrategy shardStrategy, IDictionary <string, IDatabaseCommands> shardDbCommands

                                      )
            : base(documentStore, listeners, id)
        {
            this.shardStrategy   = shardStrategy;
            this.shardDbCommands = shardDbCommands;
        }
 public ShardedRavenQueryInspector(
     ShardStrategy shardStrategy,
     List <IDatabaseCommands> shardDbCommands,
     List <IAsyncDatabaseCommands> asyncShardDbCommands)
 {
     this.shardStrategy        = shardStrategy;
     this.shardDbCommands      = shardDbCommands;
     this.asyncShardDbCommands = asyncShardDbCommands;
 }
 public ShardedRavenQueryInspector(IRavenQueryProvider provider,
                                   RavenQueryStatistics queryStats, RavenQueryHighlightings highlightings, string indexName, Expression expression, InMemoryDocumentSessionOperations session, bool isMapReduce,
                                   ShardStrategy shardStrategy,
                                   List <IDatabaseCommands> shardDbCommands,
                                   List <IAsyncDatabaseCommands> asyncShardDbCommands)
     : base(provider, queryStats, highlightings, indexName, expression, session,
            null,
            null,
            isMapReduce)
 {
     this.shardStrategy        = shardStrategy;
     this.shardDbCommands      = shardDbCommands;
     this.asyncShardDbCommands = asyncShardDbCommands;
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShardedDocumentSession"/> class.
 /// </summary>
 /// <param name="shardStrategy">The shard strategy.</param>
 /// <param name="shardDbCommands">The shard IDatabaseCommands.</param>
 /// <param name="id"></param>
 /// <param name="documentStore"></param>
 /// <param name="listeners"></param>
 public ShardedDocumentSession(string dbName, ShardedDocumentStore documentStore, DocumentSessionListeners listeners, Guid id,
                               ShardStrategy shardStrategy, IDictionary <string, IDatabaseCommands> shardDbCommands)
     : base(dbName, documentStore, listeners, id, shardStrategy, shardDbCommands)
 {
 }