From 2c43d99aa53ee9d5178ccbe6c0d42e9f92ab82cd Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Fri, 1 Oct 2021 14:12:59 +0300 Subject: [PATCH] removeNode: support ignoreNodes options Refs scylladb/scylla-tools-java#225 Signed-off-by: Benny Halevy Closes #178 --- .../org/apache/cassandra/service/StorageService.java | 12 ++++++++++-- .../cassandra/service/StorageServiceMBean.java | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/cassandra/service/StorageService.java b/src/main/java/org/apache/cassandra/service/StorageService.java index a843699..3281bac 100644 --- a/src/main/java/org/apache/cassandra/service/StorageService.java +++ b/src/main/java/org/apache/cassandra/service/StorageService.java @@ -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 queryParams = new MultivaluedHashMap(); 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. */ diff --git a/src/main/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/main/java/org/apache/cassandra/service/StorageServiceMBean.java index 3aa9957..915bfd1 100644 --- a/src/main/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/main/java/org/apache/cassandra/service/StorageServiceMBean.java @@ -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. */