HxpSerein commented on code in PR #14813:
URL: https://github.com/apache/iotdb/pull/14813#discussion_r1952881038
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java:
##########
@@ -2876,6 +2878,50 @@ public SettableFuture<ConfigTaskResult> removeDataNode(
return future;
}
+ @Override
+ public SettableFuture<ConfigTaskResult> removeConfigNode(
+ final RemoveConfigNodeStatement removeConfigNodeStatement) {
+ final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
+
+ int removeConfigNodeId = removeConfigNodeStatement.getNodeId();
+
+ LOGGER.info("Starting to remove ConfigNode with node-id {}",
removeConfigNodeId);
+ try (ConfigNodeClient configNodeClient =
+
CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+
+ TShowClusterResp showClusterResp = configNodeClient.showCluster();
+ List<TConfigNodeLocation> removeConfigNodeLocations =
+ showClusterResp.getConfigNodeList().stream()
+ .filter(node -> node.configNodeId == removeConfigNodeId)
+ .collect(Collectors.toList());
+ if (removeConfigNodeLocations.size() != 1) {
+ LOGGER.error(
+ "The ConfigNode to be removed is not in the cluster, or the input
format is incorrect.");
+ future.set(new ConfigTaskResult(TSStatusCode.REMOVE_CONFIGNODE_ERROR));
+ ;
Review Comment:
removed
--
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]