From ad148a9dbc2b94f866ebb552001eafe2db75fb6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Fri, 8 Dec 2023 08:29:39 -0500 Subject: [PATCH] tools/scylla-nodetool: implement the move command In the java nodetool, this command ends up calling an API endpoint which just throws an exception saying moving tokens is not supported. So in the native implementation we just throw an exception to the same effect in scylla-nodetool itself. --- tools/scylla-nodetool.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/scylla-nodetool.cc b/tools/scylla-nodetool.cc index eb346cca47..ca9b962223 100644 --- a/tools/scylla-nodetool.cc +++ b/tools/scylla-nodetool.cc @@ -491,6 +491,10 @@ void listsnapshots_operation(scylla_rest_client& client, const bpo::variables_ma fmt::print(std::cout, "\nTotal TrueDiskSpaceUsed: {}\n\n", format_hr_size(utils::to_hr_size(true_size))); } +void move_operation(scylla_rest_client& client, const bpo::variables_map& vm) { + throw std::invalid_argument("This operation is not supported"); +} + void help_operation(const tool_app_template::config& cfg, const bpo::variables_map& vm) { if (vm.count("command")) { const auto command = vm["command"].as(); @@ -1018,6 +1022,20 @@ Fore more information, see: https://opensource.docs.scylladb.com/stable/operatin }, listsnapshots_operation }, + { + { + "move", + "Move the token to this node", +R"( +This operation is not supported. +)", + { }, + { + typed_option("new-token", "The new token to move to this node", 1), + }, + }, + move_operation + }, { { "rebuild",