Class FailureAwareThriftMetastoreClient

java.lang.Object
io.trino.plugin.hive.metastore.thrift.FailureAwareThriftMetastoreClient
All Implemented Interfaces:
ThriftMetastoreClient, Closeable, AutoCloseable

public class FailureAwareThriftMetastoreClient extends Object implements ThriftMetastoreClient
  • Constructor Details

  • Method Details

    • getDelegate

      public ThriftMetastoreClient getDelegate()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface ThriftMetastoreClient
    • getAllDatabases

      public List<String> getAllDatabases() throws org.apache.thrift.TException
      Specified by:
      getAllDatabases in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getDatabase

      public io.trino.hive.thrift.metastore.Database getDatabase(String databaseName) throws org.apache.thrift.TException
      Specified by:
      getDatabase in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getAllTables

      public List<String> getAllTables(String databaseName) throws org.apache.thrift.TException
      Specified by:
      getAllTables in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getAllTables

      public Optional<List<SchemaTableName>> getAllTables() throws org.apache.thrift.TException
      Specified by:
      getAllTables in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getAllViews

      public List<String> getAllViews(String databaseName) throws org.apache.thrift.TException
      Specified by:
      getAllViews in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getAllViews

      public Optional<List<SchemaTableName>> getAllViews() throws org.apache.thrift.TException
      Specified by:
      getAllViews in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getTablesWithParameter

      public List<String> getTablesWithParameter(String databaseName, String parameterKey, String parameterValue) throws org.apache.thrift.TException
      Specified by:
      getTablesWithParameter in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • createDatabase

      public void createDatabase(io.trino.hive.thrift.metastore.Database database) throws org.apache.thrift.TException
      Specified by:
      createDatabase in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • dropDatabase

      public void dropDatabase(String databaseName, boolean deleteData, boolean cascade) throws org.apache.thrift.TException
      Specified by:
      dropDatabase in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • alterDatabase

      public void alterDatabase(String databaseName, io.trino.hive.thrift.metastore.Database database) throws org.apache.thrift.TException
      Specified by:
      alterDatabase in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • createTable

      public void createTable(io.trino.hive.thrift.metastore.Table table) throws org.apache.thrift.TException
      Specified by:
      createTable in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • dropTable

      public void dropTable(String databaseName, String name, boolean deleteData) throws org.apache.thrift.TException
      Specified by:
      dropTable in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • alterTableWithEnvironmentContext

      public void alterTableWithEnvironmentContext(String databaseName, String tableName, io.trino.hive.thrift.metastore.Table newTable, io.trino.hive.thrift.metastore.EnvironmentContext context) throws org.apache.thrift.TException
      Specified by:
      alterTableWithEnvironmentContext in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getTable

      public io.trino.hive.thrift.metastore.Table getTable(String databaseName, String tableName) throws org.apache.thrift.TException
      Specified by:
      getTable in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getFields

      public List<io.trino.hive.thrift.metastore.FieldSchema> getFields(String databaseName, String tableName) throws org.apache.thrift.TException
      Specified by:
      getFields in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getTableColumnStatistics

      public List<io.trino.hive.thrift.metastore.ColumnStatisticsObj> getTableColumnStatistics(String databaseName, String tableName, List<String> columnNames) throws org.apache.thrift.TException
      Specified by:
      getTableColumnStatistics in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • setTableColumnStatistics

      public void setTableColumnStatistics(String databaseName, String tableName, List<io.trino.hive.thrift.metastore.ColumnStatisticsObj> statistics) throws org.apache.thrift.TException
      Specified by:
      setTableColumnStatistics in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • deleteTableColumnStatistics

      public void deleteTableColumnStatistics(String databaseName, String tableName, String columnName) throws org.apache.thrift.TException
      Specified by:
      deleteTableColumnStatistics in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getPartitionColumnStatistics

      public Map<String,List<io.trino.hive.thrift.metastore.ColumnStatisticsObj>> getPartitionColumnStatistics(String databaseName, String tableName, List<String> partitionNames, List<String> columnNames) throws org.apache.thrift.TException
      Specified by:
      getPartitionColumnStatistics in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • setPartitionColumnStatistics

      public void setPartitionColumnStatistics(String databaseName, String tableName, String partitionName, List<io.trino.hive.thrift.metastore.ColumnStatisticsObj> statistics) throws org.apache.thrift.TException
      Specified by:
      setPartitionColumnStatistics in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • deletePartitionColumnStatistics

      public void deletePartitionColumnStatistics(String databaseName, String tableName, String partitionName, String columnName) throws org.apache.thrift.TException
      Specified by:
      deletePartitionColumnStatistics in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getPartitionNames

      public List<String> getPartitionNames(String databaseName, String tableName) throws org.apache.thrift.TException
      Specified by:
      getPartitionNames in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getPartitionNamesFiltered

      public List<String> getPartitionNamesFiltered(String databaseName, String tableName, List<String> partitionValues) throws org.apache.thrift.TException
      Specified by:
      getPartitionNamesFiltered in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • addPartitions

      public int addPartitions(List<io.trino.hive.thrift.metastore.Partition> newPartitions) throws org.apache.thrift.TException
      Specified by:
      addPartitions in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • dropPartition

      public boolean dropPartition(String databaseName, String tableName, List<String> partitionValues, boolean deleteData) throws org.apache.thrift.TException
      Specified by:
      dropPartition in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • alterPartition

      public void alterPartition(String databaseName, String tableName, io.trino.hive.thrift.metastore.Partition partition) throws org.apache.thrift.TException
      Specified by:
      alterPartition in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getPartition

      public io.trino.hive.thrift.metastore.Partition getPartition(String databaseName, String tableName, List<String> partitionValues) throws org.apache.thrift.TException
      Specified by:
      getPartition in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getPartitionsByNames

      public List<io.trino.hive.thrift.metastore.Partition> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) throws org.apache.thrift.TException
      Specified by:
      getPartitionsByNames in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • listRoles

      public List<io.trino.hive.thrift.metastore.Role> listRoles(String principalName, io.trino.hive.thrift.metastore.PrincipalType principalType) throws org.apache.thrift.TException
      Specified by:
      listRoles in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • listPrivileges

      public List<io.trino.hive.thrift.metastore.HiveObjectPrivilege> listPrivileges(String principalName, io.trino.hive.thrift.metastore.PrincipalType principalType, io.trino.hive.thrift.metastore.HiveObjectRef hiveObjectRef) throws org.apache.thrift.TException
      Specified by:
      listPrivileges in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getRoleNames

      public List<String> getRoleNames() throws org.apache.thrift.TException
      Specified by:
      getRoleNames in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • createRole

      public void createRole(String role, String grantor) throws org.apache.thrift.TException
      Specified by:
      createRole in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • dropRole

      public void dropRole(String role) throws org.apache.thrift.TException
      Specified by:
      dropRole in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • grantPrivileges

      public boolean grantPrivileges(io.trino.hive.thrift.metastore.PrivilegeBag privilegeBag) throws org.apache.thrift.TException
      Specified by:
      grantPrivileges in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • revokePrivileges

      public boolean revokePrivileges(io.trino.hive.thrift.metastore.PrivilegeBag privilegeBag, boolean grantOption) throws org.apache.thrift.TException
      Specified by:
      revokePrivileges in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • grantRole

      public void grantRole(String role, String granteeName, io.trino.hive.thrift.metastore.PrincipalType granteeType, String grantorName, io.trino.hive.thrift.metastore.PrincipalType grantorType, boolean grantOption) throws org.apache.thrift.TException
      Specified by:
      grantRole in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • revokeRole

      public void revokeRole(String role, String granteeName, io.trino.hive.thrift.metastore.PrincipalType granteeType, boolean grantOption) throws org.apache.thrift.TException
      Specified by:
      revokeRole in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • listGrantedPrincipals

      public List<io.trino.hive.thrift.metastore.RolePrincipalGrant> listGrantedPrincipals(String role) throws org.apache.thrift.TException
      Specified by:
      listGrantedPrincipals in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • listRoleGrants

      public List<io.trino.hive.thrift.metastore.RolePrincipalGrant> listRoleGrants(String name, io.trino.hive.thrift.metastore.PrincipalType principalType) throws org.apache.thrift.TException
      Specified by:
      listRoleGrants in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • setUGI

      public void setUGI(String userName) throws org.apache.thrift.TException
      Specified by:
      setUGI in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • openTransaction

      public long openTransaction(String user) throws org.apache.thrift.TException
      Specified by:
      openTransaction in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • commitTransaction

      public void commitTransaction(long transactionId) throws org.apache.thrift.TException
      Specified by:
      commitTransaction in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • sendTransactionHeartbeat

      public void sendTransactionHeartbeat(long transactionId) throws org.apache.thrift.TException
      Specified by:
      sendTransactionHeartbeat in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • acquireLock

      public io.trino.hive.thrift.metastore.LockResponse acquireLock(io.trino.hive.thrift.metastore.LockRequest lockRequest) throws org.apache.thrift.TException
      Specified by:
      acquireLock in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • checkLock

      public io.trino.hive.thrift.metastore.LockResponse checkLock(long lockId) throws org.apache.thrift.TException
      Specified by:
      checkLock in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • unlock

      public void unlock(long lockId) throws org.apache.thrift.TException
      Specified by:
      unlock in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getValidWriteIds

      public String getValidWriteIds(List<String> tableList, long currentTransactionId) throws org.apache.thrift.TException
      Specified by:
      getValidWriteIds in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getConfigValue

      public String getConfigValue(String name, String defaultValue) throws org.apache.thrift.TException
      Specified by:
      getConfigValue in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • getDelegationToken

      public String getDelegationToken(String userName) throws org.apache.thrift.TException
      Specified by:
      getDelegationToken in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • abortTransaction

      public void abortTransaction(long transactionId) throws org.apache.thrift.TException
      Specified by:
      abortTransaction in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • allocateTableWriteIds

      public List<io.trino.hive.thrift.metastore.TxnToWriteId> allocateTableWriteIds(String database, String tableName, List<Long> transactionIds) throws org.apache.thrift.TException
      Specified by:
      allocateTableWriteIds in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • alterPartitions

      public void alterPartitions(String dbName, String tableName, List<io.trino.hive.thrift.metastore.Partition> partitions, long writeId) throws org.apache.thrift.TException
      Specified by:
      alterPartitions in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • addDynamicPartitions

      public void addDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, AcidOperation operation) throws org.apache.thrift.TException
      Specified by:
      addDynamicPartitions in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException
    • alterTransactionalTable

      public void alterTransactionalTable(io.trino.hive.thrift.metastore.Table table, long transactionId, long writeId, io.trino.hive.thrift.metastore.EnvironmentContext context) throws org.apache.thrift.TException
      Specified by:
      alterTransactionalTable in interface ThriftMetastoreClient
      Throws:
      org.apache.thrift.TException