@ThreadSafe public class CachingHiveMetastore extends Object implements HiveMetastore
Modifier and Type | Field and Description |
---|---|
protected HiveCluster |
clientProvider |
DEFAULT_DATABASE_NAME
Constructor and Description |
---|
CachingHiveMetastore(HiveCluster hiveCluster,
ExecutorService executor,
io.airlift.units.Duration cacheTtl,
io.airlift.units.Duration refreshInterval) |
CachingHiveMetastore(HiveCluster hiveCluster,
ExecutorService executor,
HiveClientConfig hiveClientConfig) |
Modifier and Type | Method and Description |
---|---|
void |
addPartitions(String databaseName,
String tableName,
List<org.apache.hadoop.hive.metastore.api.Partition> partitions)
Adds partitions to the table in a single atomic task.
|
void |
alterTable(String databaseName,
String tableName,
org.apache.hadoop.hive.metastore.api.Table table) |
void |
createTable(org.apache.hadoop.hive.metastore.api.Table table) |
void |
dropPartition(String databaseName,
String tableName,
List<String> parts) |
void |
dropPartitionByName(String databaseName,
String tableName,
String partitionName) |
void |
dropTable(String databaseName,
String tableName) |
void |
flushCache() |
List<String> |
getAllDatabases() |
Optional<List<String>> |
getAllTables(String databaseName) |
Optional<List<String>> |
getAllViews(String databaseName) |
Optional<org.apache.hadoop.hive.metastore.api.Database> |
getDatabase(String databaseName) |
Set<HivePrivilegeInfo> |
getDatabasePrivileges(String user,
String databaseName) |
protected java.util.function.Function<Exception,Exception> |
getExceptionMapper() |
Optional<org.apache.hadoop.hive.metastore.api.Partition> |
getPartition(String databaseName,
String tableName,
String partitionName) |
Optional<List<String>> |
getPartitionNames(String databaseName,
String tableName) |
Optional<List<String>> |
getPartitionNamesByParts(String databaseName,
String tableName,
List<String> parts) |
Optional<Map<String,org.apache.hadoop.hive.metastore.api.Partition>> |
getPartitionsByNames(String databaseName,
String tableName,
List<String> partitionNames) |
Set<String> |
getRoles(String user) |
CachingHiveMetastoreStats |
getStats() |
Optional<org.apache.hadoop.hive.metastore.api.Table> |
getTable(String databaseName,
String tableName) |
Set<HivePrivilegeInfo> |
getTablePrivileges(String user,
String databaseName,
String tableName) |
void |
grantTablePrivileges(String databaseName,
String tableName,
String grantee,
Set<org.apache.hadoop.hive.metastore.api.PrivilegeGrantInfo> privilegeGrantInfoSet) |
protected void |
invalidateTable(String databaseName,
String tableName) |
void |
revokeTablePrivileges(String databaseName,
String tableName,
String grantee,
Set<org.apache.hadoop.hive.metastore.api.PrivilegeGrantInfo> privilegeGrantInfoSet) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isDatabaseOwner, isTableOwner
protected final HiveCluster clientProvider
@Inject public CachingHiveMetastore(HiveCluster hiveCluster, ExecutorService executor, HiveClientConfig hiveClientConfig)
public CachingHiveMetastore(HiveCluster hiveCluster, ExecutorService executor, io.airlift.units.Duration cacheTtl, io.airlift.units.Duration refreshInterval)
public CachingHiveMetastoreStats getStats()
public void flushCache()
flushCache
in interface HiveMetastore
public List<String> getAllDatabases()
getAllDatabases
in interface HiveMetastore
public Optional<org.apache.hadoop.hive.metastore.api.Database> getDatabase(String databaseName)
getDatabase
in interface HiveMetastore
public Optional<List<String>> getAllTables(String databaseName)
getAllTables
in interface HiveMetastore
public Optional<org.apache.hadoop.hive.metastore.api.Table> getTable(String databaseName, String tableName)
getTable
in interface HiveMetastore
public Optional<List<String>> getAllViews(String databaseName)
getAllViews
in interface HiveMetastore
public void createTable(org.apache.hadoop.hive.metastore.api.Table table)
createTable
in interface HiveMetastore
public void dropTable(String databaseName, String tableName)
dropTable
in interface HiveMetastore
public void alterTable(String databaseName, String tableName, org.apache.hadoop.hive.metastore.api.Table table)
alterTable
in interface HiveMetastore
public Optional<List<String>> getPartitionNames(String databaseName, String tableName)
getPartitionNames
in interface HiveMetastore
public Optional<List<String>> getPartitionNamesByParts(String databaseName, String tableName, List<String> parts)
getPartitionNamesByParts
in interface HiveMetastore
public void addPartitions(String databaseName, String tableName, List<org.apache.hadoop.hive.metastore.api.Partition> partitions)
HiveMetastore
addPartitions
in interface HiveMetastore
public void dropPartition(String databaseName, String tableName, List<String> parts)
dropPartition
in interface HiveMetastore
public void dropPartitionByName(String databaseName, String tableName, String partitionName)
dropPartitionByName
in interface HiveMetastore
public Optional<Map<String,org.apache.hadoop.hive.metastore.api.Partition>> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames)
getPartitionsByNames
in interface HiveMetastore
public Optional<org.apache.hadoop.hive.metastore.api.Partition> getPartition(String databaseName, String tableName, String partitionName)
getPartition
in interface HiveMetastore
public Set<String> getRoles(String user)
getRoles
in interface HiveMetastore
public Set<HivePrivilegeInfo> getDatabasePrivileges(String user, String databaseName)
getDatabasePrivileges
in interface HiveMetastore
public Set<HivePrivilegeInfo> getTablePrivileges(String user, String databaseName, String tableName)
getTablePrivileges
in interface HiveMetastore
public void grantTablePrivileges(String databaseName, String tableName, String grantee, Set<org.apache.hadoop.hive.metastore.api.PrivilegeGrantInfo> privilegeGrantInfoSet)
grantTablePrivileges
in interface HiveMetastore
public void revokeTablePrivileges(String databaseName, String tableName, String grantee, Set<org.apache.hadoop.hive.metastore.api.PrivilegeGrantInfo> privilegeGrantInfoSet)
revokeTablePrivileges
in interface HiveMetastore
protected java.util.function.Function<Exception,Exception> getExceptionMapper()
Copyright © 2012-2016. All Rights Reserved.