Package org.apache.iceberg.hive
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.iceberg.ClientPool
ClientPool.Action<R,
C, E extends Exception> -
Method Summary
Modifier and TypeMethodDescription<R> R
run
(ClientPool.Action<R, org.apache.hadoop.hive.metastore.IMetaStoreClient, org.apache.thrift.TException> action) <R> R
run
(ClientPool.Action<R, org.apache.hadoop.hive.metastore.IMetaStoreClient, org.apache.thrift.TException> action, boolean retry)
-
Method Details
-
run
public <R> R run(ClientPool.Action<R, org.apache.hadoop.hive.metastore.IMetaStoreClient, throws org.apache.thrift.TException, InterruptedExceptionorg.apache.thrift.TException> action) - Specified by:
run
in interfaceClientPool<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, throws org.apache.thrift.TException, InterruptedExceptionorg.apache.thrift.TException> action, boolean retry) - Specified by:
run
in interfaceClientPool<org.apache.hadoop.hive.metastore.IMetaStoreClient,
org.apache.thrift.TException> - Throws:
org.apache.thrift.TException
InterruptedException
-