lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject [01/25] lucene-solr:jira/solr-8668: SOLR-10741: Factor out createSliceShardsStr method from HttpShardHandler.prepDistributed. (Domenico Fabio Marino via Christine Poerschke)
Date Tue, 30 May 2017 11:28:10 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-8668 8143752f7 -> 36faceaf5


SOLR-10741: Factor out createSliceShardsStr method from HttpShardHandler.prepDistributed.
(Domenico Fabio Marino via Christine Poerschke)


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

Branch: refs/heads/jira/solr-8668
Commit: e7099e4bf51bd87ed95a188c474be869c222379d
Parents: 4106e1b
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Fri May 26 10:51:41 2017 +0100
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Fri May 26 10:52:57 2017 +0100

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 +++
 .../handler/component/HttpShardHandler.java     | 26 +++++++++++---------
 2 files changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7099e4b/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1da3fe0..d2f42e6 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -263,6 +263,9 @@ Other Changes
 * SOLR-10659: Remove ResponseBuilder.getSortSpec use in SearchGroupShardResponseProcessor.
   (Judith Silverman via Christine Poerschke)
 
+* SOLR-10741: Factor out createSliceShardsStr method from HttpShardHandler.prepDistributed.
+  (Domenico Fabio Marino via Christine Poerschke)
+
 ==================  6.6.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e7099e4b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
index 4ec3b79..bc620b6 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
@@ -449,17 +449,7 @@ public class HttpShardHandler extends ShardHandler {
           }
         }
         // And now recreate the | delimited list of equivalent servers
-        final StringBuilder sliceShardsStr = new StringBuilder();
-        boolean first = true;
-        for (String shardUrl : shardUrls) {
-          if (first) {
-            first = false;
-          } else {
-            sliceShardsStr.append('|');
-          }
-          sliceShardsStr.append(shardUrl);
-        }
-        rb.shards[i] = sliceShardsStr.toString();
+        rb.shards[i] = createSliceShardsStr(shardUrls);
       }
     }
     String shards_rows = params.get(ShardParams.SHARDS_ROWS);
@@ -472,6 +462,20 @@ public class HttpShardHandler extends ShardHandler {
     }
   }
 
+  private static String createSliceShardsStr(final List<String> shardUrls) {
+    final StringBuilder sliceShardsStr = new StringBuilder();
+    boolean first = true;
+    for (String shardUrl : shardUrls) {
+      if (first) {
+        first = false;
+      } else {
+        sliceShardsStr.append('|');
+      }
+      sliceShardsStr.append(shardUrl);
+    }
+    return sliceShardsStr.toString();
+  }
+
 
   private void addSlices(Map<String,Slice> target, ClusterState state, SolrParams params,
String collectionName, String shardKeys, boolean multiCollection) {
     DocCollection coll = state.getCollection(collectionName);


Mime
View raw message