Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16414: remove parallelStream

Noble Paul5125dab47662
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
index baf714f6252..4c4d30866b6 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -2940,34 +2940,33 @@ public class ZkController implements Closeable {
collectionsInThisNode.add(cd.getCloudDescriptor().getCollectionName());
}
}
- collectionsInThisNode.parallelStream()
- .forEach(
- c -> {
- final List<String> replicasToDown = new ArrayList<>();
- DocCollection coll = zkStateReader.getCollection(c);
- if (coll == null) {
- // may be the collection no more exists
- return;
- }
- coll.forEachReplica(
- (s, r) -> {
- if (r.getNodeName().equals(nodeName)) {
- replicasToDown.add(r.getName());
- }
- });
-
- if (!replicasToDown.isEmpty()) {
- try {
- PerReplicaStatesOps.downReplicas(
- replicasToDown,
- PerReplicaStatesFetcher.fetch(
- coll.getZNode(), zkClient, coll.getPerReplicaStates()))
- .persist(coll.getZNode(), zkClient);
- } catch (KeeperException | InterruptedException e) {
- throw new RuntimeException(e);
+ collectionsInThisNode.forEach(
+ c -> {
+ final List<String> replicasToDown = new ArrayList<>();
+ DocCollection coll = zkStateReader.getCollection(c);
+ if (coll == null) {
+ // may be the collection no more exists
+ return;
+ }
+ coll.forEachReplica(
+ (s, r) -> {
+ if (r.getNodeName().equals(nodeName)) {
+ replicasToDown.add(r.getName());
}
- }
- });
+ });
+
+ if (!replicasToDown.isEmpty()) {
+ try {
+ PerReplicaStatesOps.downReplicas(
+ replicasToDown,
+ PerReplicaStatesFetcher.fetch(
+ coll.getZNode(), zkClient, coll.getPerReplicaStates()))
+ .persist(coll.getZNode(), zkClient);
+ } catch (KeeperException | InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ });
// We always send a down node event to overseer to be safe, but overseer will not need to do
// anything for PRS collections