Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) -> {
Expand All @@ -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) -> {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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) -> {
Expand Down Expand Up @@ -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) -> {
Expand All @@ -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) -> {
Expand Down Expand Up @@ -842,13 +872,21 @@ 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) -> {
new RebalanceLeaders(req, rsp, h).execute();
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) -> {
Expand Down Expand Up @@ -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) -> {
Expand Down
Loading