You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by no...@apache.org on 2022/11/03 04:34:26 UTC
[solr] branch main updated: SOLR-16414: remove parallelStream
This is an automated email from the ASF dual-hosted git repository.
noble pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 5125dab4766 SOLR-16414: remove parallelStream
5125dab4766 is described below
commit 5125dab476625fadab9c30561621f5b2c67f9bfe
Author: Noble Paul <no...@gmail.com>
AuthorDate: Thu Nov 3 15:34:18 2022 +1100
SOLR-16414: remove parallelStream
---
.../java/org/apache/solr/cloud/ZkController.java | 53 +++++++++++-----------
1 file changed, 26 insertions(+), 27 deletions(-)
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