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");
     }
 }
예제 #2
0
        /// <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;
        }
예제 #4
0
 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)
 {
 }