You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by da...@apache.org on 2018/09/14 09:20:21 UTC

lucene-solr:jira/http2: PeerSync should use HttpShardHandlerFactory.defaultClient instead

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/http2 8063eab46 -> 36b99198f


PeerSync should use HttpShardHandlerFactory.defaultClient instead


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/36b99198
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/36b99198
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/36b99198

Branch: refs/heads/jira/http2
Commit: 36b99198fda25dd3ce8070cbf0ba5390ad1658a5
Parents: 8063eab
Author: Cao Manh Dat <da...@apache.org>
Authored: Fri Sep 14 16:20:12 2018 +0700
Committer: Cao Manh Dat <da...@apache.org>
Committed: Fri Sep 14 16:20:12 2018 +0700

----------------------------------------------------------------------
 .../solr/handler/component/HttpShardHandlerFactory.java   |  2 --
 solr/core/src/java/org/apache/solr/update/PeerSync.java   | 10 ++--------
 2 files changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36b99198/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
index 3404bc1..1bc2069 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
@@ -58,9 +58,7 @@ import org.apache.solr.metrics.SolrMetricProducer;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.update.UpdateShardHandlerConfig;
 import org.apache.solr.util.DefaultSolrThreadFactory;
-import org.apache.solr.util.stats.HttpClientMetricNameStrategy;
 import org.apache.solr.util.stats.InstrumentedHttpListenerFactory;
-import org.apache.solr.util.stats.InstrumentedPoolingHttpClientConnectionManager;
 import org.apache.solr.util.stats.MetricUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36b99198/solr/core/src/java/org/apache/solr/update/PeerSync.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/PeerSync.java b/solr/core/src/java/org/apache/solr/update/PeerSync.java
index 921320d..6c10181 100644
--- a/solr/core/src/java/org/apache/solr/update/PeerSync.java
+++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java
@@ -32,11 +32,9 @@ import java.util.stream.Collectors;
 import com.codahale.metrics.Counter;
 import com.codahale.metrics.Timer;
 import org.apache.http.NoHttpResponseException;
-import org.apache.http.client.HttpClient;
 import org.apache.http.conn.ConnectTimeoutException;
 import org.apache.lucene.util.BytesRef;
 import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.impl.Http2SolrClient;
 import org.apache.solr.cloud.ZkController;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrInputDocument;
@@ -86,7 +84,6 @@ public class PeerSync implements SolrMetricProducer {
 
   private final boolean cantReachIsSuccess;
   private final boolean doFingerprint;
-  private final Http2SolrClient client;
   private final boolean onlyIfActive;
   private SolrCore core;
   private Updater updater;
@@ -118,15 +115,12 @@ public class PeerSync implements SolrMetricProducer {
     this.nUpdates = nUpdates;
     this.cantReachIsSuccess = cantReachIsSuccess;
     this.doFingerprint = doFingerprint && !("true".equals(System.getProperty("solr.disableFingerprint")));
-    //TODO nocommit, replace it with default client
-    this.client = core.getCoreContainer().getUpdateShardHandler().getUpdateOnlyHttpClient();
     this.onlyIfActive = onlyIfActive;
     
     uhandler = core.getUpdateHandler();
     ulog = uhandler.getUpdateLog();
-    // TODO: close
     shardHandlerFactory = (HttpShardHandlerFactory) core.getCoreContainer().getShardHandlerFactory();
-    shardHandler = shardHandlerFactory.getShardHandler(client);
+    shardHandler = shardHandlerFactory.getShardHandler();
     this.updater = new Updater(msg(), core);
 
     core.getCoreMetricManager().registerMetricProducer(SolrInfoBean.Category.REPLICATION.toString(), this);
@@ -407,7 +401,7 @@ public class PeerSync implements SolrMetricProducer {
     sreq.params.set(DISTRIB, false);
     sreq.params.set("checkCanHandleVersionRanges", false);
 
-    ShardHandler sh = shardHandlerFactory.getShardHandler(client);
+    ShardHandler sh = shardHandlerFactory.getShardHandler();
     sh.submit(sreq, replica, sreq.params);
 
     ShardResponse srsp = sh.takeCompletedIncludingErrors();