frankgh commented on code in PR #265: URL: https://github.com/apache/cassandra-sidecar/pull/265#discussion_r2392282273
########## client-common/src/main/java/org/apache/cassandra/sidecar/common/request/NodeMoveRequest.java: ########## @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.cassandra.sidecar.common.request; + +import io.netty.handler.codec.http.HttpMethod; +import org.apache.cassandra.sidecar.common.ApiEndpointsV1; +import org.apache.cassandra.sidecar.common.response.OperationalJobResponse; + +/** + * Represents a request to execute node move operation + */ +public class NodeMoveRequest extends JsonRequest<OperationalJobResponse> +{ + /** + * Constructs a request to execute a node move operation + * + * @param newToken the new token for the node to move to + */ + public NodeMoveRequest(String newToken) + { + super(ApiEndpointsV1.NODE_MOVE_ROUTE + "?newToken=" + newToken); Review Comment: should we make the `newToken` be part of the body payload instead of having it as a query string? ########## server-common/src/main/java/org/apache/cassandra/sidecar/common/server/StorageOperations.java: ########## @@ -174,4 +174,11 @@ default void outOfRangeDataCleanup(@NotNull String keyspace, @NotNull String tab * @return the current compaction throughput in megabytes per second, or 0 if throughput cannot be determined */ int getCompactionThroughputMbPerSec(); + + /** + * Triggers the node move operation to move the node to a new token. + * + * @param newToken the new token for the node to move to + */ + void move(String newToken); Review Comment: I think we need to handle the case where the token does not belong to the node. In Cassandra, it looks like we throw an `IOException` when token is not valid. Also we should have a test around this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

