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 10:23:35 UTC
lucene-solr:master: SOLR-10741: Factor out createSliceShardsStr
method from HttpShardHandler.prepDistributed. (Domenico Fabio Marino via
Christine Poerschke)
Repository: lucene-solr
Updated Branches:
refs/heads/master 4106e1b51 -> e7099e4bf
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/master
Commit: e7099e4bf51bd87ed95a188c474be869c222379d
Parents: 4106e1b
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 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);