Class ThriftHiveMetastore
java.lang.Object
io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore
- All Implemented Interfaces:
ThriftMetastore
-
Constructor Summary
ConstructorsConstructorDescriptionThriftHiveMetastore(Optional<ConnectorIdentity> identity, TrinoFileSystemFactory fileSystemFactory, IdentityAwareMetastoreClientFactory metastoreClientFactory, double backoffScaleFactor, io.airlift.units.Duration minBackoffDelay, io.airlift.units.Duration maxBackoffDelay, io.airlift.units.Duration maxRetryTime, io.airlift.units.Duration maxWaitForLock, int maxRetries, boolean deleteFilesOnDrop, boolean translateHiveViews, boolean assumeCanonicalPartitionKeys, boolean useSparkTableStatisticsFallback, boolean batchMetadataFetchEnabled, ThriftMetastoreStats stats, ExecutorService writeStatisticsExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidabortTransaction(long transactionId) voidacquireSharedReadLock(AcidTransactionOwner transactionOwner, String queryId, long transactionId, List<SchemaTableName> fullTables, List<HivePartition> partitions) longacquireTableExclusiveLock(AcidTransactionOwner transactionOwner, String queryId, String dbName, String tableName) voidacquireTableWriteLock(AcidTransactionOwner transactionOwner, String queryId, long transactionId, String dbName, String tableName, io.trino.hive.thrift.metastore.DataOperationType operation, boolean isDynamicPartitionWrite) voidaddDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, AcidOperation operation) voidaddPartitions(String databaseName, String tableName, List<PartitionWithStatistics> partitionsWithStatistics) longallocateWriteId(String dbName, String tableName, long transactionId) voidalterDatabase(String databaseName, io.trino.hive.thrift.metastore.Database database) voidalterPartition(String databaseName, String tableName, PartitionWithStatistics partitionWithStatistics) voidalterPartitions(String dbName, String tableName, List<io.trino.hive.thrift.metastore.Partition> partitions, long writeId) voidalterTable(String databaseName, String tableName, io.trino.hive.thrift.metastore.Table table) voidalterTransactionalTable(io.trino.hive.thrift.metastore.Table table, long transactionId, long writeId) voidvoidcommitTransaction(long transactionId) voidcreateDatabase(io.trino.hive.thrift.metastore.Database database) voidcreateRole(String role, String grantor) voidcreateTable(io.trino.hive.thrift.metastore.Table table) voiddropDatabase(String databaseName, boolean deleteData) voiddropPartition(String databaseName, String tableName, List<String> parts, boolean deleteData) voidvoidgetAllTables(String databaseName) getAllViews(String databaseName) getConfigValue(String name) Optional<io.trino.hive.thrift.metastore.Database>getDatabase(String databaseName) Optional<io.trino.hive.thrift.metastore.Partition>getPartition(String databaseName, String tableName, List<String> partitionValues) getPartitionNamesByFilter(String databaseName, String tableName, List<String> columnNames, TupleDomain<String> partitionKeysFilter) List<io.trino.hive.thrift.metastore.Partition>getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) getPartitionStatistics(io.trino.hive.thrift.metastore.Table table, List<io.trino.hive.thrift.metastore.Partition> partitions) getStats()Optional<io.trino.hive.thrift.metastore.Table>getTableStatistics(io.trino.hive.thrift.metastore.Table table) getTablesWithParameter(String databaseName, String parameterKey, String parameterValue) getValidWriteIds(List<SchemaTableName> tables, long currentTransactionId) voidgrantRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor) voidgrantTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, HivePrincipal grantor, Set<HivePrivilegeInfo.HivePrivilege> privileges, boolean grantOption) listGrantedPrincipals(String role) listRoleGrants(HivePrincipal principal) listTablePrivileges(String databaseName, String tableName, Optional<String> tableOwner, Optional<HivePrincipal> principal) longopenTransaction(AcidTransactionOwner transactionOwner) voidreleaseTableLock(long lockId) voidrevokeRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor) voidrevokeTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, HivePrincipal grantor, Set<HivePrivilegeInfo.HivePrivilege> privileges, boolean grantOption) voidsendTransactionHeartbeat(long transactionId) voidupdatePartitionStatistics(io.trino.hive.thrift.metastore.Table table, String partitionName, Function<PartitionStatistics, PartitionStatistics> update) voidupdateTableStatistics(String databaseName, String tableName, AcidTransaction transaction, Function<PartitionStatistics, PartitionStatistics> update) voidupdateTableWriteId(String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange)
-
Constructor Details
-
ThriftHiveMetastore
public ThriftHiveMetastore(Optional<ConnectorIdentity> identity, TrinoFileSystemFactory fileSystemFactory, IdentityAwareMetastoreClientFactory metastoreClientFactory, double backoffScaleFactor, io.airlift.units.Duration minBackoffDelay, io.airlift.units.Duration maxBackoffDelay, io.airlift.units.Duration maxRetryTime, io.airlift.units.Duration maxWaitForLock, int maxRetries, boolean deleteFilesOnDrop, boolean translateHiveViews, boolean assumeCanonicalPartitionKeys, boolean useSparkTableStatisticsFallback, boolean batchMetadataFetchEnabled, ThriftMetastoreStats stats, ExecutorService writeStatisticsExecutor)
-
-
Method Details
-
getStats
-
getAllDatabases
- Specified by:
getAllDatabasesin interfaceThriftMetastore
-
getDatabase
- Specified by:
getDatabasein interfaceThriftMetastore
-
getAllTables
- Specified by:
getAllTablesin interfaceThriftMetastore
-
getTablesWithParameter
public List<String> getTablesWithParameter(String databaseName, String parameterKey, String parameterValue) - Specified by:
getTablesWithParameterin interfaceThriftMetastore
-
getTable
public Optional<io.trino.hive.thrift.metastore.Table> getTable(String databaseName, String tableName) - Specified by:
getTablein interfaceThriftMetastore
-
getSupportedColumnStatistics
- Specified by:
getSupportedColumnStatisticsin interfaceThriftMetastore
-
getTableStatistics
- Specified by:
getTableStatisticsin interfaceThriftMetastore
-
getPartitionStatistics
public Map<String,PartitionStatistics> getPartitionStatistics(io.trino.hive.thrift.metastore.Table table, List<io.trino.hive.thrift.metastore.Partition> partitions) - Specified by:
getPartitionStatisticsin interfaceThriftMetastore
-
getFields
public Optional<List<io.trino.hive.thrift.metastore.FieldSchema>> getFields(String databaseName, String tableName) - Specified by:
getFieldsin interfaceThriftMetastore
-
updateTableStatistics
public void updateTableStatistics(String databaseName, String tableName, AcidTransaction transaction, Function<PartitionStatistics, PartitionStatistics> update) - Specified by:
updateTableStatisticsin interfaceThriftMetastore
-
updatePartitionStatistics
public void updatePartitionStatistics(io.trino.hive.thrift.metastore.Table table, String partitionName, Function<PartitionStatistics, PartitionStatistics> update) - Specified by:
updatePartitionStatisticsin interfaceThriftMetastore
-
createRole
- Specified by:
createRolein interfaceThriftMetastore
-
dropRole
- Specified by:
dropRolein interfaceThriftMetastore
-
listRoles
- Specified by:
listRolesin interfaceThriftMetastore
-
grantRoles
public void grantRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor) - Specified by:
grantRolesin interfaceThriftMetastore
-
revokeRoles
public void revokeRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor) - Specified by:
revokeRolesin interfaceThriftMetastore
-
listGrantedPrincipals
- Specified by:
listGrantedPrincipalsin interfaceThriftMetastore
-
listRoleGrants
- Specified by:
listRoleGrantsin interfaceThriftMetastore
-
getAllViews
- Specified by:
getAllViewsin interfaceThriftMetastore
-
getAllTables
- Specified by:
getAllTablesin interfaceThriftMetastore
-
getAllViews
- Specified by:
getAllViewsin interfaceThriftMetastore
-
createDatabase
public void createDatabase(io.trino.hive.thrift.metastore.Database database) - Specified by:
createDatabasein interfaceThriftMetastore
-
dropDatabase
- Specified by:
dropDatabasein interfaceThriftMetastore
-
alterDatabase
- Specified by:
alterDatabasein interfaceThriftMetastore
-
createTable
public void createTable(io.trino.hive.thrift.metastore.Table table) - Specified by:
createTablein interfaceThriftMetastore
-
dropTable
- Specified by:
dropTablein interfaceThriftMetastore
-
alterTable
public void alterTable(String databaseName, String tableName, io.trino.hive.thrift.metastore.Table table) - Specified by:
alterTablein interfaceThriftMetastore
-
alterTransactionalTable
public void alterTransactionalTable(io.trino.hive.thrift.metastore.Table table, long transactionId, long writeId) - Specified by:
alterTransactionalTablein interfaceThriftMetastore
-
getPartitionNamesByFilter
public Optional<List<String>> getPartitionNamesByFilter(String databaseName, String tableName, List<String> columnNames, TupleDomain<String> partitionKeysFilter) - Specified by:
getPartitionNamesByFilterin interfaceThriftMetastore
-
addPartitions
public void addPartitions(String databaseName, String tableName, List<PartitionWithStatistics> partitionsWithStatistics) - Specified by:
addPartitionsin interfaceThriftMetastore
-
dropPartition
public void dropPartition(String databaseName, String tableName, List<String> parts, boolean deleteData) - Specified by:
dropPartitionin interfaceThriftMetastore
-
alterPartition
public void alterPartition(String databaseName, String tableName, PartitionWithStatistics partitionWithStatistics) - Specified by:
alterPartitionin interfaceThriftMetastore
-
getPartition
public Optional<io.trino.hive.thrift.metastore.Partition> getPartition(String databaseName, String tableName, List<String> partitionValues) - Specified by:
getPartitionin interfaceThriftMetastore
-
getPartitionsByNames
public List<io.trino.hive.thrift.metastore.Partition> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) - Specified by:
getPartitionsByNamesin interfaceThriftMetastore
-
grantTablePrivileges
public void grantTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, HivePrincipal grantor, Set<HivePrivilegeInfo.HivePrivilege> privileges, boolean grantOption) - Specified by:
grantTablePrivilegesin interfaceThriftMetastore
-
revokeTablePrivileges
public void revokeTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, HivePrincipal grantor, Set<HivePrivilegeInfo.HivePrivilege> privileges, boolean grantOption) - Specified by:
revokeTablePrivilegesin interfaceThriftMetastore
-
listTablePrivileges
public Set<HivePrivilegeInfo> listTablePrivileges(String databaseName, String tableName, Optional<String> tableOwner, Optional<HivePrincipal> principal) - Specified by:
listTablePrivilegesin interfaceThriftMetastoreprincipal- when empty, all table privileges are returned
-
checkSupportsTransactions
public void checkSupportsTransactions()- Specified by:
checkSupportsTransactionsin interfaceThriftMetastore
-
openTransaction
- Specified by:
openTransactionin interfaceThriftMetastore
-
commitTransaction
public void commitTransaction(long transactionId) - Specified by:
commitTransactionin interfaceThriftMetastore
-
abortTransaction
public void abortTransaction(long transactionId) - Specified by:
abortTransactionin interfaceThriftMetastore
-
sendTransactionHeartbeat
public void sendTransactionHeartbeat(long transactionId) - Specified by:
sendTransactionHeartbeatin interfaceThriftMetastore
-
acquireTableWriteLock
public void acquireTableWriteLock(AcidTransactionOwner transactionOwner, String queryId, long transactionId, String dbName, String tableName, io.trino.hive.thrift.metastore.DataOperationType operation, boolean isDynamicPartitionWrite) - Specified by:
acquireTableWriteLockin interfaceThriftMetastore
-
acquireTableExclusiveLock
public long acquireTableExclusiveLock(AcidTransactionOwner transactionOwner, String queryId, String dbName, String tableName) - Specified by:
acquireTableExclusiveLockin interfaceThriftMetastore
-
releaseTableLock
public void releaseTableLock(long lockId) - Specified by:
releaseTableLockin interfaceThriftMetastore
-
getValidWriteIds
- Specified by:
getValidWriteIdsin interfaceThriftMetastore
-
getConfigValue
- Specified by:
getConfigValuein interfaceThriftMetastore
-
allocateWriteId
- Specified by:
allocateWriteIdin interfaceThriftMetastore
-
updateTableWriteId
public void updateTableWriteId(String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange) - Specified by:
updateTableWriteIdin interfaceThriftMetastore
-
alterPartitions
public void alterPartitions(String dbName, String tableName, List<io.trino.hive.thrift.metastore.Partition> partitions, long writeId) - Specified by:
alterPartitionsin interfaceThriftMetastore
-
addDynamicPartitions
public void addDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, AcidOperation operation) - Specified by:
addDynamicPartitionsin interfaceThriftMetastore
-