This is an automated email from the ASF dual-hosted git repository. dsmiley pushed a commit to branch branch_10x in repository https://gitbox.apache.org/repos/asf/solr.git
commit 4c88380c161c31e40f35f9c5ab4e943dbef865f8 Author: Serhiy Bzhezytskyy <[email protected]> AuthorDate: Wed Oct 7 23:14:04 2026 +0300 SOLR-17398: Link V1 collection operations to their V2 equivalents (#5053) (cherry picked from commit 1d7a1e9062734acd37489e85173044d8d974c88a) --- .../solr/handler/admin/CollectionsHandler.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java index 05a47f4106c..12055863ea6 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java @@ -114,6 +114,11 @@ import java.util.concurrent.TimeoutException; import org.apache.solr.api.AnnotatedApi; import org.apache.solr.api.Api; import org.apache.solr.api.JerseyResource; +import org.apache.solr.client.api.endpoint.ClusterPropertyApis; +import org.apache.solr.client.api.endpoint.ListAliasesApi; +import org.apache.solr.client.api.endpoint.ListClusterNodesApi; +import org.apache.solr.client.api.endpoint.ListCollectionsApi; +import org.apache.solr.client.api.endpoint.RenameCollectionApi; import org.apache.solr.client.api.model.AddReplicaPropertyRequestBody; import org.apache.solr.client.api.model.CreateAliasRequestBody; import org.apache.solr.client.api.model.CreateCollectionSnapshotRequestBody; @@ -160,6 +165,7 @@ import org.apache.solr.core.CloudConfig; import org.apache.solr.core.CoreContainer; import org.apache.solr.core.snapshots.CollectionSnapshotMetaData; import org.apache.solr.core.snapshots.SolrSnapshotManager; +import org.apache.solr.handler.ClusterAPI; import org.apache.solr.handler.RequestHandlerBase; import org.apache.solr.handler.admin.api.AddReplicaProperty; import org.apache.solr.handler.admin.api.AdminAPIBase; @@ -538,6 +544,10 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission return null; }), + /** + * V2 equivalent: {@link RenameCollectionApi} ({@code POST + * /collections/{collectionName}/rename}). + */ RENAME_OP( RENAME, (req, rsp, h) -> { @@ -546,6 +556,7 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission return copy(req.getParams(), map, FOLLOW_ALIASES); }), + /** No V2 equivalent yet. */ REINDEXCOLLECTION_OP( REINDEXCOLLECTION, (req, rsp, h) -> { @@ -631,6 +642,10 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission V2ApiUtils.squashIntoSolrResponseWithoutHeader(rsp, getAliasesResponse); return null; }), + /** + * V2 equivalent: {@link SplitShardAPI} ({@code POST /collections/{collection}/shards} with the + * {@code split} command). + */ SPLITSHARD_OP( SPLITSHARD, DEFAULT_COLLECTION_OP_TIMEOUT * 5, @@ -708,6 +723,10 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission DeleteReplica.invokeWithV1Params(h.coreContainer, req, rsp); return null; }), + /** + * V2 equivalent: {@link MigrateDocsAPI} ({@code POST /collections/{collection}} with the {@code + * migrate-docs} command). + */ MIGRATE_OP( MIGRATE, (req, rsp, h) -> { @@ -792,7 +811,12 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission V2ApiUtils.squashIntoSolrResponseWithoutHeader(rsp, response); return null; }), + /** + * V2 equivalent: {@link ClusterAPI#getOverseerStatus} ({@code GET /cluster/overseer}), which + * calls this operation. + */ OVERSEERSTATUS_OP(OVERSEERSTATUS, (req, rsp, h) -> new LinkedHashMap<>()), + /** No V2 equivalent yet. */ DISTRIBUTEDAPIPROCESSING_OP( DISTRIBUTEDAPIPROCESSING, (req, rsp, h) -> { @@ -817,6 +841,12 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission * Handle cluster status request. Can return status per specific collection/shard or per all * collections. */ + /** + * Superseded by V2, which splits it up: {@link ListCollectionsApi} ({@code GET + * /collections?detailed=true}) for the collections tree, {@link ListClusterNodesApi} ({@code + * GET /cluster/nodes}), {@link ListAliasesApi} ({@code GET /aliases}) and {@link + * ClusterPropertyApis} ({@code GET /cluster/properties}). + */ CLUSTERSTATUS_OP( CLUSTERSTATUS, (req, rsp, h) -> { @@ -865,6 +895,10 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission BalanceShardUnique.invokeFromV1Params(h.coreContainer, req, rsp); return null; }), + /** + * V2 equivalent: {@link RebalanceLeadersAPI} ({@code POST /collections/{collection}} with the + * {@code rebalance-leaders} command). + */ REBALANCELEADERS_OP( REBALANCELEADERS, (req, rsp, h) -> { @@ -872,6 +906,10 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission return null; }), // XXX should this command support followAliases? + /** + * V2 equivalent: {@link ModifyCollectionAPI} ({@code POST /collections/{collection}} with the + * {@code modify} command). + */ MODIFYCOLLECTION_OP( MODIFYCOLLECTION, (req, rsp, h) -> { @@ -1026,6 +1064,10 @@ public class CollectionsHandler extends RequestHandlerBase implements Permission V2ApiUtils.squashIntoSolrResponseWithoutHeader(rsp, replaceNodeResponse); return null; }), + /** + * V2 equivalent: {@link MoveReplicaAPI} ({@code POST /collections/{collection}} with the {@code + * move-replica} command). + */ MOVEREPLICA_OP( MOVEREPLICA, (req, rsp, h) -> {
