Class CachedClientPool

java.lang.Object
org.apache.iceberg.hive.CachedClientPool
All Implemented Interfaces:
ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException>

public class CachedClientPool extends Object implements ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException>
A ClientPool that caches the underlying HiveClientPool instances.

The following key elements are supported and can be specified via CatalogProperties.CLIENT_POOL_CACHE_KEYS:

  • ugi - the Hadoop UserGroupInformation instance that represents the current user using the cache.
  • user_name - similar to UGI but only includes the user's name determined by UserGroupInformation#getUserName.
  • conf - name of an arbitrary configuration. The value of the configuration will be extracted from catalog properties and added to the cache key. A conf element should start with a "conf:" prefix which is followed by the configuration name. E.g. specifying "conf:a.b.c" will add "a.b.c" to the key, and so that configurations with different default catalog wouldn't share the same client pool. Multiple conf elements can be specified.
  • Method Details

    • run

      public <R> R run(ClientPool.Action<R,org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException> action) throws org.apache.thrift.TException, InterruptedException
      Specified by:
      run in interface ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException>
      Throws:
      org.apache.thrift.TException
      InterruptedException
    • run

      public <R> R run(ClientPool.Action<R,org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException> action, boolean retry) throws org.apache.thrift.TException, InterruptedException
      Specified by:
      run in interface ClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,org.apache.thrift.TException>
      Throws:
      org.apache.thrift.TException
      InterruptedException