Package io.trino.plugin.hive.metastore
Interface HiveMetastore
-
- All Known Implementing Classes:
AlluxioHiveMetastore,BridgingHiveMetastore,CachingHiveMetastore,FileHiveMetastore,GlueHiveMetastore,RecordingHiveMetastore
public interface HiveMetastore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidacquireSharedReadLock(HiveIdentity identity, String queryId, long transactionId, List<SchemaTableName> fullTables, List<HivePartition> partitions)default voidacquireTableWriteLock(HiveIdentity identity, String queryId, long transactionId, String dbName, String tableName, org.apache.hadoop.hive.metastore.api.DataOperationType operation, boolean isDynamicPartitionWrite)voidaddColumn(HiveIdentity identity, String databaseName, String tableName, String columnName, HiveType columnType, String columnComment)default voidaddDynamicPartitions(HiveIdentity identity, String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, AcidOperation operation)voidaddPartitions(HiveIdentity identity, String databaseName, String tableName, List<PartitionWithStatistics> partitions)default longallocateWriteId(HiveIdentity identity, String dbName, String tableName, long transactionId)voidalterPartition(HiveIdentity identity, String databaseName, String tableName, PartitionWithStatistics partition)default voidalterPartitions(HiveIdentity identity, String dbName, String tableName, List<Partition> partitions, long writeId)default voidalterTransactionalTable(HiveIdentity identity, Table table, long transactionId, long writeId, PrincipalPrivileges principalPrivileges)voidcommentColumn(HiveIdentity identity, String databaseName, String tableName, String columnName, Optional<String> comment)voidcommentTable(HiveIdentity identity, String databaseName, String tableName, Optional<String> comment)default voidcommitTransaction(HiveIdentity identity, long transactionId)voidcreateDatabase(HiveIdentity identity, Database database)voidcreateRole(String role, String grantor)voidcreateTable(HiveIdentity identity, Table table, PrincipalPrivileges principalPrivileges)voiddropColumn(HiveIdentity identity, String databaseName, String tableName, String columnName)voiddropDatabase(HiveIdentity identity, String databaseName)voiddropPartition(HiveIdentity identity, String databaseName, String tableName, List<String> parts, boolean deleteData)voiddropRole(String role)voiddropTable(HiveIdentity identity, String databaseName, String tableName, boolean deleteData)List<String>getAllDatabases()List<String>getAllTables(String databaseName)List<String>getAllViews(String databaseName)default Optional<String>getConfigValue(String name)Optional<Database>getDatabase(String databaseName)Optional<Partition>getPartition(HiveIdentity identity, Table table, List<String> partitionValues)Optional<List<String>>getPartitionNamesByFilter(HiveIdentity identity, String databaseName, String tableName, List<String> columnNames, TupleDomain<String> partitionKeysFilter)Return a list of partition names, with optional filtering (hint to improve performance if possible).Map<String,Optional<Partition>>getPartitionsByNames(HiveIdentity identity, Table table, List<String> partitionNames)Map<String,PartitionStatistics>getPartitionStatistics(HiveIdentity identity, Table table, List<Partition> partitions)Set<ColumnStatisticType>getSupportedColumnStatistics(Type type)Optional<Table>getTable(HiveIdentity identity, String databaseName, String tableName)PartitionStatisticsgetTableStatistics(HiveIdentity identity, Table table)List<String>getTablesWithParameter(String databaseName, String parameterKey, String parameterValue)default StringgetValidWriteIds(HiveIdentity identity, 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, Set<HivePrivilegeInfo> privileges)booleanisImpersonationEnabled()Set<RoleGrant>listGrantedPrincipals(String role)Set<RoleGrant>listRoleGrants(HivePrincipal principal)Set<String>listRoles()Set<HivePrivilegeInfo>listTablePrivileges(String databaseName, String tableName, String tableOwner, Optional<HivePrincipal> principal)default longopenTransaction(HiveIdentity identity)voidrenameColumn(HiveIdentity identity, String databaseName, String tableName, String oldColumnName, String newColumnName)voidrenameDatabase(HiveIdentity identity, String databaseName, String newDatabaseName)voidrenameTable(HiveIdentity identity, String databaseName, String tableName, String newDatabaseName, String newTableName)voidreplaceTable(HiveIdentity identity, String databaseName, String tableName, Table newTable, PrincipalPrivileges principalPrivileges)This should only be used if the semantic here is drop and add.voidrevokeRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor)voidrevokeTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, Set<HivePrivilegeInfo> privileges)default voidsendTransactionHeartbeat(HiveIdentity identity, long transactionId)voidsetDatabaseOwner(HiveIdentity identity, String databaseName, HivePrincipal principal)voidsetTableOwner(HiveIdentity identity, String databaseName, String tableName, HivePrincipal principal)voidupdatePartitionStatistics(HiveIdentity identity, Table table, String partitionName, Function<PartitionStatistics,PartitionStatistics> update)voidupdateTableStatistics(HiveIdentity identity, String databaseName, String tableName, AcidTransaction transaction, Function<PartitionStatistics,PartitionStatistics> update)default voidupdateTableWriteId(HiveIdentity identity, String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange)
-
-
-
Method Detail
-
getTable
Optional<Table> getTable(HiveIdentity identity, String databaseName, String tableName)
-
getSupportedColumnStatistics
Set<ColumnStatisticType> getSupportedColumnStatistics(Type type)
-
getTableStatistics
PartitionStatistics getTableStatistics(HiveIdentity identity, Table table)
-
getPartitionStatistics
Map<String,PartitionStatistics> getPartitionStatistics(HiveIdentity identity, Table table, List<Partition> partitions)
-
updateTableStatistics
void updateTableStatistics(HiveIdentity identity, String databaseName, String tableName, AcidTransaction transaction, Function<PartitionStatistics,PartitionStatistics> update)
-
updatePartitionStatistics
void updatePartitionStatistics(HiveIdentity identity, Table table, String partitionName, Function<PartitionStatistics,PartitionStatistics> update)
-
getTablesWithParameter
List<String> getTablesWithParameter(String databaseName, String parameterKey, String parameterValue)
-
createDatabase
void createDatabase(HiveIdentity identity, Database database)
-
dropDatabase
void dropDatabase(HiveIdentity identity, String databaseName)
-
renameDatabase
void renameDatabase(HiveIdentity identity, String databaseName, String newDatabaseName)
-
setDatabaseOwner
void setDatabaseOwner(HiveIdentity identity, String databaseName, HivePrincipal principal)
-
createTable
void createTable(HiveIdentity identity, Table table, PrincipalPrivileges principalPrivileges)
-
dropTable
void dropTable(HiveIdentity identity, String databaseName, String tableName, boolean deleteData)
-
replaceTable
void replaceTable(HiveIdentity identity, String databaseName, String tableName, Table newTable, PrincipalPrivileges principalPrivileges)
This should only be used if the semantic here is drop and add. Trying to alter one field of a table object previously acquired from getTable is probably not what you want.
-
renameTable
void renameTable(HiveIdentity identity, String databaseName, String tableName, String newDatabaseName, String newTableName)
-
commentTable
void commentTable(HiveIdentity identity, String databaseName, String tableName, Optional<String> comment)
-
setTableOwner
void setTableOwner(HiveIdentity identity, String databaseName, String tableName, HivePrincipal principal)
-
commentColumn
void commentColumn(HiveIdentity identity, String databaseName, String tableName, String columnName, Optional<String> comment)
-
addColumn
void addColumn(HiveIdentity identity, String databaseName, String tableName, String columnName, HiveType columnType, String columnComment)
-
renameColumn
void renameColumn(HiveIdentity identity, String databaseName, String tableName, String oldColumnName, String newColumnName)
-
dropColumn
void dropColumn(HiveIdentity identity, String databaseName, String tableName, String columnName)
-
getPartition
Optional<Partition> getPartition(HiveIdentity identity, Table table, List<String> partitionValues)
-
getPartitionNamesByFilter
Optional<List<String>> getPartitionNamesByFilter(HiveIdentity identity, String databaseName, String tableName, List<String> columnNames, TupleDomain<String> partitionKeysFilter)
Return a list of partition names, with optional filtering (hint to improve performance if possible).- Parameters:
databaseName- the name of the databasetableName- the name of the tablecolumnNames- the list of partition column namespartitionKeysFilter- optional filter for the partition column values- Returns:
- a list of partition names as created by
MetastoreUtil.toPartitionName(java.util.List<java.lang.String>, java.util.List<java.lang.String>) - See Also:
TupleDomain
-
getPartitionsByNames
Map<String,Optional<Partition>> getPartitionsByNames(HiveIdentity identity, Table table, List<String> partitionNames)
-
addPartitions
void addPartitions(HiveIdentity identity, String databaseName, String tableName, List<PartitionWithStatistics> partitions)
-
dropPartition
void dropPartition(HiveIdentity identity, String databaseName, String tableName, List<String> parts, boolean deleteData)
-
alterPartition
void alterPartition(HiveIdentity identity, String databaseName, String tableName, PartitionWithStatistics partition)
-
dropRole
void dropRole(String role)
-
grantRoles
void grantRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor)
-
revokeRoles
void revokeRoles(Set<String> roles, Set<HivePrincipal> grantees, boolean adminOption, HivePrincipal grantor)
-
listRoleGrants
Set<RoleGrant> listRoleGrants(HivePrincipal principal)
-
grantTablePrivileges
void grantTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, Set<HivePrivilegeInfo> privileges)
-
revokeTablePrivileges
void revokeTablePrivileges(String databaseName, String tableName, String tableOwner, HivePrincipal grantee, Set<HivePrivilegeInfo> privileges)
-
listTablePrivileges
Set<HivePrivilegeInfo> listTablePrivileges(String databaseName, String tableName, String tableOwner, Optional<HivePrincipal> principal)
- Parameters:
principal- when empty, all table privileges are returned
-
isImpersonationEnabled
boolean isImpersonationEnabled()
-
openTransaction
default long openTransaction(HiveIdentity identity)
-
commitTransaction
default void commitTransaction(HiveIdentity identity, long transactionId)
-
sendTransactionHeartbeat
default void sendTransactionHeartbeat(HiveIdentity identity, long transactionId)
-
acquireSharedReadLock
default void acquireSharedReadLock(HiveIdentity identity, String queryId, long transactionId, List<SchemaTableName> fullTables, List<HivePartition> partitions)
-
getValidWriteIds
default String getValidWriteIds(HiveIdentity identity, List<SchemaTableName> tables, long currentTransactionId)
-
allocateWriteId
default long allocateWriteId(HiveIdentity identity, String dbName, String tableName, long transactionId)
-
acquireTableWriteLock
default void acquireTableWriteLock(HiveIdentity identity, String queryId, long transactionId, String dbName, String tableName, org.apache.hadoop.hive.metastore.api.DataOperationType operation, boolean isDynamicPartitionWrite)
-
updateTableWriteId
default void updateTableWriteId(HiveIdentity identity, String dbName, String tableName, long transactionId, long writeId, OptionalLong rowCountChange)
-
alterPartitions
default void alterPartitions(HiveIdentity identity, String dbName, String tableName, List<Partition> partitions, long writeId)
-
addDynamicPartitions
default void addDynamicPartitions(HiveIdentity identity, String dbName, String tableName, List<String> partitionNames, long transactionId, long writeId, AcidOperation operation)
-
alterTransactionalTable
default void alterTransactionalTable(HiveIdentity identity, Table table, long transactionId, long writeId, PrincipalPrivileges principalPrivileges)
-
-