removeNode: support ignoreNodes options

Refs scylladb/scylla-tools-java#225

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>

Closes #178
This commit is contained in:
Benny Halevy 2021-10-01 14:12:59 +03:00 committed by Botond Dénes
parent 26a6919714
commit 2c43d99aa5
2 changed files with 13 additions and 2 deletions

View File

@ -991,13 +991,21 @@ public class StorageService extends MetricsMBean implements StorageServiceMBean,
* the host id to remove
*/
@Override
public void removeNode(String hostIdString) {
log(" removeNode(String token)");
public void removeNode(String hostIdString, String ignoreNodes) {
log(" removeNode(String token, String ignoreNodes)");
MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>();
APIClient.set_query_param(queryParams, "host_id", hostIdString);
if (ignoreNodes != null) {
APIClient.set_query_param(queryParams, "ignore_nodes", ignoreNodes);
}
client.post("/storage_service/remove_node", queryParams);
}
public void removeNode(String hostIdString) {
String ignoreNodes = null;
removeNode(hostIdString, ignoreNodes);
}
/**
* Get the status of a token removal.
*/

View File

@ -514,8 +514,11 @@ public interface StorageServiceMBean extends NotificationEmitter {
* removeToken removes token (and all data associated with enpoint that had
* it) from the ring
*/
@Deprecated
public void removeNode(String token);
public void removeNode(String token, String ignoreNodes);
/**
* Get the status of a token removal.
*/