@Override
  public SettableFuture<ConfigTaskResult> killQuery(final KillQueryStatement killQueryStatement) {
    int dataNodeId = -1;
    String queryId = killQueryStatement.getQueryId();
    SettableFuture<ConfigTaskResult> future = SettableFuture.create();
    if (!killQueryStatement.isKillAll()) {
      String[] splits = queryId.split("_");
      try {
        // We just judge the input queryId has three '_' and the DataNodeId from it is non-negative
        // here
        if (splits.length != 4 || ((dataNodeId = Integer.parseInt(splits[3])) < 0)) {
          future.setException(
              new IoTDBException(
                  "Please ensure your input <queryId> is correct",
                  TSStatusCode.SEMANTIC_ERROR.getStatusCode(),
                  true));
          return future;
        }
      } catch (NumberFormatException e) {
        future.setException(
            new IoTDBException(
                "Please ensure your input <queryId> is correct",
                TSStatusCode.SEMANTIC_ERROR.getStatusCode(),
                true));
        return future;
      }
    }
    try (ConfigNodeClient client =
        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
      final TSStatus executionStatus = client.killQuery(queryId, dataNodeId);
      if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != executionStatus.getCode()) {
        future.setException(new IoTDBException(executionStatus.message, executionStatus.code));
      } else {
        future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
      }
    } catch (final ClientManagerException | TException e) {
      future.setException(e);
    }
    return future;
  }
FIXME Consolidate this clientManager with the upper one.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/executor/ClusterConfigTaskExecutor.java