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 170d3b69b52..28d2e3af535 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 @@ -111,6 +111,11 @@ 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; @@ -157,6 +162,7 @@ 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; @@ -533,6 +539,10 @@ public enum CollectionOperation implements CollectionOp { return null; }), + /** + * V2 equivalent: {@link RenameCollectionApi} ({@code POST + * /collections/{collectionName}/rename}). + */ RENAME_OP( RENAME, (req, rsp, h) -> { @@ -541,6 +551,7 @@ public enum CollectionOperation implements CollectionOp { return copy(req.getParams(), map, FOLLOW_ALIASES); }), + /** No V2 equivalent yet. */ REINDEXCOLLECTION_OP( REINDEXCOLLECTION, (req, rsp, h) -> { @@ -626,6 +637,10 @@ public enum CollectionOperation implements CollectionOp { 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, @@ -703,6 +718,10 @@ public enum CollectionOperation implements CollectionOp { 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) -> { @@ -769,7 +788,12 @@ collection, propName, new UpdateCollectionPropertyRequestBody(val)) 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) -> { @@ -794,6 +818,12 @@ collection, propName, new UpdateCollectionPropertyRequestBody(val)) * 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) -> { @@ -842,6 +872,10 @@ collection, propName, new UpdateCollectionPropertyRequestBody(val)) 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) -> { @@ -849,6 +883,10 @@ collection, propName, new UpdateCollectionPropertyRequestBody(val)) 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) -> { @@ -1003,6 +1041,10 @@ collection, propName, new UpdateCollectionPropertyRequestBody(val)) 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) -> {