You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2017/05/26 12:19:49 UTC

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

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x d7047b7b2 -> 3c5ba879d


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/3c5ba879
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3c5ba879
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3c5ba879

Branch: refs/heads/branch_6x
Commit: 3c5ba879db4c4a2b4b62454d695135408781f4d9
Parents: d7047b7
Author: Christine Poerschke <cp...@apache.org>
Authored: Fri May 26 10:51:41 2017 +0100
Committer: Christine Poerschke <cp...@apache.org>
Committed: Fri May 26 11:24:54 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/3c5ba879/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 042a776..ac53317 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -83,6 +83,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/3c5ba879/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 8c0a9cb..886746e 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
@@ -416,17 +416,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);
@@ -439,6 +429,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);