You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2026/09/08 04:32:05 UTC
(solr) branch branch_9x updated (09e3bf400e3 -> cdc183213e6)
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a change to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
from 09e3bf400e3 SOLR-18343: Fix deprecated: since = 10.1 (not 11.0)
new c6aa011e40b Revert "SOLR-18343: Fix deprecated: since = 10.1 (not 11.0)"
new cdc183213e6 Revert "SOLR-18343: SolrJ now uses POST for suitable v1 admin requests (#4861)"
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../solr-18343-explicit-admin-methods.yml | 8 -
.../solr/util/tracing/TestDistributedTracing.java | 8 +-
.../solrj/request/CollectionAdminRequest.java | 200 +++++++--------------
.../solrj/request/ConfigSetAdminRequest.java | 37 +---
.../client/solrj/request/CoreAdminRequest.java | 42 ++---
.../solrj/request/TestCollectionAdminRequest.java | 20 ---
.../solrj/request/TestConfigSetAdminRequest.java | 9 -
.../solr/client/solrj/request/TestCoreAdmin.java | 9 -
8 files changed, 79 insertions(+), 254 deletions(-)
delete mode 100644 changelog/unreleased/solr-18343-explicit-admin-methods.yml
(solr) 01/02: Revert "SOLR-18343: Fix deprecated: since = 10.1 (not 11.0)"
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
commit c6aa011e40bb5cd298b412156b9c9b1ff007fde9
Author: David Smiley <ds...@apache.org>
AuthorDate: Tue Sep 8 00:31:29 2026 -0400
Revert "SOLR-18343: Fix deprecated: since = 10.1 (not 11.0)"
This reverts commit 09e3bf400e3a72621e92f52bdf570ac4947c5000.
---
.../solr/client/solrj/request/CollectionAdminRequest.java | 14 +++++++-------
.../solr/client/solrj/request/ConfigSetAdminRequest.java | 6 +++---
.../apache/solr/client/solrj/request/CoreAdminRequest.java | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
index 16582cfe934..38d25dba71b 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
@@ -91,7 +91,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
/**
* @deprecated Use {@link #CollectionAdminRequest(METHOD, CollectionAction)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public CollectionAdminRequest(CollectionAction action) {
this(METHOD.POST, action);
}
@@ -99,7 +99,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
/**
* @deprecated Use {@link #CollectionAdminRequest(METHOD, String, CollectionAction)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public CollectionAdminRequest(String path, CollectionAction action) {
this(METHOD.POST, path, action);
}
@@ -172,7 +172,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
/**
* @deprecated Use {@link #AsyncCollectionAdminRequest(METHOD, CollectionAction)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public AsyncCollectionAdminRequest(CollectionAction action) {
this(METHOD.POST, action);
}
@@ -285,7 +285,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
* @deprecated Use {@link #AsyncCollectionSpecificAdminRequest(METHOD, CollectionAction,
* String)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public AsyncCollectionSpecificAdminRequest(CollectionAction action, String collection) {
this(METHOD.POST, action, collection);
}
@@ -324,7 +324,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
* @deprecated Use {@link #AsyncShardSpecificAdminRequest(METHOD, CollectionAction, String,
* String)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public AsyncShardSpecificAdminRequest(
CollectionAction action, String collection, String shard) {
this(METHOD.POST, action, collection, shard);
@@ -355,7 +355,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
/**
* @deprecated Use {@link #ShardSpecificAdminRequest(METHOD, CollectionAction, String, String)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public ShardSpecificAdminRequest(CollectionAction action, String collection, String shard) {
this(METHOD.POST, action, collection, shard);
}
@@ -394,7 +394,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
* @deprecated Use {@link #CollectionAdminRoleRequest(METHOD, CollectionAction, String,
* String)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public CollectionAdminRoleRequest(CollectionAction action, String node, String role) {
this(METHOD.POST, action, node, role);
}
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java
index a53c00e1202..117265606f2 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java
@@ -62,7 +62,7 @@ public abstract class ConfigSetAdminRequest<
/**
* @deprecated Use {@link #ConfigSetAdminRequest(METHOD)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public ConfigSetAdminRequest() {
this(METHOD.POST);
}
@@ -70,7 +70,7 @@ public abstract class ConfigSetAdminRequest<
/**
* @deprecated Use {@link #ConfigSetAdminRequest(METHOD, String)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public ConfigSetAdminRequest(String path) {
this(METHOD.POST, path);
}
@@ -102,7 +102,7 @@ public abstract class ConfigSetAdminRequest<
/**
* @deprecated Use {@link #ConfigSetSpecificAdminRequest(METHOD)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
protected ConfigSetSpecificAdminRequest() {
this(METHOD.POST);
}
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
index b349ed12c4e..ecdb3ba5fb8 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
@@ -605,7 +605,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
/**
* @deprecated Use {@link #CoreAdminRequest(METHOD)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public CoreAdminRequest() {
this(METHOD.POST);
}
@@ -613,7 +613,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
/**
* @deprecated Use {@link #CoreAdminRequest(METHOD, String)}.
*/
- @Deprecated(since = "10.1")
+ @Deprecated(since = "11.0")
public CoreAdminRequest(String path) {
this(METHOD.POST, path);
}
(solr) 02/02: Revert "SOLR-18343: SolrJ now uses POST for suitable v1 admin requests (#4861)"
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
commit cdc183213e6f4764e169bf6fc88c3b9fe8a6c5bd
Author: David Smiley <ds...@apache.org>
AuthorDate: Tue Sep 8 00:31:39 2026 -0400
Revert "SOLR-18343: SolrJ now uses POST for suitable v1 admin requests (#4861)"
This reverts commit af1c5bcbf3269cc6ab697234530e8ae9b9bfbb9c.
---
.../solr-18343-explicit-admin-methods.yml | 8 -
.../solr/util/tracing/TestDistributedTracing.java | 8 +-
.../solrj/request/CollectionAdminRequest.java | 200 +++++++--------------
.../solrj/request/ConfigSetAdminRequest.java | 37 +---
.../client/solrj/request/CoreAdminRequest.java | 42 ++---
.../solrj/request/TestCollectionAdminRequest.java | 20 ---
.../solrj/request/TestConfigSetAdminRequest.java | 9 -
.../solr/client/solrj/request/TestCoreAdmin.java | 9 -
8 files changed, 79 insertions(+), 254 deletions(-)
diff --git a/changelog/unreleased/solr-18343-explicit-admin-methods.yml b/changelog/unreleased/solr-18343-explicit-admin-methods.yml
deleted file mode 100644
index 3f88523466e..00000000000
--- a/changelog/unreleased/solr-18343-explicit-admin-methods.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-title: >
- SolrJ v1 admin requests now use appropriate HTTP verbs -- mostly POST, some GET
-type: changed
-authors:
- - name: Xinyao Zhang
-links:
- - name: SOLR-18343
- url: https://issues.apache.org/jira/browse/SOLR-18343
diff --git a/solr/core/src/test/org/apache/solr/util/tracing/TestDistributedTracing.java b/solr/core/src/test/org/apache/solr/util/tracing/TestDistributedTracing.java
index 6ddb021546c..a039511af63 100644
--- a/solr/core/src/test/org/apache/solr/util/tracing/TestDistributedTracing.java
+++ b/solr/core/src/test/org/apache/solr/util/tracing/TestDistributedTracing.java
@@ -203,7 +203,7 @@ public class TestDistributedTracing extends SolrCloudTestCase {
assertEquals(0, r1.getStatus());
// Expecting 8 spans:
- // 1. api call 'operationName:"post:/admin/collections"',
+ // 1. api call 'operationName:"create:/admin/collections"',
// db.instance=testInternalCollectionApiCommands
// - unique traceId unrelated to the internal trace id generated for the operation
// 2. internal CollectionApiCommand 'operationName:"CreateCollectionCmd"'
@@ -223,7 +223,7 @@ public class TestDistributedTracing extends SolrCloudTestCase {
var finishedSpans = getAndClearSpans();
var s0 = finishedSpans.remove(0);
assertDbInstanceColl(s0, collection);
- assertEquals("post:/admin/collections", s0.operationName());
+ assertEquals("create:/admin/collections", s0.operationName());
Map<String, Integer> ops = new HashMap<>();
assertEquals(7, finishedSpans.size());
@@ -251,7 +251,7 @@ public class TestDistributedTracing extends SolrCloudTestCase {
assertEquals(0, r1.getStatus());
// Expecting 6 spans:
- // 1. api call 'operationName:"post:/admin/collections"',
+ // 1. api call 'operationName:"delete:/admin/collections"',
// db.instance=testInternalCollectionApiCommands
// - unique traceId unrelated to the internal trace id generated for the operation
// 2. internal CollectionApiCommand 'operationName:"DeleteCollectionCmd"'
@@ -267,7 +267,7 @@ public class TestDistributedTracing extends SolrCloudTestCase {
var finishedSpans = getAndClearSpans();
var s0 = finishedSpans.remove(0);
assertDbInstanceColl(s0, collection);
- assertEquals("post:/admin/collections", s0.operationName());
+ assertEquals("delete:/admin/collections", s0.operationName());
Map<String, Integer> ops = new HashMap<>();
assertEquals(5, finishedSpans.size());
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
index 38d25dba71b..9afdd3d579a 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java
@@ -79,29 +79,13 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
@Deprecated public static String PROPERTY_PREFIX = CollectionAdminParams.PROPERTY_PREFIX;
- public CollectionAdminRequest(METHOD method, CollectionAction action) {
- this(method, "/admin/collections", action);
- }
-
- public CollectionAdminRequest(METHOD method, String path, CollectionAction action) {
- super(method, path);
- this.action = checkNotNull(CoreAdminParams.ACTION, action);
- }
-
- /**
- * @deprecated Use {@link #CollectionAdminRequest(METHOD, CollectionAction)}.
- */
- @Deprecated(since = "11.0")
public CollectionAdminRequest(CollectionAction action) {
- this(METHOD.POST, action);
+ this("/admin/collections", action);
}
- /**
- * @deprecated Use {@link #CollectionAdminRequest(METHOD, String, CollectionAction)}.
- */
- @Deprecated(since = "11.0")
public CollectionAdminRequest(String path, CollectionAction action) {
- this(METHOD.POST, path, action);
+ super(METHOD.GET, path);
+ this.action = checkNotNull(CoreAdminParams.ACTION, action);
}
@Override
@@ -165,16 +149,8 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String asyncId = null;
protected boolean waitForFinalState = false;
- public AsyncCollectionAdminRequest(METHOD method, CollectionAction action) {
- super(method, action);
- }
-
- /**
- * @deprecated Use {@link #AsyncCollectionAdminRequest(METHOD, CollectionAction)}.
- */
- @Deprecated(since = "11.0")
public AsyncCollectionAdminRequest(CollectionAction action) {
- this(METHOD.POST, action);
+ super(action);
}
@Override
@@ -275,19 +251,9 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String collection;
protected Boolean followAliases;
- public AsyncCollectionSpecificAdminRequest(
- METHOD method, CollectionAction action, String collection) {
- super(method, action);
- this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
- }
-
- /**
- * @deprecated Use {@link #AsyncCollectionSpecificAdminRequest(METHOD, CollectionAction,
- * String)}.
- */
- @Deprecated(since = "11.0")
public AsyncCollectionSpecificAdminRequest(CollectionAction action, String collection) {
- this(METHOD.POST, action, collection);
+ super(action);
+ this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
}
public String getCollectionName() {
@@ -314,22 +280,12 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String shard;
public AsyncShardSpecificAdminRequest(
- METHOD method, CollectionAction action, String collection, String shard) {
- super(method, action);
+ CollectionAction action, String collection, String shard) {
+ super(action);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.shard = checkNotNull(CoreAdminParams.SHARD, shard);
}
- /**
- * @deprecated Use {@link #AsyncShardSpecificAdminRequest(METHOD, CollectionAction, String,
- * String)}.
- */
- @Deprecated(since = "11.0")
- public AsyncShardSpecificAdminRequest(
- CollectionAction action, String collection, String shard) {
- this(METHOD.POST, action, collection, shard);
- }
-
@Override
public SolrParams getParams() {
ModifiableSolrParams params = new ModifiableSolrParams(super.getParams());
@@ -345,21 +301,12 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String collection;
protected String shard;
- public ShardSpecificAdminRequest(
- METHOD method, CollectionAction action, String collection, String shard) {
- super(method, action);
+ public ShardSpecificAdminRequest(CollectionAction action, String collection, String shard) {
+ super(action);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.shard = checkNotNull(CoreAdminParams.SHARD, shard);
}
- /**
- * @deprecated Use {@link #ShardSpecificAdminRequest(METHOD, CollectionAction, String, String)}.
- */
- @Deprecated(since = "11.0")
- public ShardSpecificAdminRequest(CollectionAction action, String collection, String shard) {
- this(METHOD.POST, action, collection, shard);
- }
-
@Override
public SolrParams getParams() {
ModifiableSolrParams params = new ModifiableSolrParams(super.getParams());
@@ -383,22 +330,12 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String node;
protected String role;
- public CollectionAdminRoleRequest(
- METHOD method, CollectionAction action, String node, String role) {
- super(method, action);
+ public CollectionAdminRoleRequest(CollectionAction action, String node, String role) {
+ super(action);
this.role = checkNotNull(CollectionAdminParams.ROLE, role);
this.node = checkNotNull(CoreAdminParams.NODE, node);
}
- /**
- * @deprecated Use {@link #CollectionAdminRoleRequest(METHOD, CollectionAction, String,
- * String)}.
- */
- @Deprecated(since = "11.0")
- public CollectionAdminRoleRequest(CollectionAction action, String node, String role) {
- this(METHOD.POST, action, node, role);
- }
-
public String getNode() {
return this.node;
}
@@ -587,10 +524,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
Integer numNrtReplicas,
Integer numTlogReplicas,
Integer numPullReplicas) {
- super(
- METHOD.POST,
- CollectionAction.CREATE,
- SolrIdentifierValidator.validateCollectionName(collection));
+ super(CollectionAction.CREATE, SolrIdentifierValidator.validateCollectionName(collection));
// NOTE: there's very little we can assert about the args because nothing but "collection" is
// required by the server
if ((null != shards) && (null != numShards)) {
@@ -787,7 +721,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
public static class Reload extends AsyncCollectionSpecificAdminRequest {
private Reload(String collection) {
- super(METHOD.POST, CollectionAction.RELOAD, collection);
+ super(CollectionAction.RELOAD, collection);
}
}
@@ -799,7 +733,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
String target;
public Rename(String collection, String target) {
- super(METHOD.POST, CollectionAction.RENAME, collection);
+ super(CollectionAction.RENAME, collection);
this.target = target;
}
@@ -823,7 +757,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
* @param node The node to be deleted
*/
public DeleteNode(String node) {
- super(METHOD.POST, CollectionAction.DELETENODE);
+ super(CollectionAction.DELETENODE);
this.node = checkNotNull("node", node);
}
@@ -844,7 +778,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
* @param target node where the new replicas are to be created
*/
public ReplaceNode(String source, String target) {
- super(METHOD.POST, CollectionAction.REPLACENODE);
+ super(CollectionAction.REPLACENODE);
this.sourceNode = checkNotNull(CollectionParams.SOURCE_NODE, source);
this.targetNode = target;
}
@@ -878,7 +812,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected int timeout = -1;
public MoveReplica(String collection, String replica, String targetNode) {
- super(METHOD.POST, CollectionAction.MOVEREPLICA);
+ super(CollectionAction.MOVEREPLICA);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.replica = checkNotNull(CoreAdminParams.REPLICA, replica);
this.targetNode = checkNotNull(CollectionParams.TARGET_NODE, targetNode);
@@ -886,7 +820,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
}
public MoveReplica(String collection, String shard, String sourceNode, String targetNode) {
- super(METHOD.POST, CollectionAction.MOVEREPLICA);
+ super(CollectionAction.MOVEREPLICA);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.shard = checkNotNull(CoreAdminParams.SHARD, shard);
this.sourceNode = checkNotNull(CollectionParams.SOURCE_NODE, sourceNode);
@@ -953,7 +887,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
}
public RebalanceLeaders(String collection) {
- super(METHOD.POST, CollectionAction.REBALANCELEADERS);
+ super(CollectionAction.REBALANCELEADERS);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
}
@@ -994,7 +928,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
Map<String, Object> collectionParams = new HashMap<>();
private ReindexCollection(String collection) {
- super(METHOD.POST, CollectionAction.REINDEXCOLLECTION, collection);
+ super(CollectionAction.REINDEXCOLLECTION, collection);
}
/** Target collection name (null if the same). */
@@ -1087,12 +1021,12 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected Float rawSizeSamplingPercent = null;
private ColStatus(String collection) {
- super(METHOD.GET, CollectionAction.COLSTATUS);
+ super(CollectionAction.COLSTATUS);
this.collection = collection;
}
private ColStatus() {
- super(METHOD.GET, CollectionAction.COLSTATUS);
+ super(CollectionAction.COLSTATUS);
}
public ColStatus setWithSegments(boolean withSegments) {
@@ -1160,7 +1094,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
public static class Delete extends AsyncCollectionSpecificAdminRequest {
private Delete(String collection) {
- super(METHOD.POST, CollectionAction.DELETE, collection);
+ super(CollectionAction.DELETE, collection);
}
}
@@ -1181,7 +1115,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected Properties extraProperties;
public Backup(String collection, String name) {
- super(METHOD.POST, CollectionAction.BACKUP, collection);
+ super(CollectionAction.BACKUP, collection);
this.name = name;
this.repositoryName = Optional.empty();
}
@@ -1327,7 +1261,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected Integer backupId;
public Restore(String collection, String backupName) {
- super(METHOD.POST, CollectionAction.RESTORE, collection);
+ super(CollectionAction.RESTORE, collection);
this.backupName = backupName;
}
@@ -1515,7 +1449,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String location;
public InstallShard(String collection, String shard, String location, String backupRepository) {
- super(METHOD.POST, CollectionAction.INSTALLSHARDDATA, collection, shard);
+ super(CollectionAction.INSTALLSHARDDATA, collection, shard);
this.repositoryName = backupRepository;
this.location = location;
@@ -1547,10 +1481,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected final String commitName;
public CreateSnapshot(String collection, String commitName) {
- super(
- METHOD.POST,
- CollectionAction.CREATESNAPSHOT,
- checkNotNull(CoreAdminParams.COLLECTION, collection));
+ super(CollectionAction.CREATESNAPSHOT, checkNotNull(CoreAdminParams.COLLECTION, collection));
this.commitName = checkNotNull(CoreAdminParams.COMMIT_NAME, commitName);
}
@@ -1577,10 +1508,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected final String commitName;
public DeleteSnapshot(String collection, String commitName) {
- super(
- METHOD.POST,
- CollectionAction.DELETESNAPSHOT,
- checkNotNull(CoreAdminParams.COLLECTION, collection));
+ super(CollectionAction.DELETESNAPSHOT, checkNotNull(CoreAdminParams.COLLECTION, collection));
this.commitName = checkNotNull(CoreAdminParams.COMMIT_NAME, commitName);
}
@@ -1605,10 +1533,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
@SuppressWarnings("serial")
public static class ListSnapshots extends AsyncCollectionSpecificAdminRequest {
public ListSnapshots(String collection) {
- super(
- METHOD.GET,
- CollectionAction.LISTSNAPSHOTS,
- checkNotNull(CoreAdminParams.COLLECTION, collection));
+ super(CollectionAction.LISTSNAPSHOTS, checkNotNull(CoreAdminParams.COLLECTION, collection));
}
@Override
@@ -1655,7 +1580,6 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private CreateShard(String collection, String shard) {
super(
- METHOD.POST,
CollectionAction.CREATESHARD,
collection,
SolrIdentifierValidator.validateShardName(shard));
@@ -1685,7 +1609,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String sleep;
private MockCollTask(String collection) {
- super(METHOD.POST, CollectionAction.MOCK_COLL_TASK);
+ super(CollectionAction.MOCK_COLL_TASK);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
}
@@ -1723,7 +1647,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String createNodeSet;
private SplitShard(String collection) {
- super(METHOD.POST, CollectionAction.SPLITSHARD);
+ super(CollectionAction.SPLITSHARD);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
}
@@ -1847,7 +1771,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private Boolean deleteDataDir;
private DeleteShard(String collection, String shard) {
- super(METHOD.POST, CollectionAction.DELETESHARD, collection, shard);
+ super(CollectionAction.DELETESHARD, collection, shard);
}
public Boolean getDeleteInstanceDir() {
@@ -1894,7 +1818,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
// FORCELEADER request
public static class ForceLeader extends ShardSpecificAdminRequest {
private ForceLeader(String collection, String shard) {
- super(METHOD.POST, CollectionAction.FORCELEADER, collection, shard);
+ super(CollectionAction.FORCELEADER, collection, shard);
}
}
@@ -1927,7 +1851,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String requestId = null;
private RequestStatus(String requestId) {
- super(METHOD.GET, CollectionAction.REQUESTSTATUS);
+ super(CollectionAction.REQUESTSTATUS);
this.requestId = checkNotNull("requestId", requestId);
}
@@ -1988,7 +1912,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected Boolean flush = null;
private DeleteStatus(String requestId, Boolean flush) {
- super(METHOD.POST, CollectionAction.DELETESTATUS);
+ super(CollectionAction.DELETESTATUS);
if (requestId == null && flush == null)
throw new IllegalArgumentException(
"Either requestid or flush parameter must be specified.");
@@ -2039,7 +1963,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private Map<String, String> properties = new HashMap<>();
public SetAliasProperty(String aliasName) {
- super(METHOD.POST, CollectionAction.ALIASPROP);
+ super(CollectionAction.ALIASPROP);
this.aliasName = SolrIdentifierValidator.validateAliasName(aliasName);
}
@@ -2078,7 +2002,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String aliasedCollections;
private CreateAlias(String aliasName, String aliasedCollections) {
- super(METHOD.POST, CollectionAction.CREATEALIAS);
+ super(CollectionAction.CREATEALIAS);
this.aliasName = SolrIdentifierValidator.validateAliasName(aliasName);
this.aliasedCollections = checkNotNull("aliasedCollections", aliasedCollections);
}
@@ -2152,7 +2076,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
String start,
String interval,
Create createCollTemplate) {
- super(METHOD.POST, CollectionAction.CREATEALIAS);
+ super(CollectionAction.CREATEALIAS);
this.aliasName = aliasName;
this.start = start;
this.interval = interval;
@@ -2278,7 +2202,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
public CreateCategoryRoutedAlias(
String aliasName, String routerField, int maxCardinality, Create createCollTemplate) {
- super(METHOD.POST, CollectionAction.CREATEALIAS);
+ super(CollectionAction.CREATEALIAS);
this.aliasName = aliasName;
this.routerField = routerField;
this.maxCardinality = maxCardinality;
@@ -2384,7 +2308,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
public DimensionalRoutedAlias(
String aliasName, Create createCollTemplate, RoutedAliasAdminRequest... dims) {
- super(METHOD.POST, CollectionAction.CREATEALIAS);
+ super(CollectionAction.CREATEALIAS);
this.aliasName = aliasName;
this.createCollTemplate = createCollTemplate;
this.dims = dims;
@@ -2468,7 +2392,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String aliasName;
private DeleteAlias(String aliasName) {
- super(METHOD.POST, CollectionAction.DELETEALIAS);
+ super(CollectionAction.DELETEALIAS);
this.aliasName = checkNotNull("aliasName", aliasName);
}
@@ -2523,7 +2447,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String createNodeSet;
private AddReplica(String collection, String shard, String routeKey, Replica.Type type) {
- super(METHOD.POST, CollectionAction.ADDREPLICA);
+ super(CollectionAction.ADDREPLICA);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.shard = shard;
this.routeKey = routeKey;
@@ -2724,19 +2648,19 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private Integer count;
private DeleteReplica(String collection, String shard, String replica) {
- super(METHOD.POST, CollectionAction.DELETEREPLICA, collection);
+ super(CollectionAction.DELETEREPLICA, collection);
this.shard = shard;
this.replica = replica;
}
private DeleteReplica(String collection, String shard, int count) {
- super(METHOD.POST, CollectionAction.DELETEREPLICA, collection);
+ super(CollectionAction.DELETEREPLICA, collection);
this.shard = shard;
this.count = count;
}
private DeleteReplica(String collection, int count) {
- super(METHOD.POST, CollectionAction.DELETEREPLICA, collection);
+ super(CollectionAction.DELETEREPLICA, collection);
this.count = count;
}
@@ -2823,7 +2747,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private String propertyValue;
private ClusterProp(String propertyName, String propertyValue) {
- super(METHOD.POST, CollectionAction.CLUSTERPROP);
+ super(CollectionAction.CLUSTERPROP);
this.propertyName = checkNotNull("propertyName", propertyName);
this.propertyValue = propertyValue;
}
@@ -2863,7 +2787,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private String propertyValue;
private CollectionProp(String collection, String propertyName, String propertyValue) {
- super(METHOD.POST, CollectionAction.COLLECTIONPROP, collection);
+ super(CollectionAction.COLLECTIONPROP, collection);
this.propertyName = checkNotNull("propertyName", propertyName);
this.propertyValue = propertyValue;
}
@@ -2906,7 +2830,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private Properties properties;
private Migrate(String collection, String targetCollection, String splitKey) {
- super(METHOD.POST, CollectionAction.MIGRATE);
+ super(CollectionAction.MIGRATE);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.targetCollection = checkNotNull("targetCollection", targetCollection);
this.splitKey = checkNotNull("split.key", splitKey);
@@ -2967,7 +2891,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
// ADDROLE request
public static class AddRole extends CollectionAdminRoleRequest {
private AddRole(String node, String role) {
- super(METHOD.POST, CollectionAction.ADDROLE, node, role);
+ super(CollectionAction.ADDROLE, node, role);
}
}
@@ -2979,7 +2903,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
// REMOVEROLE request
public static class RemoveRole extends CollectionAdminRoleRequest {
private RemoveRole(String node, String role) {
- super(METHOD.POST, CollectionAction.REMOVEROLE, node, role);
+ super(CollectionAction.REMOVEROLE, node, role);
}
}
@@ -2992,7 +2916,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
public static class OverseerStatus extends AsyncCollectionAdminRequest {
public OverseerStatus() {
- super(METHOD.GET, CollectionAction.OVERSEERSTATUS);
+ super(CollectionAction.OVERSEERSTATUS);
}
}
@@ -3001,7 +2925,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
extends CollectionAdminRequest<RequestApiDistributedProcessingResponse> {
public RequestApiDistributedProcessing() {
- super(METHOD.GET, CollectionAction.DISTRIBUTEDAPIPROCESSING);
+ super(CollectionAction.DISTRIBUTEDAPIPROCESSING);
}
@Override
@@ -3030,7 +2954,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected String routeKey = null;
public ClusterStatus() {
- super(METHOD.GET, CollectionAction.CLUSTERSTATUS);
+ super(CollectionAction.CLUSTERSTATUS);
}
public ClusterStatus setCollectionName(String collectionName) {
@@ -3085,7 +3009,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
public static class ListAliases extends CollectionAdminRequest<CollectionAdminResponse> {
public ListAliases() {
- super(METHOD.GET, CollectionAction.LISTALIASES);
+ super(CollectionAction.LISTALIASES);
}
@Override
@@ -3105,7 +3029,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
// LIST request
public static class List extends CollectionAdminRequest<CollectionAdminResponse> {
public List() {
- super(METHOD.GET, CollectionAction.LIST);
+ super(CollectionAction.LIST);
}
@Override
@@ -3178,7 +3102,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private Boolean purgeUnused;
private DeleteBackup(String backupName) {
- super(METHOD.POST, CollectionAction.DELETEBACKUP);
+ super(CollectionAction.DELETEBACKUP);
this.name = backupName;
}
@@ -3281,7 +3205,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private String repositoryName;
private ListBackup(String backupName) {
- super(METHOD.GET, CollectionAction.LISTBACKUP);
+ super(CollectionAction.LISTBACKUP);
this.backupName = backupName;
}
@@ -3343,7 +3267,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
String replica,
String propertyName,
String propertyValue) {
- super(METHOD.POST, CollectionAction.ADDREPLICAPROP, collection, shard);
+ super(CollectionAction.ADDREPLICAPROP, collection, shard);
this.replica = checkNotNull(CoreAdminParams.REPLICA, replica);
this.propertyName = checkNotNull("propertyName", propertyName);
this.propertyValue = checkNotNull("propertyValue", propertyValue);
@@ -3399,7 +3323,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
private DeleteReplicaProp(
String collection, String shard, String replica, String propertyName) {
- super(METHOD.POST, CollectionAction.DELETEREPLICAPROP, collection, shard);
+ super(CollectionAction.DELETEREPLICAPROP, collection, shard);
this.replica = checkNotNull(CoreAdminParams.REPLICA, replica);
this.propertyName = checkNotNull("propertyName", propertyName);
}
@@ -3435,7 +3359,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected Boolean shardUnique;
private BalanceShardUnique(String collection, String propertyName) {
- super(METHOD.POST, CollectionAction.BALANCESHARDUNIQUE);
+ super(CollectionAction.BALANCESHARDUNIQUE);
this.collection = checkNotNull(CoreAdminParams.COLLECTION, collection);
this.propertyName = checkNotNull("propertyName", propertyName);
}
@@ -3483,7 +3407,7 @@ public abstract class CollectionAdminRequest<T extends CollectionAdminResponse>
protected Map<String, Object> attributes;
private Modify(String collection, Map<String, Object> attributes) {
- super(METHOD.POST, CollectionAction.MODIFYCOLLECTION, collection);
+ super(CollectionAction.MODIFYCOLLECTION, collection);
this.attributes = attributes;
}
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java
index 117265606f2..4c21ce6c776 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/ConfigSetAdminRequest.java
@@ -51,28 +51,12 @@ public abstract class ConfigSetAdminRequest<
return this;
}
- public ConfigSetAdminRequest(METHOD method) {
- this(method, "/admin/configs");
- }
-
- public ConfigSetAdminRequest(METHOD method, String path) {
- super(method, path);
- }
-
- /**
- * @deprecated Use {@link #ConfigSetAdminRequest(METHOD)}.
- */
- @Deprecated(since = "11.0")
public ConfigSetAdminRequest() {
- this(METHOD.POST);
+ super(METHOD.GET, "/admin/configs");
}
- /**
- * @deprecated Use {@link #ConfigSetAdminRequest(METHOD, String)}.
- */
- @Deprecated(since = "11.0")
public ConfigSetAdminRequest(String path) {
- this(METHOD.POST, path);
+ super(METHOD.GET, path);
}
protected abstract Q getThis();
@@ -95,18 +79,6 @@ public abstract class ConfigSetAdminRequest<
extends ConfigSetAdminRequest<T, ConfigSetAdminResponse> {
protected String configSetName = null;
- protected ConfigSetSpecificAdminRequest(METHOD method) {
- super(method);
- }
-
- /**
- * @deprecated Use {@link #ConfigSetSpecificAdminRequest(METHOD)}.
- */
- @Deprecated(since = "11.0")
- protected ConfigSetSpecificAdminRequest() {
- this(METHOD.POST);
- }
-
public final T setConfigSetName(String configSetName) {
this.configSetName = configSetName;
return getThis();
@@ -155,8 +127,8 @@ public abstract class ConfigSetAdminRequest<
protected Boolean cleanup;
public Upload() {
- super(METHOD.POST);
action = ConfigSetAction.UPLOAD;
+ setMethod(SolrRequest.METHOD.POST);
}
@Override
@@ -288,7 +260,6 @@ public abstract class ConfigSetAdminRequest<
protected Properties properties;
public Create() {
- super(METHOD.POST);
action = ConfigSetAction.CREATE;
}
@@ -334,7 +305,6 @@ public abstract class ConfigSetAdminRequest<
// DELETE request
public static class Delete extends ConfigSetSpecificAdminRequest<Delete> {
public Delete() {
- super(METHOD.POST);
action = ConfigSetAction.DELETE;
}
@@ -347,7 +317,6 @@ public abstract class ConfigSetAdminRequest<
// LIST request
public static class List extends ConfigSetAdminRequest<List, ConfigSetAdminResponse.List> {
public List() {
- super(METHOD.GET);
action = ConfigSetAction.LIST;
}
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
index ecdb3ba5fb8..d31b5651fbe 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
@@ -67,7 +67,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
private String collectionConfigName;
public Create() {
- super(METHOD.POST);
action = CoreAdminAction.CREATE;
}
@@ -262,7 +261,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
protected Boolean onlyIfLeaderActive;
public WaitForState() {
- super(METHOD.POST);
action = CoreAdminAction.PREPRECOVERY;
}
@@ -360,7 +358,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
public static class RequestRecovery extends CoreAdminRequest {
public RequestRecovery() {
- super(METHOD.POST);
action = CoreAdminAction.REQUESTRECOVERY;
}
@@ -383,7 +380,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
private String collection;
public RequestSyncShard() {
- super(METHOD.POST);
action = CoreAdminAction.REQUESTSYNCSHARD;
}
@@ -451,7 +447,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
protected List<String> srcCores;
public MergeIndexes() {
- super(METHOD.POST);
action = CoreAdminAction.MERGEINDEXES;
}
@@ -499,7 +494,6 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
protected boolean deleteInstanceDir;
public Unload(boolean deleteIndex) {
- super(METHOD.POST);
action = CoreAdminAction.UNLOAD;
this.deleteIndex = deleteIndex;
}
@@ -542,7 +536,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
private String commitName;
public CreateSnapshot(String commitName) {
- super(METHOD.POST);
+ super();
this.action = CoreAdminAction.CREATESNAPSHOT;
if (commitName == null) {
throw new NullPointerException("Please specify non null value for commitName parameter.");
@@ -566,7 +560,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
private String commitName;
public DeleteSnapshot(String commitName) {
- super(METHOD.POST);
+ super();
this.action = CoreAdminAction.DELETESNAPSHOT;
if (commitName == null) {
@@ -589,33 +583,17 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
public static class ListSnapshots extends CoreAdminRequest {
public ListSnapshots() {
- super(METHOD.GET);
+ super();
this.action = CoreAdminAction.LISTSNAPSHOTS;
}
}
- public CoreAdminRequest(METHOD method) {
- this(method, "/admin/cores");
- }
-
- public CoreAdminRequest(METHOD method, String path) {
- super(method, path);
- }
-
- /**
- * @deprecated Use {@link #CoreAdminRequest(METHOD)}.
- */
- @Deprecated(since = "11.0")
public CoreAdminRequest() {
- this(METHOD.POST);
+ super(METHOD.GET, "/admin/cores");
}
- /**
- * @deprecated Use {@link #CoreAdminRequest(METHOD, String)}.
- */
- @Deprecated(since = "11.0")
public CoreAdminRequest(String path) {
- this(METHOD.POST, path);
+ super(METHOD.GET, path);
}
public void setCoreName(String coreName) {
@@ -672,7 +650,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
public static CoreAdminResponse reloadCore(String name, SolrClient client)
throws SolrServerException, IOException {
- CoreAdminRequest req = new CoreAdminRequest(METHOD.POST);
+ CoreAdminRequest req = new CoreAdminRequest();
req.setCoreName(name);
req.setAction(CoreAdminAction.RELOAD);
return req.process(client);
@@ -704,7 +682,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
*/
public static CoreAdminResponse renameCore(String coreName, String newName, SolrClient client)
throws SolrServerException, IOException {
- CoreAdminRequest req = new CoreAdminRequest(METHOD.POST);
+ CoreAdminRequest req = new CoreAdminRequest();
req.setCoreName(coreName);
req.setOtherCoreName(SolrIdentifierValidator.validateCoreName(newName));
req.setAction(CoreAdminAction.RENAME);
@@ -723,7 +701,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
*/
public static CoreAdminResponse swapCore(String core1, String core2, SolrClient client)
throws SolrServerException, IOException {
- CoreAdminRequest req = new CoreAdminRequest(METHOD.POST);
+ CoreAdminRequest req = new CoreAdminRequest();
req.setCoreName(core1);
req.setOtherCoreName(core2);
req.setAction(CoreAdminAction.SWAP);
@@ -737,7 +715,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
public static CoreStatus getCoreStatus(String coreName, boolean getIndexInfo, SolrClient client)
throws SolrServerException, IOException {
- CoreAdminRequest req = new CoreAdminRequest(METHOD.GET);
+ CoreAdminRequest req = new CoreAdminRequest();
req.setAction(CoreAdminAction.STATUS);
req.setIndexInfoNeeded(getIndexInfo);
return new CoreStatus(req.process(client).getCoreStatus(coreName));
@@ -745,7 +723,7 @@ public class CoreAdminRequest extends SolrRequest<CoreAdminResponse> {
public static CoreAdminResponse getStatus(String name, SolrClient client)
throws SolrServerException, IOException {
- CoreAdminRequest req = new CoreAdminRequest(METHOD.GET);
+ CoreAdminRequest req = new CoreAdminRequest();
req.setCoreName(name);
req.setAction(CoreAdminAction.STATUS);
return req.process(client);
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCollectionAdminRequest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCollectionAdminRequest.java
index 9f9ddade79f..3963b5866a3 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCollectionAdminRequest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCollectionAdminRequest.java
@@ -17,34 +17,14 @@
package org.apache.solr.client.solrj.request;
import org.apache.solr.SolrTestCase;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrRequest.METHOD;
import org.apache.solr.client.solrj.request.CollectionAdminRequest.CreateAlias;
import org.apache.solr.client.solrj.request.CollectionAdminRequest.CreateShard;
-import org.apache.solr.client.solrj.response.CollectionAdminResponse;
import org.apache.solr.common.SolrException;
-import org.apache.solr.common.params.CollectionParams.CollectionAction;
import org.junit.Test;
/** Unit tests for {@link CollectionAdminRequest}. */
public class TestCollectionAdminRequest extends SolrTestCase {
- @Test
- @SuppressWarnings("deprecation")
- public void testAdminRequestsChooseExplicitHttpMethods() {
- CollectionAdminRequest<CollectionAdminResponse> legacyRequest =
- new CollectionAdminRequest<>(CollectionAction.CREATE) {
- @Override
- protected CollectionAdminResponse createResponse(SolrClient client) {
- return new CollectionAdminResponse();
- }
- };
- assertEquals(METHOD.POST, legacyRequest.getMethod());
- assertEquals(
- METHOD.POST, CollectionAdminRequest.createCollection("collection", null, 1, 1).getMethod());
- assertEquals(METHOD.GET, new CollectionAdminRequest.List().getMethod());
- }
-
@Test
public void testInvalidCollectionNameRejectedWhenCreatingCollection() {
final SolrException e =
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
index f9b3fd33a7b..794129d34b4 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java
@@ -19,7 +19,6 @@ package org.apache.solr.client.solrj.request;
import java.io.File;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrRequest.METHOD;
import org.apache.solr.client.solrj.response.ConfigSetAdminResponse;
import org.apache.solr.common.params.ConfigSetParams;
import org.junit.Test;
@@ -27,14 +26,6 @@ import org.junit.Test;
/** Basic error checking of ConfigSetAdminRequests. */
public class TestConfigSetAdminRequest extends SolrTestCaseJ4 {
- @Test
- @SuppressWarnings("deprecation")
- public void testAdminRequestsChooseExplicitHttpMethods() {
- assertEquals(METHOD.POST, new MyConfigSetAdminRequest().getMethod());
- assertEquals(METHOD.POST, new ConfigSetAdminRequest.Create().getMethod());
- assertEquals(METHOD.GET, new ConfigSetAdminRequest.List().getMethod());
- }
-
@Test
public void testNoAction() {
MyConfigSetAdminRequest request = new MyConfigSetAdminRequest();
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
index d5a8c36b173..d8630d016ff 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
@@ -30,7 +30,6 @@ import org.apache.commons.io.FileUtils;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.client.solrj.SolrRequest.METHOD;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.AbstractEmbeddedSolrServerTestCase;
import org.apache.solr.client.solrj.request.CoreAdminRequest.Create;
@@ -49,14 +48,6 @@ import org.junit.Test;
public class TestCoreAdmin extends AbstractEmbeddedSolrServerTestCase {
- @Test
- @SuppressWarnings("deprecation")
- public void testAdminRequestsChooseExplicitHttpMethods() {
- assertEquals(METHOD.POST, new CoreAdminRequest().getMethod());
- assertEquals(METHOD.POST, new CoreAdminRequest.Create().getMethod());
- assertEquals(METHOD.GET, new CoreAdminRequest.ListSnapshots().getMethod());
- }
-
@Test
public void testConfigSet() throws Exception {