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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFailureAwareThriftMetastoreClient.Callback
-
Constructor Summary
Constructors Constructor Description FailureAwareThriftMetastoreClient(ThriftMetastoreClient client, FailureAwareThriftMetastoreClient.Callback callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabortTransaction(long transactionId)org.apache.hadoop.hive.metastore.api.LockResponseacquireLock(org.apache.hadoop.hive.metastore.api.LockRequest lockRequest)voidaddDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, AcidOperation operation)intaddPartitions(List<org.apache.hadoop.hive.metastore.api.Partition> newPartitions)List<org.apache.hadoop.hive.metastore.api.TxnToWriteId>allocateTableWriteIds(String database, String tableName, List<Long> transactionIds)voidalterDatabase(String databaseName, org.apache.hadoop.hive.metastore.api.Database database)voidalterPartition(String databaseName, String tableName, org.apache.hadoop.hive.metastore.api.Partition partition)voidalterPartitions(String dbName, String tableName, List<org.apache.hadoop.hive.metastore.api.Partition> partitions, long writeId)voidalterTableWithEnvironmentContext(String databaseName, String tableName, org.apache.hadoop.hive.metastore.api.Table newTable, org.apache.hadoop.hive.metastore.api.EnvironmentContext context)voidalterTransactionalTable(org.apache.hadoop.hive.metastore.api.Table table, long transactionId, long writeId, org.apache.hadoop.hive.metastore.api.EnvironmentContext context)org.apache.hadoop.hive.metastore.api.LockResponsecheckLock(long lockId)voidclose()voidcommitTransaction(long transactionId)voidcreateDatabase(org.apache.hadoop.hive.metastore.api.Database database)voidcreateRole(String role, String grantor)voidcreateTable(org.apache.hadoop.hive.metastore.api.Table table)voiddeletePartitionColumnStatistics(String databaseName, String tableName, String partitionName, String columnName)voiddeleteTableColumnStatistics(String databaseName, String tableName, String columnName)voiddropDatabase(String databaseName, boolean deleteData, boolean cascade)booleandropPartition(String databaseName, String tableName, List<String> partitionValues, boolean deleteData)voiddropRole(String role)voiddropTable(String databaseName, String name, boolean deleteData)List<String>getAllDatabases()List<String>getAllTables(String databaseName)StringgetConfigValue(String name, String defaultValue)org.apache.hadoop.hive.metastore.api.DatabasegetDatabase(String databaseName)ThriftMetastoreClientgetDelegate()StringgetDelegationToken(String userName)List<org.apache.hadoop.hive.metastore.api.FieldSchema>getFields(String databaseName, String tableName)org.apache.hadoop.hive.metastore.api.PartitiongetPartition(String databaseName, String tableName, List<String> partitionValues)Map<String,List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj>>getPartitionColumnStatistics(String databaseName, String tableName, List<String> partitionNames, List<String> columnNames)List<String>getPartitionNames(String databaseName, String tableName)List<String>getPartitionNamesFiltered(String databaseName, String tableName, List<String> partitionValues)List<org.apache.hadoop.hive.metastore.api.Partition>getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames)List<String>getRoleNames()org.apache.hadoop.hive.metastore.api.TablegetTable(String databaseName, String tableName)List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj>getTableColumnStatistics(String databaseName, String tableName, List<String> columnNames)List<String>getTableNamesByFilter(String databaseName, String filter)List<String>getTableNamesByType(String databaseName, String tableType)org.apache.hadoop.hive.metastore.api.TablegetTableWithCapabilities(String databaseName, String tableName)StringgetValidWriteIds(List<String> tableList, long currentTransactionId)booleangrantPrivileges(org.apache.hadoop.hive.metastore.api.PrivilegeBag privilegeBag)voidgrantRole(String role, String granteeName, org.apache.hadoop.hive.metastore.api.PrincipalType granteeType, String grantorName, org.apache.hadoop.hive.metastore.api.PrincipalType grantorType, boolean grantOption)List<org.apache.hadoop.hive.metastore.api.RolePrincipalGrant>listGrantedPrincipals(String role)List<org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege>listPrivileges(String principalName, org.apache.hadoop.hive.metastore.api.PrincipalType principalType, org.apache.hadoop.hive.metastore.api.HiveObjectRef hiveObjectRef)List<org.apache.hadoop.hive.metastore.api.RolePrincipalGrant>listRoleGrants(String name, org.apache.hadoop.hive.metastore.api.PrincipalType principalType)List<org.apache.hadoop.hive.metastore.api.Role>listRoles(String principalName, org.apache.hadoop.hive.metastore.api.PrincipalType principalType)longopenTransaction(String user)booleanrevokePrivileges(org.apache.hadoop.hive.metastore.api.PrivilegeBag privilegeBag)voidrevokeRole(String role, String granteeName, org.apache.hadoop.hive.metastore.api.PrincipalType granteeType, boolean grantOption)voidsendTransactionHeartbeat(long transactionId)voidsetPartitionColumnStatistics(String databaseName, String tableName, String partitionName, List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> statistics)voidsetTableColumnStatistics(String databaseName, String tableName, List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> statistics)voidsetUGI(String userName)voidupdateTableWriteId(String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange)
-
-
-
Constructor Detail
-
FailureAwareThriftMetastoreClient
public FailureAwareThriftMetastoreClient(ThriftMetastoreClient client, FailureAwareThriftMetastoreClient.Callback callback)
-
-
Method Detail
-
getDelegate
public ThriftMetastoreClient getDelegate()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceThriftMetastoreClient
-
getAllDatabases
public List<String> getAllDatabases() throws org.apache.thrift.TException
- Specified by:
getAllDatabasesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getDatabase
public org.apache.hadoop.hive.metastore.api.Database getDatabase(String databaseName) throws org.apache.thrift.TException
- Specified by:
getDatabasein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getAllTables
public List<String> getAllTables(String databaseName) throws org.apache.thrift.TException
- Specified by:
getAllTablesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getTableNamesByFilter
public List<String> getTableNamesByFilter(String databaseName, String filter) throws org.apache.thrift.TException
- Specified by:
getTableNamesByFilterin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getTableNamesByType
public List<String> getTableNamesByType(String databaseName, String tableType) throws org.apache.thrift.TException
- Specified by:
getTableNamesByTypein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createDatabase
public void createDatabase(org.apache.hadoop.hive.metastore.api.Database database) throws org.apache.thrift.TException- Specified by:
createDatabasein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
dropDatabase
public void dropDatabase(String databaseName, boolean deleteData, boolean cascade) throws org.apache.thrift.TException
- Specified by:
dropDatabasein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
alterDatabase
public void alterDatabase(String databaseName, org.apache.hadoop.hive.metastore.api.Database database) throws org.apache.thrift.TException
- Specified by:
alterDatabasein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createTable
public void createTable(org.apache.hadoop.hive.metastore.api.Table table) throws org.apache.thrift.TException- Specified by:
createTablein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
dropTable
public void dropTable(String databaseName, String name, boolean deleteData) throws org.apache.thrift.TException
- Specified by:
dropTablein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
alterTableWithEnvironmentContext
public void alterTableWithEnvironmentContext(String databaseName, String tableName, org.apache.hadoop.hive.metastore.api.Table newTable, org.apache.hadoop.hive.metastore.api.EnvironmentContext context) throws org.apache.thrift.TException
- Specified by:
alterTableWithEnvironmentContextin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getTable
public org.apache.hadoop.hive.metastore.api.Table getTable(String databaseName, String tableName) throws org.apache.thrift.TException
- Specified by:
getTablein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getTableWithCapabilities
public org.apache.hadoop.hive.metastore.api.Table getTableWithCapabilities(String databaseName, String tableName) throws org.apache.thrift.TException
- Specified by:
getTableWithCapabilitiesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getFields
public List<org.apache.hadoop.hive.metastore.api.FieldSchema> getFields(String databaseName, String tableName) throws org.apache.thrift.TException
- Specified by:
getFieldsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getTableColumnStatistics
public List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> getTableColumnStatistics(String databaseName, String tableName, List<String> columnNames) throws org.apache.thrift.TException
- Specified by:
getTableColumnStatisticsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
setTableColumnStatistics
public void setTableColumnStatistics(String databaseName, String tableName, List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> statistics) throws org.apache.thrift.TException
- Specified by:
setTableColumnStatisticsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
deleteTableColumnStatistics
public void deleteTableColumnStatistics(String databaseName, String tableName, String columnName) throws org.apache.thrift.TException
- Specified by:
deleteTableColumnStatisticsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getPartitionColumnStatistics
public Map<String,List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj>> getPartitionColumnStatistics(String databaseName, String tableName, List<String> partitionNames, List<String> columnNames) throws org.apache.thrift.TException
- Specified by:
getPartitionColumnStatisticsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
setPartitionColumnStatistics
public void setPartitionColumnStatistics(String databaseName, String tableName, String partitionName, List<org.apache.hadoop.hive.metastore.api.ColumnStatisticsObj> statistics) throws org.apache.thrift.TException
- Specified by:
setPartitionColumnStatisticsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
deletePartitionColumnStatistics
public void deletePartitionColumnStatistics(String databaseName, String tableName, String partitionName, String columnName) throws org.apache.thrift.TException
- Specified by:
deletePartitionColumnStatisticsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getPartitionNames
public List<String> getPartitionNames(String databaseName, String tableName) throws org.apache.thrift.TException
- Specified by:
getPartitionNamesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getPartitionNamesFiltered
public List<String> getPartitionNamesFiltered(String databaseName, String tableName, List<String> partitionValues) throws org.apache.thrift.TException
- Specified by:
getPartitionNamesFilteredin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
addPartitions
public int addPartitions(List<org.apache.hadoop.hive.metastore.api.Partition> newPartitions) throws org.apache.thrift.TException
- Specified by:
addPartitionsin interfaceThriftMetastoreClient- 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:
dropPartitionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
alterPartition
public void alterPartition(String databaseName, String tableName, org.apache.hadoop.hive.metastore.api.Partition partition) throws org.apache.thrift.TException
- Specified by:
alterPartitionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getPartition
public org.apache.hadoop.hive.metastore.api.Partition getPartition(String databaseName, String tableName, List<String> partitionValues) throws org.apache.thrift.TException
- Specified by:
getPartitionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getPartitionsByNames
public List<org.apache.hadoop.hive.metastore.api.Partition> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) throws org.apache.thrift.TException
- Specified by:
getPartitionsByNamesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
listRoles
public List<org.apache.hadoop.hive.metastore.api.Role> listRoles(String principalName, org.apache.hadoop.hive.metastore.api.PrincipalType principalType) throws org.apache.thrift.TException
- Specified by:
listRolesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
listPrivileges
public List<org.apache.hadoop.hive.metastore.api.HiveObjectPrivilege> listPrivileges(String principalName, org.apache.hadoop.hive.metastore.api.PrincipalType principalType, org.apache.hadoop.hive.metastore.api.HiveObjectRef hiveObjectRef) throws org.apache.thrift.TException
- Specified by:
listPrivilegesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getRoleNames
public List<String> getRoleNames() throws org.apache.thrift.TException
- Specified by:
getRoleNamesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createRole
public void createRole(String role, String grantor) throws org.apache.thrift.TException
- Specified by:
createRolein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
dropRole
public void dropRole(String role) throws org.apache.thrift.TException
- Specified by:
dropRolein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
grantPrivileges
public boolean grantPrivileges(org.apache.hadoop.hive.metastore.api.PrivilegeBag privilegeBag) throws org.apache.thrift.TException- Specified by:
grantPrivilegesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
revokePrivileges
public boolean revokePrivileges(org.apache.hadoop.hive.metastore.api.PrivilegeBag privilegeBag) throws org.apache.thrift.TException- Specified by:
revokePrivilegesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
grantRole
public void grantRole(String role, String granteeName, org.apache.hadoop.hive.metastore.api.PrincipalType granteeType, String grantorName, org.apache.hadoop.hive.metastore.api.PrincipalType grantorType, boolean grantOption) throws org.apache.thrift.TException
- Specified by:
grantRolein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
revokeRole
public void revokeRole(String role, String granteeName, org.apache.hadoop.hive.metastore.api.PrincipalType granteeType, boolean grantOption) throws org.apache.thrift.TException
- Specified by:
revokeRolein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
listGrantedPrincipals
public List<org.apache.hadoop.hive.metastore.api.RolePrincipalGrant> listGrantedPrincipals(String role) throws org.apache.thrift.TException
- Specified by:
listGrantedPrincipalsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
listRoleGrants
public List<org.apache.hadoop.hive.metastore.api.RolePrincipalGrant> listRoleGrants(String name, org.apache.hadoop.hive.metastore.api.PrincipalType principalType) throws org.apache.thrift.TException
- Specified by:
listRoleGrantsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
setUGI
public void setUGI(String userName) throws org.apache.thrift.TException
- Specified by:
setUGIin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
openTransaction
public long openTransaction(String user) throws org.apache.thrift.TException
- Specified by:
openTransactionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
commitTransaction
public void commitTransaction(long transactionId) throws org.apache.thrift.TException- Specified by:
commitTransactionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
sendTransactionHeartbeat
public void sendTransactionHeartbeat(long transactionId) throws org.apache.thrift.TException- Specified by:
sendTransactionHeartbeatin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
acquireLock
public org.apache.hadoop.hive.metastore.api.LockResponse acquireLock(org.apache.hadoop.hive.metastore.api.LockRequest lockRequest) throws org.apache.thrift.TException- Specified by:
acquireLockin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
checkLock
public org.apache.hadoop.hive.metastore.api.LockResponse checkLock(long lockId) throws org.apache.thrift.TException- Specified by:
checkLockin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getValidWriteIds
public String getValidWriteIds(List<String> tableList, long currentTransactionId) throws org.apache.thrift.TException
- Specified by:
getValidWriteIdsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getConfigValue
public String getConfigValue(String name, String defaultValue) throws org.apache.thrift.TException
- Specified by:
getConfigValuein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getDelegationToken
public String getDelegationToken(String userName) throws org.apache.thrift.TException
- Specified by:
getDelegationTokenin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
abortTransaction
public void abortTransaction(long transactionId) throws org.apache.thrift.TException- Specified by:
abortTransactionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
allocateTableWriteIds
public List<org.apache.hadoop.hive.metastore.api.TxnToWriteId> allocateTableWriteIds(String database, String tableName, List<Long> transactionIds) throws org.apache.thrift.TException
- Specified by:
allocateTableWriteIdsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
updateTableWriteId
public void updateTableWriteId(String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange) throws org.apache.thrift.TException
- Specified by:
updateTableWriteIdin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
alterPartitions
public void alterPartitions(String dbName, String tableName, List<org.apache.hadoop.hive.metastore.api.Partition> partitions, long writeId) throws org.apache.thrift.TException
- Specified by:
alterPartitionsin interfaceThriftMetastoreClient- 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:
addDynamicPartitionsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
alterTransactionalTable
public void alterTransactionalTable(org.apache.hadoop.hive.metastore.api.Table table, long transactionId, long writeId, org.apache.hadoop.hive.metastore.api.EnvironmentContext context) throws org.apache.thrift.TException- Specified by:
alterTransactionalTablein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
-