Apache Solr open-source search software
Deprecations for Solr 9 (#3159)
David Smiley1e4497039df1
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.javaindex aa4122b4443..ed452830a3b 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java@@ -857,7 +857,6 @@ public class ZkController implements Closeable {.withHttpClient(cc.getDefaultHttpSolrClient()).build();cloudManager = new SolrClientCloudManager(cloudSolrClient, cc.getObjectCache());- cloudManager.getClusterStateProvider().connect();}return cloudManager;}@@ -1101,7 +1100,7 @@ public class ZkController implements Closeable {(collectionState) -> {if (collectionState == null) return false;boolean allStatesCorrect =- Optional.ofNullable(collectionState.getReplicas(nodeName)).stream()+ Optional.ofNullable(collectionState.getReplicasOnNode(nodeName)).stream().flatMap(List::stream).allMatch(replica -> replica.getState() == Replica.State.DOWN);diff --git a/solr/core/src/java/org/apache/solr/cloud/overseer/NodeMutator.java b/solr/core/src/java/org/apache/solr/cloud/overseer/NodeMutator.javaindex 48ce2e9fde2..bd45c3e8ea2 100644--- a/solr/core/src/java/org/apache/solr/cloud/overseer/NodeMutator.java+++ b/solr/core/src/java/org/apache/solr/cloud/overseer/NodeMutator.java@@ -71,7 +71,7 @@ public class NodeMutator {List<String> downedReplicas = new ArrayList<>();final Map<String, Slice> slicesCopy = new LinkedHashMap<>(docCollection.getSlicesMap());- List<Replica> replicasOnNode = docCollection.getReplicas(nodeName);+ List<Replica> replicasOnNode = docCollection.getReplicasOnNode(nodeName);if (replicasOnNode == null || replicasOnNode.isEmpty()) {return Optional.empty();}diff --git a/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java b/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.javaindex 02b36e9c3e4..b01021f0362 100644--- a/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java+++ b/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java@@ -30,7 +30,7 @@ import org.apache.solr.core.SolrCore;// With the addition of SolrParams, this class isn't needed for much anymore... it's currently// retained more for backward compatibility.-/** */+@Deprecated // use SolrQueryRequestBasepublic class LocalSolrQueryRequest extends SolrQueryRequestBase {public String userPrincipalName = null;diff --git a/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java b/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.javaindex 52ab91fcf9f..5223da21215 100644--- a/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java+++ b/solr/core/src/java/org/apache/solr/request/SolrQueryRequest.java@@ -186,6 +186,10 @@ public interface SolrQueryRequest extends AutoCloseable {return core == null ? null : core.getCoreContainer();}+ /**+ * @deprecated use getCore().getCoreDescriptor().getCloudDescriptor()+ */+ @Deprecateddefault CloudDescriptor getCloudDescriptor() {return getCore().getCoreDescriptor().getCloudDescriptor();}diff --git a/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java b/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.javaindex 2d6acb19d73..244cf8b4128 100644--- a/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java+++ b/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java@@ -37,7 +37,9 @@ import org.apache.solr.response.SolrQueryResponse;* interface to Solr.** @since solr 1.2+ * @deprecated see {@link org.apache.solr.client.solrj.embedded.EmbeddedSolrServer}*/+@Deprecatedpublic class DirectSolrConnection {protected final SolrCore core;protected final SolrRequestParsers parser;diff --git a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.javaindex 97a0290fa49..492ad7e5118 100644--- a/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java+++ b/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java@@ -1059,7 +1059,7 @@ public class HttpSolrCall {if (core != null) return core;}- List<Replica> replicas = collection.getReplicas(cores.getZkController().getNodeName());+ List<Replica> replicas = collection.getReplicasOnNode(cores.getZkController().getNodeName());return randomlyGetSolrCore(liveNodes, replicas);}diff --git a/solr/core/src/java/org/apache/solr/util/MockSearchableSolrClient.java b/solr/core/src/java/org/apache/solr/util/MockSearchableSolrClient.javaindex 6f4a52e95f6..c98b9b5d94b 100644--- a/solr/core/src/java/org/apache/solr/util/MockSearchableSolrClient.java+++ b/solr/core/src/java/org/apache/solr/util/MockSearchableSolrClient.java@@ -38,6 +38,7 @@ import org.apache.solr.common.util.NamedList;* Simple mock client that collects added documents and supports simple search by id (both <code>* {!term f=id}</code> and <code>id:</code> syntax is supported) or *:*.*/+@Deprecatedpublic class MockSearchableSolrClient extends SolrClient {public Map<String, Map<String, SolrInputDocument>> docs = new ConcurrentHashMap<>();diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.javaindex 9f8c33e60f7..527ac45dfa1 100644--- a/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteNodeTest.java@@ -71,7 +71,7 @@ public class DeleteNodeTest extends SolrCloudTestCase {boolean shouldFail = false;DocCollection docColl = state.getCollection(coll);log.info("#### DocCollection: {}", docColl);- List<Replica> replicas = docColl.getReplicas(nodeToBeDecommissioned);+ List<Replica> replicas = docColl.getReplicasOnNode(nodeToBeDecommissioned);if (replicas != null) {for (Replica replica : replicas) {String shard =diff --git a/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.javaindex 39ccf43fb53..9f8993f2ce6 100644--- a/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java@@ -147,7 +147,7 @@ public class MigrateReplicasTest extends SolrCloudTestCase {// check what are replica states on the decommissioned nodeassertNull("There should not be any replicas left on decommissioned node",- collection.getReplicas(nodeToBeDecommissioned));+ collection.getReplicasOnNode(nodeToBeDecommissioned));// let's do it back - this time wait for recoveriesresponse =@@ -183,14 +183,14 @@ public class MigrateReplicasTest extends SolrCloudTestCase {s.getReplicas(EnumSet.of(Replica.Type.PULL)).size());}// make sure all newly created replicas on node are active- List<Replica> newReplicas = collection.getReplicas(nodeToBeDecommissioned);+ List<Replica> newReplicas = collection.getReplicasOnNode(nodeToBeDecommissioned);assertNotNull("There should be replicas on the migrated-to node", newReplicas);assertFalse("There should be replicas on the migrated-to node", newReplicas.isEmpty());for (Replica r : newReplicas) {assertEquals(r.toString(), Replica.State.ACTIVE, r.getState());}// make sure all replicas on emptyNode are not active- List<Replica> replicas = collection.getReplicas(emptyNode);+ List<Replica> replicas = collection.getReplicasOnNode(emptyNode);if (replicas != null) {for (Replica r : replicas) {assertNotEquals(r.toString(), Replica.State.ACTIVE, r.getState());@@ -272,7 +272,7 @@ public class MigrateReplicasTest extends SolrCloudTestCase {log.info("### Before decommission: {}", initialCollection);List<Integer> initialReplicaCounts =l.stream()- .map(node -> initialCollection.getReplicas(node).size())+ .map(node -> initialCollection.getReplicasOnNode(node).size()).collect(Collectors.toList());Map<?, ?> response =callMigrateReplicas(@@ -289,7 +289,7 @@ public class MigrateReplicasTest extends SolrCloudTestCase {log.info("### After decommission: {}", collection);// check what are replica states on the decommissioned nodesfor (String nodeToBeDecommissioned : nodesToBeDecommissioned) {- List<Replica> replicas = collection.getReplicas(nodeToBeDecommissioned);+ List<Replica> replicas = collection.getReplicasOnNode(nodeToBeDecommissioned);if (replicas == null) {replicas = Collections.emptyList();}@@ -303,7 +303,7 @@ public class MigrateReplicasTest extends SolrCloudTestCase {assertNotEquals("The non-source node '" + node + "' should not receive all replicas from the migration",4,- collection.getReplicas(node).size());+ collection.getReplicasOnNode(node).size());}}diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.javaindex 6333d7dd9ac..59427ff26df 100644--- a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java@@ -128,7 +128,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {collection = cloudClient.getClusterState().getCollection(coll);log.debug("### After decommission: {}", collection);// check what are replica states on the decommissioned node- List<Replica> replicas = collection.getReplicas(nodeToBeDecommissioned);+ List<Replica> replicas = collection.getReplicasOnNode(nodeToBeDecommissioned);if (replicas == null) {replicas = Collections.emptyList();}@@ -163,14 +163,14 @@ public class ReplaceNodeTest extends SolrCloudTestCase {s.getReplicas(EnumSet.of(Replica.Type.PULL)).size());}// make sure all newly created replicas on node are active- List<Replica> newReplicas = collection.getReplicas(nodeToBeDecommissioned);+ List<Replica> newReplicas = collection.getReplicasOnNode(nodeToBeDecommissioned);replicas.forEach(r -> newReplicas.removeIf(nr -> nr.getName().equals(r.getName())));assertFalse(newReplicas.isEmpty());for (Replica r : newReplicas) {assertEquals(r.toString(), Replica.State.ACTIVE, r.getState());}// make sure all replicas on emptyNode are not active- replicas = collection.getReplicas(emptyNode);+ replicas = collection.getReplicasOnNode(emptyNode);if (replicas != null) {for (Replica r : replicas) {assertNotEquals(r.toString(), Replica.State.ACTIVE, r.getState());@@ -257,7 +257,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {log.info("excluded_nodes : {} ", emptyNodes);List<Integer> initialReplicaCounts =l.stream()- .map(node -> initialCollection.getReplicas(node).size())+ .map(node -> initialCollection.getReplicasOnNode(node).size()).collect(Collectors.toList());createReplaceNodeRequest(nodeToBeDecommissioned, null, true).processAndWait("000", cloudClient, 15);@@ -266,7 +266,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {assertNotNull("Collection cannot be null: " + coll, collection);log.debug("### After decommission: {}", collection);// check what are replica states on the decommissioned node- List<Replica> replicas = collection.getReplicas(nodeToBeDecommissioned);+ List<Replica> replicas = collection.getReplicasOnNode(nodeToBeDecommissioned);if (replicas == null) {replicas = Collections.emptyList();}@@ -274,8 +274,8 @@ public class ReplaceNodeTest extends SolrCloudTestCase {"There should be no more replicas on the sourceNode after a replaceNode request.",Collections.emptyList(),replicas);- int sizeA = collection.getReplicas(emptyNodes.get(0)).size();- int sizeB = collection.getReplicas(emptyNodes.get(1)).size();+ int sizeA = collection.getReplicasOnNode(emptyNodes.get(0)).size();+ int sizeB = collection.getReplicasOnNode(emptyNodes.get(1)).size();assertEquals("The empty nodes should have a similar number of replicas placed on each", sizeA, sizeB, 1);assertEquals(@@ -286,7 +286,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {assertEquals("The number of replicas on non-empty and non-source nodes should not change",initialReplicaCounts.get(i).intValue(),- collection.getReplicas(l.get(i)).size());+ collection.getReplicasOnNode(l.get(i)).size());}}diff --git a/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java b/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.javaindex d14a98cf0f8..38ec012375b 100644--- a/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java+++ b/solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java@@ -365,7 +365,7 @@ public class TestCoordinatorRole extends SolrCloudTestCase {"Pull jetty replicas didn't become active in time",COLL,((liveNodes, collectionState) ->- collectionState.getReplicas(pullJettyF.getNodeName()).stream()+ collectionState.getReplicasOnNode(pullJettyF.getNodeName()).stream().allMatch(rep -> rep.getState() == Replica.State.ACTIVE)));AtomicBoolean done = new AtomicBoolean();long runMinutes = 1;@@ -396,7 +396,7 @@ public class TestCoordinatorRole extends SolrCloudTestCase {toManipulate.getNodeName() + " replicas didn't become active in time",COLL,((liveNodes, collectionState) ->- collectionState.getReplicas(toManipulate.getNodeName()).stream()+ collectionState.getReplicasOnNode(toManipulate.getNodeName()).stream().allMatch(rep -> rep.getState() == Replica.State.ACTIVE)));} catch (Exception e) {throw new RuntimeException(e);diff --git a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/sql/ConnectionImpl.java b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/sql/ConnectionImpl.javaindex 548bf1918fc..ec942a44edb 100644--- a/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/sql/ConnectionImpl.java+++ b/solr/solrj-streaming/src/java/org/apache/solr/client/solrj/io/sql/ConnectionImpl.java@@ -16,6 +16,7 @@*/package org.apache.solr.client.solrj.io.sql;+import java.lang.invoke.MethodHandles;import java.sql.Array;import java.sql.Blob;import java.sql.CallableStatement;@@ -38,9 +39,13 @@ import java.util.concurrent.TimeUnit;import java.util.concurrent.TimeoutException;import org.apache.solr.client.solrj.impl.CloudSolrClient;import org.apache.solr.client.solrj.io.SolrClientCache;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;class ConnectionImpl implements Connection {+ private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());+private final String url;private final SolrClientCache solrClientCache = new SolrClientCache();private final CloudSolrClient client;@@ -325,15 +330,11 @@ class ConnectionImpl implements Connection {}@Override- public boolean isValid(int timeout) throws SQLException {+ public boolean isValid(int timeoutSec) throws SQLException {// check that the connection isn't closed and able to connect within the timeouttry {if (!isClosed()) {- if (timeout == 0) {- this.client.connect();- } else {- this.client.connect(timeout, TimeUnit.SECONDS);- }+ connect(client, timeoutSec, TimeUnit.SECONDS);return true;}} catch (InterruptedException | TimeoutException ignore) {@@ -342,6 +343,41 @@ class ConnectionImpl implements Connection {return false;}+ /**+ * Connect to a cluster. If the cluster is not ready, retry connection up to a given timeout.+ *+ * @param duration the timeout. 0 means try once; no timeout.+ * @param timeUnit the units of the timeout+ * @throws TimeoutException if the cluster is not ready after the timeout+ * @throws InterruptedException if the wait is interrupted+ */+ static void connect(CloudSolrClient client, long duration, TimeUnit timeUnit)+ throws TimeoutException, InterruptedException {+ var clusterStateProvider = client.getClusterStateProvider();+ if (duration == 0) {+ clusterStateProvider.getLiveNodes();+ return;+ }++ log.info(+ "Waiting for {} {} for cluster at {} to be ready",+ duration,+ timeUnit,+ clusterStateProvider);+ long timeout = System.nanoTime() + timeUnit.toNanos(duration);+ while (System.nanoTime() < timeout) {+ try {+ clusterStateProvider.getLiveNodes();+ log.info("Cluster at {} ready", clusterStateProvider);+ return;+ } catch (RuntimeException e) {+ // not ready yet, then...+ }+ TimeUnit.MILLISECONDS.sleep(250);+ }+ throw new TimeoutException("Timed out waiting for cluster");+ }+@Overridepublic void setClientInfo(String name, String value) throws SQLClientInfoException {throw new UnsupportedOperationException();diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.javaindex 760b9756a44..43d55fc3739 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java@@ -274,7 +274,15 @@ public abstract class CloudSolrClient extends SolrClient {public abstract ClusterStateProvider getClusterStateProvider();+ /**+ * @deprecated problematic as a 'get' method, since one implementation will do a remote request+ * each time this is called, potentially return lots of data that isn't even needed.+ */+ @Deprecatedpublic ClusterState getClusterState() {+ // The future of "ClusterState" isn't clear. Could make it more of a cache instead of a+ // snapshot, so we un-deprecate. Or we avoid it and maybe make the ClusterStateProvider as that+ // cache. SOLR-17604 is related.return getClusterStateProvider().getClusterState();}@@ -304,7 +312,10 @@ public abstract class CloudSolrClient extends SolrClient {/*** Connect to the zookeeper ensemble. This is an optional method that may be used to force a* connection before any other requests are sent.+ *+ * @deprecated Call {@link ClusterStateProvider#getLiveNodes()} instead.*/+ @Deprecatedpublic void connect() {getClusterStateProvider().connect();}@@ -317,6 +328,7 @@ public abstract class CloudSolrClient extends SolrClient {* @throws TimeoutException if the cluster is not ready after the timeout* @throws InterruptedException if the wait is interrupted*/+ @Deprecatedpublic void connect(long duration, TimeUnit timeUnit)throws TimeoutException, InterruptedException {if (log.isInfoEnabled()) {diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.javaindex b6afac3114f..ce7c7f9c2e4 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ClusterStateProvider.java@@ -123,6 +123,7 @@ public interface ClusterStateProvider extends SolrCloseable {/** Get the collection-specific policy */String getPolicyNameByCollection(String coll);+ @Deprecated // just call getLiveNodes()void connect();String getQuorumHosts();diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/NoOpResponseParser.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/NoOpResponseParser.javaindex 61e40a9fd9a..26da43787d2 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/NoOpResponseParser.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/NoOpResponseParser.java@@ -29,7 +29,10 @@ import org.apache.solr.common.util.NamedList;/*** A special parser that puts the entire response into a string "response" field in the NamedList.+ *+ * @deprecated see {@link InputStreamResponseParser instead}; more efficient*/+@Deprecatedpublic class NoOpResponseParser extends ResponseParser {private final String writerType;diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/DirectXmlRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/DirectXmlRequest.javaindex 560aa30ab32..cca187dd4d6 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/DirectXmlRequest.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/DirectXmlRequest.java@@ -27,7 +27,9 @@ import org.apache.solr.common.params.SolrParams;* Send arbitrary XML to a request handler** @since solr 1.3+ * @deprecated Use {@link GenericSolrRequest}.*/+@Deprecatedpublic class DirectXmlRequest extends CollectionRequiringSolrRequest<UpdateResponse>implements IsUpdateRequest {diff --git a/solr/solrj/src/java/org/apache/solr/common/MapSerializable.java b/solr/solrj/src/java/org/apache/solr/common/MapSerializable.javaindex 6d3fcff9dad..e5d6ebafa92 100644--- a/solr/solrj/src/java/org/apache/solr/common/MapSerializable.java+++ b/solr/solrj/src/java/org/apache/solr/common/MapSerializable.java@@ -18,7 +18,12 @@ package org.apache.solr.common;import java.util.Map;-/** This is to facilitate just in time creation of objects before writing it to the response. */+/**+ * This is to facilitate just in time creation of objects before writing it to the response.+ *+ * @deprecated Use {@link MapWriter} instead+ */+@Deprecatedpublic interface MapSerializable {/*** Use the passed map to minimize object creation. Do not keep a reference to the passed map anddiff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.javaindex 960729a3906..2d977a9cf13 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java@@ -214,7 +214,7 @@ public class ClusterState implements MapWriter {DocCollection coll = ref.get();if (coll == null) continue; // this collection got removed in between, skip// TODO: for really large clusters, we could 'index' on this- return Optional.ofNullable(coll.getReplicas(nodeName)).stream()+ return Optional.ofNullable(coll.getReplicasOnNode(nodeName)).stream().flatMap(List::stream).filter(r -> coreName.equals(r.getStr(ReplicaStateProps.CORE_NAME))).map(Replica::getShard)@@ -232,7 +232,7 @@ public class ClusterState implements MapWriter {.filter(Objects::nonNull).forEach(col -> {- List<Replica> replicas = col.getReplicas(nodeName);+ List<Replica> replicas = col.getReplicasOnNode(nodeName);if (replicas != null && !replicas.isEmpty()) {replicaNamesPerCollectionOnNode.put(col.getName(), replicas);}diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.javaindex cbfd5e7be92..6000f308373 100644--- a/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java@@ -358,7 +358,13 @@ public class DocCollection extends ZkNodeProps implements Iterable<Slice> {}/** Get the list of replicas hosted on the given node or <code>null</code> if none. */+ @Deprecated // see getReplicasOnNodepublic List<Replica> getReplicas(String nodeName) {+ return getReplicasOnNode(nodeName);+ }++ /** Get the list of replicas hosted on the given node or <code>null</code> if none. */+ public List<Replica> getReplicasOnNode(String nodeName) {return nodeNameReplicas.get(nodeName);}@@ -451,6 +457,7 @@ public class DocCollection extends ZkNodeProps implements Iterable<Slice> {** @see CollectionStatePredicate*/+ @Deprecated // only for 2 testspublic static boolean isFullyActive(Set<String> liveNodes,DocCollection collectionState,@@ -512,6 +519,7 @@ public class DocCollection extends ZkNodeProps implements Iterable<Slice> {}/** Get the shardId of a core on a specific node */+ @Deprecated // only one usage; obscure lookingpublic String getShardId(String nodeName, String coreName) {for (Slice slice : this) {for (Replica replica : slice) {@@ -581,10 +589,6 @@ public class DocCollection extends ZkNodeProps implements Iterable<Slice> {return numReplicas.get(type);}- public int getExpectedReplicaCount(Replica.Type type) {- return numReplicas.get(type);- }-/** JSON properties related to a collection's state. */public interface CollectionStateProps {String REPLICATION_FACTOR = "replicationFactor";diff --git a/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java b/solr/solrj/src/java/org/apache/solr/common/util/NamedList.javaindex 32ea838a18e..b59d8c779a5 100644--- a/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java+++ b/solr/solrj/src/java/org/apache/solr/common/util/NamedList.java@@ -278,7 +278,9 @@ public class NamedList<T>** @return null if not found or if the value stored was null.* @see #indexOf+ * @deprecated Use {@link #indexOf(String, int)} then {@link #getVal(int)}.*/+ @Deprecatedpublic T get(String name, int start) {int sz = size();for (int i = start; i < sz; i++) {@@ -347,7 +349,9 @@ public class NamedList<T>** @param args One or more strings specifying the tree to navigate.* @return the last entry in the given path hierarchy, null if not found.+ * @deprecated use {@link org.apache.solr.common.NavigableObject} methods instead*/+ @Deprecatedpublic Object findRecursive(String... args) {NamedList<?> currentList = null;Object value = null;@@ -409,6 +413,10 @@ public class NamedList<T>return new NamedList<>(Collections.unmodifiableList(copy.nvPairs));}+ /**+ * @deprecated Use {@link SimpleOrderedMap} instead.+ */+ @Deprecatedpublic Map<String, T> asShallowMap() {return asShallowMap(false);}