Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16456: more cleanup

Noble Paulc37713fced65
diff --git a/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContext.java b/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContext.java
index 27ce0012da7..4edf6f78773 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContext.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ShardLeaderElectionContext.java
@@ -22,6 +22,7 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.solr.cloud.overseer.OverseerAction;
+import org.apache.solr.common.MapWriter;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.cloud.ClusterState;
@@ -127,19 +128,15 @@ final class ShardLeaderElectionContext extends ShardLeaderElectionContextBase {
> 1) {
// Clear the leader in clusterstate. We only need to worry about this if there is actually
// more than one replica.
- ZkNodeProps m =
- new ZkNodeProps(
- Overseer.QUEUE_OPERATION,
- OverseerAction.LEADER.toLower(),
- ZkStateReader.SHARD_ID_PROP,
- shardId,
- ZkStateReader.COLLECTION_PROP,
- collection);
-
+ MapWriter m =
+ ew ->
+ ew.put(Overseer.QUEUE_OPERATION, OverseerAction.LEADER.toLower())
+ .put(ZkStateReader.SHARD_ID_PROP, shardId)
+ .put(ZkStateReader.COLLECTION_PROP, collection);
if (distributedClusterStateUpdater.isDistributedStateUpdate()) {
distributedClusterStateUpdater.doSingleStateUpdate(
DistributedClusterStateUpdater.MutatingCommand.SliceSetShardLeader,
- m,
+ new ZkNodeProps(m),
zkController.getSolrCloudManager(),
zkStateReader);
} else {