SOLR-16392: Convert v2 shard, replica deletion to JAX-RS #1594
Conversation
|
You learn something new every day: it turns out that DELETEREPLICA covers three distinct use-cases:
(1) and (2) are covered by the v2 APIs mentioned inline, but I'm struggling to come up with a REST-ful v2 API to cover that last scenario. Anyone have any ideas? |
|
Maybe we don't count it as a delete anymore, when the action is more of a scale. So |
Thanks for the suggestion! I have some REST-fulness quibbles: having a "replicas" path that doesn't live under Thinking aloud a bit, maybe we keep the idea of this being a "scaling" API, but drop the "replicas" path segment. e.g Longer term, maybe this behavior could even be folded into MODIFYCOLLECTION: when someone does a "modify" ( |
|
For now, I've ended up going with |
This commit tweaks the v2 binding for our "delete replica" API to be more
intuitive for users. Delete replica functionality now lives at:
- `DELETE /api/collections/cName/shards/sName/replicas/rName`
- `DELETE /api/collections/cName/shards/sName/replicas?count=3`
- `PUT /api/collections/cName/scale {"count": 3"}
depending on whether users want to delete a single replica by name,
multiple replicas from a single shard, or multiple replicas from all shards
respectively. These v2 APIs are experimental and currently subject to
change.
This commit also switches them (and a similar deleteshard API) over to
using JAX-RS.
https://issues.apache.org/jira/browse/SOLR-16392
Description
Solr is slowly migrating its v2 API definitions over to the JAX-RS framework. Some APIs have already been converted, but many remain: including the APIs for replica and shard deletion.
Solution
This PR migrates the v2 delete-replica and delete-shard APIs over to JAX-RS. No user-visible changes were made to the v2 delete-shard endpoint. Delete-replica however has been split into two separate endpoints (one to delete a single named replica, and one to delete a specified number of (unnamed) replicas. The v2 APIs now appear as below:
DELETE /api/collections/collName/shards/shardName(no changes)DELETE /api/collections/collName/shards/shardName/replicas/replicaNameDELETE /api/collections/collName/shards/shardName/replicas?count=3PUT /api/collections/collName/scale {"count": 3}Tests
See
DeleteReplicaAPITestandDeleteShardAPITestChecklist
Please review the following and check all that apply:
mainbranch../gradlew check.