Apache Solr open-source search software
SOLR-17931: Remove deprecated core details from admin command responses (#3743)
Pierre Salagnacb019c64f6bf6
diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CollectionHandlingUtils.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CollectionHandlingUtils.javaindex ba02a828724..e90be1d255d 100644--- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CollectionHandlingUtils.java+++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CollectionHandlingUtils.java@@ -588,12 +588,6 @@ public class CollectionHandlingUtils {}public static class ShardRequestTracker {- /*- * backward compatibility reasons, add the response with the async ID as top level.- * This can be removed in Solr 9- */- @Deprecated static boolean INCLUDE_TOP_LEVEL_RESPONSE = true;-private final String asyncId;private final String adminPath;private final ZkStateReader zkStateReader;@@ -718,9 +712,6 @@ public class CollectionHandlingUtils {NamedList<Object> reqResult =waitForCoreAdminAsyncCallToComplete(shardHandlerFactory, adminPath, zkStateReader, node, shardAsyncId);- if (INCLUDE_TOP_LEVEL_RESPONSE) {- results.add(shardAsyncId, reqResult);- }if ("failed".equalsIgnoreCase(((String) reqResult.get("STATUS")))) {log.error("Error from shard {}: {}", node, reqResult);addFailure(results, node, reqResult);diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.javaindex 83d51b9048e..4c4f476e48e 100644--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/AsyncCallRequestStatusResponseTest.java@@ -22,31 +22,17 @@ import org.apache.solr.client.solrj.response.CollectionAdminResponse;import org.apache.solr.client.solrj.response.RequestStatusState;import org.apache.solr.cloud.AbstractFullDistribZkTestBase;import org.apache.solr.cloud.SolrCloudTestCase;-import org.apache.solr.cloud.api.collections.CollectionHandlingUtils.ShardRequestTracker;import org.apache.solr.common.util.NamedList;-import org.junit.AfterClass;import org.junit.BeforeClass;import org.junit.Test;public class AsyncCallRequestStatusResponseTest extends SolrCloudTestCase {- private static boolean oldResponseEntries;-- @SuppressWarnings("deprecation")@BeforeClasspublic static void setupCluster() throws Exception {- oldResponseEntries = ShardRequestTracker.INCLUDE_TOP_LEVEL_RESPONSE;- ShardRequestTracker.INCLUDE_TOP_LEVEL_RESPONSE = random().nextBoolean();configureCluster(2).addConfig("conf", configset("cloud-minimal")).configure();}- @SuppressWarnings("deprecation")- @AfterClass- public static void restoreFlag() {- ShardRequestTracker.INCLUDE_TOP_LEVEL_RESPONSE = oldResponseEntries;- }-- @SuppressWarnings("deprecation")@Testpublic void testAsyncCallStatusResponse() throws Exception {int numShards = 4;@@ -73,17 +59,9 @@ public class AsyncCallRequestStatusResponseTest extends SolrCloudTestCase {CollectionAdminRequest.requestStatus(asyncId);CollectionAdminResponse rsp = requestStatus.process(cluster.getSolrClient());NamedList<?> r = rsp.getResponse();- if (ShardRequestTracker.INCLUDE_TOP_LEVEL_RESPONSE) {- final int actualNumOfElems = 3 + (numShards * numReplicas);- // responseHeader, success, status, + old responses per every replica- assertEquals(- "Expected " + actualNumOfElems + " elements in the response" + r.jsonStr(),- actualNumOfElems,- r.size());- } else {- // responseHeader, success, status- assertEquals("Expected 3 elements in the response" + r.jsonStr(), 3, r.size());- }++ // responseHeader, success, status+ assertEquals("Expected 3 elements in the response" + r.jsonStr(), 3, r.size());assertNotNull("Expected 'responseHeader' response" + r, r.get("responseHeader"));assertNotNull("Expected 'status' response" + r, r.get("status"));{