You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2019/01/10 01:29:36 UTC
[lucene-solr] branch master updated (7112d6f -> 0635c65)
This is an automated email from the ASF dual-hosted git repository.
noble pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.
from 7112d6f Ref Guide: Fix leftover getting-assistance refs that are breaking the build
new 3ffc909 SOLR-13016: test errors fixed
new 0635c65 SOLR-13016: precommit errors
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
solr/core/src/java/org/apache/solr/update/DocumentBuilder.java | 5 +----
.../org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java | 4 ++--
.../solr/cloud/autoscaling/sim/SimClusterStateProvider.java | 6 +++---
.../solr/cloud/autoscaling/sim/SimNodeStateProvider.java | 10 ++++------
.../org/apache/solr/client/solrj/cloud/autoscaling/Row.java | 2 +-
5 files changed, 11 insertions(+), 16 deletions(-)
[lucene-solr] 01/02: SOLR-13016: test errors fixed
Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
noble pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 3ffc9099bf4eb068df97063ea3f01ece0131fa9d
Author: Noble Paul <no...@apache.org>
AuthorDate: Thu Jan 10 00:57:03 2019 +1100
SOLR-13016: test errors fixed
---
.../org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java | 4 ++--
.../solr/cloud/autoscaling/sim/SimClusterStateProvider.java | 6 +++---
.../solr/cloud/autoscaling/sim/SimNodeStateProvider.java | 10 ++++------
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java
index ba14fad..ead23fc 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java
@@ -47,8 +47,8 @@ import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.cloud.DistributedQueueFactory;
import org.apache.solr.client.solrj.cloud.DistribStateManager;
+import org.apache.solr.client.solrj.cloud.DistributedQueueFactory;
import org.apache.solr.client.solrj.cloud.NodeStateProvider;
import org.apache.solr.client.solrj.cloud.SolrCloudManager;
import org.apache.solr.client.solrj.cloud.autoscaling.ReplicaInfo;
@@ -426,7 +426,7 @@ public class SimCloudManager implements SolrCloudManager {
// initialize history handler if this is the first node
if (metricsHistoryHandler == null && liveNodesSet.size() == 1) {
metricsHandler = new MetricsHandler(metricManager);
- metricsHistoryHandler = new MetricsHistoryHandler(nodeId, metricsHandler, solrClient, this, Collections.emptyMap());
+ metricsHistoryHandler = new MetricsHistoryHandler(nodeId, metricsHandler, solrClient, this, new HashMap<>());
metricsHistoryHandler.initializeMetrics(metricManager, SolrMetricManager.getRegistryName(SolrInfoBean.Group.node), metricTag, CommonParams.METRICS_HISTORY_PATH);
}
return nodeId;
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java
index ed20e83..784c0cb 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimClusterStateProvider.java
@@ -210,14 +210,14 @@ public class SimClusterStateProvider implements ClusterStateProvider {
}
initialState.forEachCollection(dc -> {
collProperties.computeIfAbsent(dc.getName(), name -> new ConcurrentHashMap<>()).putAll(dc.getProperties());
- opDelays.computeIfAbsent(dc.getName(), c -> new HashMap<>()).putAll(defaultOpDelays);
+ opDelays.computeIfAbsent(dc.getName(), Utils.NEW_HASHMAP_FUN).putAll(defaultOpDelays);
dc.getSlices().forEach(s -> {
sliceProperties.computeIfAbsent(dc.getName(), name -> new ConcurrentHashMap<>())
- .computeIfAbsent(s.getName(), name -> new HashMap<>()).putAll(s.getProperties());
+ .computeIfAbsent(s.getName(), Utils.NEW_HASHMAP_FUN).putAll(s.getProperties());
s.getReplicas().forEach(r -> {
ReplicaInfo ri = new ReplicaInfo(r.getName(), r.getCoreName(), dc.getName(), s.getName(), r.getType(), r.getNodeName(), r.getProperties());
if (liveNodes.get().contains(r.getNodeName())) {
- nodeReplicaMap.computeIfAbsent(r.getNodeName(), rn -> new ArrayList<>()).add(ri);
+ nodeReplicaMap.computeIfAbsent(r.getNodeName(), Utils.NEW_ARRAYLIST_FUN).add(ri);
}
});
});
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimNodeStateProvider.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimNodeStateProvider.java
index 5f9293b..2a87357 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimNodeStateProvider.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/SimNodeStateProvider.java
@@ -18,9 +18,7 @@ package org.apache.solr.cloud.autoscaling.sim;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -295,7 +293,7 @@ public class SimNodeStateProvider implements NodeStateProvider {
throw new RuntimeException("non-live node " + node);
}
if (tags.isEmpty()) {
- return Collections.emptyMap();
+ return new HashMap<>();
}
Map<String, Object> result = new HashMap<>();
Map<String, Object> metrics = getReplicaMetricsValues(node, tags.stream().filter(s -> s.startsWith("metrics:solr.core.")).collect(Collectors.toList()));
@@ -312,13 +310,13 @@ public class SimNodeStateProvider implements NodeStateProvider {
public Map<String, Map<String, List<ReplicaInfo>>> getReplicaInfo(String node, Collection<String> keys) {
List<ReplicaInfo> replicas = clusterStateProvider.simGetReplicaInfos(node);
if (replicas == null || replicas.isEmpty()) {
- return Collections.emptyMap();
+ return new HashMap<>();
}
Map<String, Map<String, List<ReplicaInfo>>> res = new HashMap<>();
// TODO: probably needs special treatment for "metrics:solr.core..." tags
for (ReplicaInfo r : replicas) {
- Map<String, List<ReplicaInfo>> perCollection = res.computeIfAbsent(r.getCollection(), s -> new HashMap<>());
- List<ReplicaInfo> perShard = perCollection.computeIfAbsent(r.getShard(), s -> new ArrayList<>());
+ Map<String, List<ReplicaInfo>> perCollection = res.computeIfAbsent(r.getCollection(), Utils.NEW_HASHMAP_FUN);
+ List<ReplicaInfo> perShard = perCollection.computeIfAbsent(r.getShard(), Utils.NEW_ARRAYLIST_FUN);
perShard.add(r);
}
return res;
[lucene-solr] 02/02: SOLR-13016: precommit errors
Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
noble pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 0635c657c1a13ab97924cbd9bebf5ecec8a84588
Author: Noble Paul <no...@apache.org>
AuthorDate: Wed Jan 9 23:51:09 2019 +1100
SOLR-13016: precommit errors
---
solr/core/src/java/org/apache/solr/update/DocumentBuilder.java | 5 +----
.../src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java | 2 +-
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
index 38b10b9..2fd0266 100644
--- a/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
+++ b/solr/core/src/java/org/apache/solr/update/DocumentBuilder.java
@@ -21,6 +21,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+import com.google.common.collect.Sets;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.NumericDocValuesField;
import org.apache.lucene.index.IndexableField;
@@ -29,14 +30,10 @@ import org.apache.solr.common.SolrDocumentBase;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.SolrInputField;
-import org.apache.solr.common.util.ByteArrayUtf8CharSequence;
import org.apache.solr.schema.CopyField;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
-
-import com.google.common.collect.Sets;
-
/**
* Builds a Lucene {@link Document} from a {@link SolrInputDocument}.
*/
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
index 318a9af..52e6169 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
@@ -52,7 +52,7 @@ public class Row implements MapWriter {
public final String node;
final Cell[] cells;
//this holds the details of each replica in the node
- Map<String, Map<String, List<ReplicaInfo>>> collectionVsShardVsReplicas;
+ public Map<String, Map<String, List<ReplicaInfo>>> collectionVsShardVsReplicas;
boolean anyValueMissing = false;
boolean isLive = true;