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 assumeCanonicalPartitionKeys, boolean useSparkTableStatisticsFallback, 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, io.trino.hive.thrift.metastore.DataOperationType 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) voidalterFunction(io.trino.hive.thrift.metastore.Function function) voidalterPartition(String databaseName, String tableName, PartitionWithStatistics partitionWithStatistics) 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) voidcreateFunction(io.trino.hive.thrift.metastore.Function function) voidcreateRole(String role, String grantor) voidcreateTable(io.trino.hive.thrift.metastore.Table table) voiddropDatabase(String databaseName, boolean deleteData) voiddropFunction(String databaseName, String functionName) voiddropPartition(String databaseName, String tableName, List<String> parts, boolean deleteData) voidvoidgetConfigValue(String name) Optional<io.trino.hive.thrift.metastore.Database> getDatabase(String databaseName) Optional<io.trino.hive.thrift.metastore.Function> getFunction(String databaseName, String functionName) getFunctions(String databaseName, String functionNamePattern) Optional<io.trino.hive.thrift.metastore.Partition> getPartition(String databaseName, String tableName, List<String> partitionValues) getPartitionColumnStatistics(String databaseName, String tableName, Set<String> partitionNames, Set<String> columnNames) 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) getStats()Optional<io.trino.hive.thrift.metastore.Table> getTableColumnStatistics(String databaseName, String tableName, Set<String> columnNames) List<io.trino.hive.thrift.metastore.TableMeta> 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) 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, StatisticsUpdateMode mode, PartitionStatistics statisticsUpdate) voidupdateTableStatistics(String databaseName, String tableName, OptionalLong acidWriteId, StatisticsUpdateMode mode, PartitionStatistics statisticsUpdate) voidupdateTableWriteId(String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange) boolean
-
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 assumeCanonicalPartitionKeys, boolean useSparkTableStatisticsFallback, ThriftMetastoreStats stats, ExecutorService writeStatisticsExecutor)
-
-
Method Details
-
getStats
-
getAllDatabases
- Specified by:
getAllDatabasesin interfaceThriftMetastore
-
getDatabase
- Specified by:
getDatabasein interfaceThriftMetastore
-
getTables
- Specified by:
getTablesin interfaceThriftMetastore
-
getTable
public Optional<io.trino.hive.thrift.metastore.Table> getTable(String databaseName, String tableName) - Specified by:
getTablein interfaceThriftMetastore
-
getTableColumnStatistics
public Map<String,HiveColumnStatistics> getTableColumnStatistics(String databaseName, String tableName, Set<String> columnNames) - Specified by:
getTableColumnStatisticsin interfaceThriftMetastore
-
getPartitionColumnStatistics
public Map<String,Map<String, getPartitionColumnStatisticsHiveColumnStatistics>> (String databaseName, String tableName, Set<String> partitionNames, Set<String> columnNames) - Specified by:
getPartitionColumnStatisticsin interfaceThriftMetastore
-
useSparkTableStatistics
public boolean useSparkTableStatistics()- Specified by:
useSparkTableStatisticsin interfaceThriftMetastore
-
getFields
-
updateTableStatistics
public void updateTableStatistics(String databaseName, String tableName, OptionalLong acidWriteId, StatisticsUpdateMode mode, PartitionStatistics statisticsUpdate) - Specified by:
updateTableStatisticsin interfaceThriftMetastore
-
updatePartitionStatistics
public void updatePartitionStatistics(io.trino.hive.thrift.metastore.Table table, String partitionName, StatisticsUpdateMode mode, PartitionStatistics statisticsUpdate) - 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
-
listRoleGrants
- Specified by:
listRoleGrantsin 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 interfaceThriftMetastore- Parameters:
principal- 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
-
addDynamicPartitions
public void addDynamicPartitions(String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, io.trino.hive.thrift.metastore.DataOperationType operation) - Specified by:
addDynamicPartitionsin interfaceThriftMetastore
-
getFunction
public Optional<io.trino.hive.thrift.metastore.Function> getFunction(String databaseName, String functionName) - Specified by:
getFunctionin interfaceThriftMetastore
-
getFunctions
- Specified by:
getFunctionsin interfaceThriftMetastore
-
createFunction
public void createFunction(io.trino.hive.thrift.metastore.Function function) - Specified by:
createFunctionin interfaceThriftMetastore
-
alterFunction
public void alterFunction(io.trino.hive.thrift.metastore.Function function) - Specified by:
alterFunctionin interfaceThriftMetastore
-
dropFunction
- Specified by:
dropFunctionin interfaceThriftMetastore
-