Class StaticMetastoreLocator
- java.lang.Object
-
- io.trino.plugin.hive.metastore.thrift.StaticMetastoreLocator
-
- All Implemented Interfaces:
MetastoreLocator
public class StaticMetastoreLocator extends Object implements MetastoreLocator
-
-
Constructor Summary
Constructors Constructor Description StaticMetastoreLocator(StaticMetastoreConfig config, ThriftMetastoreAuthenticationConfig authenticationConfig, ThriftMetastoreClientFactory clientFactory)StaticMetastoreLocator(List<URI> metastoreUris, String metastoreUsername, ThriftMetastoreClientFactory clientFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThriftMetastoreClientcreateMetastoreClient(Optional<String> delegationToken)Create a metastore client connected to the Hive metastore.
-
-
-
Constructor Detail
-
StaticMetastoreLocator
@Inject public StaticMetastoreLocator(StaticMetastoreConfig config, ThriftMetastoreAuthenticationConfig authenticationConfig, ThriftMetastoreClientFactory clientFactory)
-
StaticMetastoreLocator
public StaticMetastoreLocator(List<URI> metastoreUris, @Nullable String metastoreUsername, ThriftMetastoreClientFactory clientFactory)
-
-
Method Detail
-
createMetastoreClient
public ThriftMetastoreClient createMetastoreClient(Optional<String> delegationToken) throws org.apache.thrift.TException
Create a metastore client connected to the Hive metastore.As per Hive HA metastore behavior, return the first metastore in the list list of available metastores (i.e. the default metastore) if a connection can be made, else try another of the metastores at random, until either a connection succeeds or there are no more fallback metastores.
- Specified by:
createMetastoreClientin interfaceMetastoreLocator- Throws:
org.apache.thrift.TException
-
-