Apache Lucene open-source search software
SOLR-6240: Removed unused coreName parameter in ZkStateReader.getReplicaProps
Shalin Shekhar Mangar92782a07db7a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 180548da61d..391741d1968 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -201,6 +201,8 @@ Other Changes* SOLR-2853: Add a unit test for the case when "spellcheck.maxCollationTries=0" (James Dyer)+* SOLR-6240: Removed unused coreName parameter in ZkStateReader.getReplicaProps. (shalin)+================== 4.9.0 ==================Versions of Major Componentsdiff --git a/solr/core/src/java/org/apache/solr/cloud/LeaderInitiatedRecoveryThread.java b/solr/core/src/java/org/apache/solr/cloud/LeaderInitiatedRecoveryThread.javaindex bfc4b9d836c..98f51576ef2 100644--- a/solr/core/src/java/org/apache/solr/cloud/LeaderInitiatedRecoveryThread.java+++ b/solr/core/src/java/org/apache/solr/cloud/LeaderInitiatedRecoveryThread.java@@ -195,7 +195,7 @@ public class LeaderInitiatedRecoveryThread extends Thread {} else {String leaderCoreNodeName = zkStateReader.getLeaderRetry(collection, shardId, 5000).getName();List<ZkCoreNodeProps> replicaProps =- zkStateReader.getReplicaProps(collection, shardId, leaderCoreNodeName, coreNeedingRecovery, null, null);+ zkStateReader.getReplicaProps(collection, shardId, leaderCoreNodeName);if (replicaProps != null && replicaProps.size() > 0) {String replicaState = replicaProps.get(0).getState();if (ZkStateReader.ACTIVE.equals(replicaState)) {diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.javaindex 6307bf68a50..667d59ebc0b 100644--- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java+++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java@@ -312,7 +312,6 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {forwardToLeader = false;return nodes;}- String coreName = req.getCore().getName();ClusterState cstate = zkController.getClusterState();DocCollection coll = cstate.getCollection(collection);@@ -361,7 +360,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {slice = coll.getSlice(myShardId);shardId = myShardId;leaderReplica = zkController.getZkStateReader().getLeaderRetry(collection, myShardId);- List<ZkCoreNodeProps> myReplicas = zkController.getZkStateReader().getReplicaProps(collection, shardId, leaderReplica.getName(), coreName, null, ZkStateReader.DOWN);+ List<ZkCoreNodeProps> myReplicas = zkController.getZkStateReader().getReplicaProps(collection, shardId, leaderReplica.getName(), null, ZkStateReader.DOWN);}}@@ -379,8 +378,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {// so get the replicas...forwardToLeader = false;List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader()- .getReplicaProps(collection, shardId, leaderReplica.getName(),- coreName, null, ZkStateReader.DOWN);+ .getReplicaProps(collection, shardId, leaderReplica.getName(), null, ZkStateReader.DOWN);if (replicaProps != null) {if (nodes == null) {@@ -1415,8 +1413,7 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {Replica leaderReplica = zkController.getZkStateReader().getLeaderRetry(collection, myShardId);List<ZkCoreNodeProps> replicaProps = zkController.getZkStateReader()- .getReplicaProps(collection, myShardId, leaderReplica.getName(),- req.getCore().getName(), null, ZkStateReader.DOWN);+ .getReplicaProps(collection, myShardId, leaderReplica.getName(), null, ZkStateReader.DOWN);if (replicaProps != null) {List<Node> myReplicas = new ArrayList<>();for (ZkCoreNodeProps replicaProp : replicaProps) {diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.javaindex a7b784c3bd4..29a3e9b2576 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java@@ -578,17 +578,17 @@ public class ZkStateReader {}public List<ZkCoreNodeProps> getReplicaProps(String collection,- String shardId, String thisCoreNodeName, String coreName) {- return getReplicaProps(collection, shardId, thisCoreNodeName, coreName, null);+ String shardId, String thisCoreNodeName) {+ return getReplicaProps(collection, shardId, thisCoreNodeName);}public List<ZkCoreNodeProps> getReplicaProps(String collection,- String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter) {- return getReplicaProps(collection, shardId, thisCoreNodeName, coreName, mustMatchStateFilter, null);+ String shardId, String thisCoreNodeName, String mustMatchStateFilter) {+ return getReplicaProps(collection, shardId, thisCoreNodeName, mustMatchStateFilter, null);}public List<ZkCoreNodeProps> getReplicaProps(String collection,- String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter, String mustNotMatchStateFilter) {+ String shardId, String thisCoreNodeName, String mustMatchStateFilter, String mustNotMatchStateFilter) {assert thisCoreNodeName != null;ClusterState clusterState = this.clusterState;if (clusterState == null) {