@Override
  public SettableFuture<ConfigTaskResult> useDatabase(
      final Use useDB, final IClientSession clientSession) {
    final SettableFuture<ConfigTaskResult> future = SettableFuture.create();

    final String database = useDB.getDatabaseId().getValue();
    if (InformationSchemaUtils.mayUseDB(database, clientSession, future)) {
      return future;
    }
    // Construct request using statement
    final List<String> databasePathPattern = Arrays.asList(ROOT, database);
    try (final ConfigNodeClient client =
        CONFIG_NODE_CLIENT_MANAGER.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
      // Send request to some API server
      final TGetDatabaseReq req =
          new TGetDatabaseReq(databasePathPattern, ALL_MATCH_SCOPE.serialize())
              .setIsTableModel(true);
      final TShowDatabaseResp resp = client.showDatabase(req);
      if (resp.getDatabaseInfoMap().containsKey(database)) {
        clientSession.setDatabaseName(database);
        future.set(new ConfigTaskResult(TSStatusCode.SUCCESS_STATUS));
      } else {
        future.setException(
            new IoTDBException(
                String.format("Unknown database %s", database),
                TSStatusCode.DATABASE_NOT_EXIST.getStatusCode()));
        unsetDatabaseIfNotExist(useDB.getDatabaseId().getValue(), clientSession);
      }
    } catch (final IOException | 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