@SuppressWarnings("unchecked")
  private static ThriftClientPool<AmoroTableMetastore.Client> buildClientPool(String url) {
    PoolConfig<AmoroTableMetastore.Client> poolConfig =
        (PoolConfig<AmoroTableMetastore.Client>) PoolConfig.forUrl(url);
    return new ThriftClientPool<>(
        url,
        s -> {
          TProtocol protocol = new TBinaryProtocol(s);
          return new AmoroTableMetastore.Client(
              new TMultiplexedProtocol(protocol, Constants.THRIFT_TABLE_SERVICE_NAME));
        },
        c -> {
          try {
            ((AmoroTableMetastore.Client) c).ping();
          } catch (TException e) {
            return false;
          }
          return true;
        },
        poolConfig,
        Constants.THRIFT_TABLE_SERVICE_NAME);
  }
Client pool cache for different ams server, sharing in jvm.
amoro-common/src/main/java/org/apache/amoro/client/AmsClientPools.java