Class FailureAwareThriftMetastoreClient
java.lang.Object
io.trino.plugin.hive.metastore.thrift.FailureAwareThriftMetastoreClient
- All Implemented Interfaces:
ThriftMetastoreClient,Closeable,AutoCloseable
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionFailureAwareThriftMetastoreClient(ThriftMetastoreClient client, FailureAwareThriftMetastoreClient.Callback callback) -
Method Summary
Modifier and TypeMethodDescriptionvoidabortTransaction(long transactionId) io.trino.hive.thrift.metastore.LockResponseacquireLock(io.trino.hive.thrift.metastore.LockRequest lockRequest) voidaddDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, io.trino.hive.thrift.metastore.DataOperationType operation) intaddPartitions(List<io.trino.hive.thrift.metastore.Partition> newPartitions) List<io.trino.hive.thrift.metastore.TxnToWriteId> allocateTableWriteIds(String database, String tableName, List<Long> transactionIds) voidalterDatabase(String databaseName, io.trino.hive.thrift.metastore.Database database) voidalterFunction(io.trino.hive.thrift.metastore.Function function) voidalterPartition(String databaseName, String tableName, io.trino.hive.thrift.metastore.Partition partition) voidalterPartitions(String dbName, String tableName, List<io.trino.hive.thrift.metastore.Partition> partitions, long writeId) voidalterTableWithEnvironmentContext(String databaseName, String tableName, io.trino.hive.thrift.metastore.Table newTable, io.trino.hive.thrift.metastore.EnvironmentContext context) voidalterTransactionalTable(io.trino.hive.thrift.metastore.Table table, long transactionId, long writeId, io.trino.hive.thrift.metastore.EnvironmentContext context) io.trino.hive.thrift.metastore.LockResponsecheckLock(long lockId) voidclose()voidcommitTransaction(long transactionId) voidcreateDatabase(io.trino.hive.thrift.metastore.Database database) voidcreateFunction(io.trino.hive.thrift.metastore.Function function) voidcreateRole(String role, String grantor) voidcreateTable(io.trino.hive.thrift.metastore.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) voiddropFunction(String databaseName, String functionName) booleandropPartition(String databaseName, String tableName, List<String> partitionValues, boolean deleteData) voidvoidgetConfigValue(String name, String defaultValue) io.trino.hive.thrift.metastore.DatabasegetDatabase(String databaseName) getDelegationToken(String userName) List<io.trino.hive.thrift.metastore.FieldSchema> io.trino.hive.thrift.metastore.FunctiongetFunction(String databaseName, String functionName) getFunctions(String databaseName, String functionNamePattern) io.trino.hive.thrift.metastore.PartitiongetPartition(String databaseName, String tableName, List<String> partitionValues) getPartitionColumnStatistics(String databaseName, String tableName, List<String> partitionNames, List<String> columnNames) getPartitionNames(String databaseName, String tableName) getPartitionNamesFiltered(String databaseName, String tableName, List<String> partitionValues) List<io.trino.hive.thrift.metastore.Partition> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) io.trino.hive.thrift.metastore.TableList<io.trino.hive.thrift.metastore.ColumnStatisticsObj> getTableColumnStatistics(String databaseName, String tableName, List<String> columnNames) List<io.trino.hive.thrift.metastore.TableMeta> getTableMeta(String databaseName) getValidWriteIds(List<String> tableList, long currentTransactionId) booleangrantPrivileges(io.trino.hive.thrift.metastore.PrivilegeBag privilegeBag) voidgrantRole(String role, String granteeName, io.trino.hive.thrift.metastore.PrincipalType granteeType, String grantorName, io.trino.hive.thrift.metastore.PrincipalType grantorType, boolean grantOption) List<io.trino.hive.thrift.metastore.HiveObjectPrivilege> listPrivileges(String principalName, io.trino.hive.thrift.metastore.PrincipalType principalType, io.trino.hive.thrift.metastore.HiveObjectRef hiveObjectRef) List<io.trino.hive.thrift.metastore.RolePrincipalGrant> listRoleGrants(String name, io.trino.hive.thrift.metastore.PrincipalType principalType) List<io.trino.hive.thrift.metastore.Role> longopenTransaction(String user) booleanrevokePrivileges(io.trino.hive.thrift.metastore.PrivilegeBag privilegeBag, boolean grantOption) voidrevokeRole(String role, String granteeName, io.trino.hive.thrift.metastore.PrincipalType granteeType, boolean grantOption) voidsendTransactionHeartbeat(long transactionId) voidsetPartitionColumnStatistics(String databaseName, String tableName, String partitionName, List<io.trino.hive.thrift.metastore.ColumnStatisticsObj> statistics) voidsetTableColumnStatistics(String databaseName, String tableName, List<io.trino.hive.thrift.metastore.ColumnStatisticsObj> statistics) voidvoidunlock(long lockId)
-
Constructor Details
-
FailureAwareThriftMetastoreClient
public FailureAwareThriftMetastoreClient(ThriftMetastoreClient client, FailureAwareThriftMetastoreClient.Callback callback)
-
-
Method Details
-
getDelegate
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceThriftMetastoreClient
-
getAllDatabases
- Specified by:
getAllDatabasesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getDatabase
public io.trino.hive.thrift.metastore.Database getDatabase(String databaseName) throws org.apache.thrift.TException - Specified by:
getDatabasein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getTableMeta
public List<io.trino.hive.thrift.metastore.TableMeta> getTableMeta(String databaseName) throws org.apache.thrift.TException - Specified by:
getTableMetain interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createDatabase
public void createDatabase(io.trino.hive.thrift.metastore.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, io.trino.hive.thrift.metastore.Database database) throws org.apache.thrift.TException - Specified by:
alterDatabasein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createTable
public void createTable(io.trino.hive.thrift.metastore.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, io.trino.hive.thrift.metastore.Table newTable, io.trino.hive.thrift.metastore.EnvironmentContext context) throws org.apache.thrift.TException - Specified by:
alterTableWithEnvironmentContextin interfaceThriftMetastoreClient- 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:
getTablein interfaceThriftMetastoreClient- 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:
getFieldsin interfaceThriftMetastoreClient- 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:
getTableColumnStatisticsin interfaceThriftMetastoreClient- 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:
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<io.trino.hive.thrift.metastore.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<io.trino.hive.thrift.metastore.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<io.trino.hive.thrift.metastore.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, io.trino.hive.thrift.metastore.Partition partition) throws org.apache.thrift.TException - Specified by:
alterPartitionin interfaceThriftMetastoreClient- 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:
getPartitionin interfaceThriftMetastoreClient- 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:
getPartitionsByNamesin interfaceThriftMetastoreClient- 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:
listRolesin interfaceThriftMetastoreClient- 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:
listPrivilegesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getRoleNames
- Specified by:
getRoleNamesin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createRole
- Specified by:
createRolein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
dropRole
- Specified by:
dropRolein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
grantPrivileges
public boolean grantPrivileges(io.trino.hive.thrift.metastore.PrivilegeBag privilegeBag) throws org.apache.thrift.TException - Specified by:
grantPrivilegesin interfaceThriftMetastoreClient- 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:
revokePrivilegesin interfaceThriftMetastoreClient- 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:
grantRolein interfaceThriftMetastoreClient- 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:
revokeRolein interfaceThriftMetastoreClient- 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:
listRoleGrantsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
setUGI
- Specified by:
setUGIin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
openTransaction
- 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 io.trino.hive.thrift.metastore.LockResponse acquireLock(io.trino.hive.thrift.metastore.LockRequest lockRequest) throws org.apache.thrift.TException - Specified by:
acquireLockin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
checkLock
public io.trino.hive.thrift.metastore.LockResponse checkLock(long lockId) throws org.apache.thrift.TException - Specified by:
checkLockin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
unlock
public void unlock(long lockId) throws org.apache.thrift.TException - Specified by:
unlockin 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
- Specified by:
getConfigValuein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getDelegationToken
- 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<io.trino.hive.thrift.metastore.TxnToWriteId> allocateTableWriteIds(String database, String tableName, List<Long> transactionIds) throws org.apache.thrift.TException - Specified by:
allocateTableWriteIdsin interfaceThriftMetastoreClient- 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:
alterPartitionsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
addDynamicPartitions
public void addDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, io.trino.hive.thrift.metastore.DataOperationType operation) throws org.apache.thrift.TException - Specified by:
addDynamicPartitionsin interfaceThriftMetastoreClient- 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:
alterTransactionalTablein interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getFunction
public io.trino.hive.thrift.metastore.Function getFunction(String databaseName, String functionName) throws org.apache.thrift.TException - Specified by:
getFunctionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
getFunctions
public Collection<String> getFunctions(String databaseName, String functionNamePattern) throws org.apache.thrift.TException - Specified by:
getFunctionsin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
createFunction
public void createFunction(io.trino.hive.thrift.metastore.Function function) throws org.apache.thrift.TException - Specified by:
createFunctionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
alterFunction
public void alterFunction(io.trino.hive.thrift.metastore.Function function) throws org.apache.thrift.TException - Specified by:
alterFunctionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-
dropFunction
public void dropFunction(String databaseName, String functionName) throws org.apache.thrift.TException - Specified by:
dropFunctionin interfaceThriftMetastoreClient- Throws:
org.apache.thrift.TException
-