예제 #1
0
 public SolrClusterOperationsProxy(ISolrClusterBalancer clusterBalancer, SolrClusterExceptionHandlers exceptionHandlers, int maxAttempts, ISolrOperationsProvider operationsProvider, ISolrClusterReplicas usableReplicas)
 {
     this.clusterBalancer    = clusterBalancer;
     this.exceptionHandlers  = exceptionHandlers;
     this.maxAttempts        = maxAttempts;
     this.operationsProvider = operationsProvider;
     this.usableReplicas     = usableReplicas;
 }
예제 #2
0
        public SolrCluster(string zooKeeperConnection, string collectionName, ISolrClusterBalancer clusterBalancer = null, int maxAttempts = 1)
        {
            this.clusterBalancer = clusterBalancer ?? new SolrClusterRandomBalancer();


            if (string.IsNullOrEmpty(zooKeeperConnection))
            {
                throw new ArgumentNullException("zooKeeperConnection");
            }

            this.maxAttempts         = maxAttempts;
            this.clusterBalancer     = clusterBalancer;
            this.zooKeeperConnection = zooKeeperConnection;
            exceptionHandlers        = new SolrClusterExceptionHandlers(this);
            operationsProvider       = new SolrOperationsProvider();

            syncLock = new object();
        }