@Override
  public SettableFuture<ConfigTaskResult> createTraining(
      String modelId,
      String modelType,
      boolean isTableModel,
      Map<String, String> parameters,
      boolean useAllData,
      List<List<Long>> timeRanges,
      String existingModelId,
      @Nullable List<String> tableList,
      @Nullable List<String> databaseList,
      @Nullable List<String> pathList) {
    final SettableFuture<ConfigTaskResult> future = SettableFuture.create();
    try (final ConfigNodeClient client =
        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
      final TCreateTrainingReq req = new TCreateTrainingReq(modelId, modelType, isTableModel);

      if (isTableModel) {
        TDataSchemaForTable dataSchemaForTable = new TDataSchemaForTable();
        dataSchemaForTable.setTableList(tableList);
        dataSchemaForTable.setDatabaseList(databaseList);
        req.setDataSchemaForTable(dataSchemaForTable);
      } else {
        TDataSchemaForTree dataSchemaForTree = new TDataSchemaForTree();
        dataSchemaForTree.setPath(pathList);
        req.setDataSchemaForTree(dataSchemaForTree);
      }
      req.setParameters(parameters);
      req.setUseAllData(useAllData);
      req.setTimeRanges(timeRanges);
      req.setExistingModelId(existingModelId);
      final TSStatus executionStatus = client.createTraining(req);
      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