Package org.projectnessie
Class Hive2NessieRawStore
- java.lang.Object
-
- org.projectnessie.hms.BaseRawStore
-
- org.projectnessie.Hive2NessieRawStore
-
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.hive.metastore.RawStore,RawStoreWithRef
- Direct Known Subclasses:
DelegatingHive2NessieRawStore
public class Hive2NessieRawStore extends BaseRawStore
-
-
Field Summary
-
Fields inherited from class org.projectnessie.hms.BaseRawStore
conf, delegate, hasDelegate, nessie
-
-
Constructor Summary
Constructors Constructor Description Hive2NessieRawStore()Hive2NessieRawStore(boolean delegate)
-
Method Summary
-
Methods inherited from class org.projectnessie.hms.BaseRawStore
checkHasDelegate, commitTransaction, getCatalogs, getConf, getMetastoreDbUuid, getMetaStoreSchemaVersion, getRef, isActiveTransaction, openTransaction, rollbackTransaction, route, route, route, route, route, route, route, route, routeToDelegate, setConf, shutdown, union, union
-
-
-
-
Method Detail
-
getTable
public Table getTable(String dbName, String tableName) throws MetaException
- Throws:
MetaException
-
listPrincipalPartitionGrants
public List<HiveObjectPrivilege> listPrincipalPartitionGrants(String principalName, PrincipalType principalType, String dbName, String tableName, List<String> partValues, String partName)
-
listAllTableGrants
public List<HiveObjectPrivilege> listAllTableGrants(String principalName, PrincipalType principalType, String dbName, String tableName)
-
dropIndex
public boolean dropIndex(String dbName, String origTableName, String indexName) throws MetaException
- Throws:
MetaException
-
removeMasterKey
public boolean removeMasterKey(Integer keySeq)
-
addNotificationEvent
public void addNotificationEvent(NotificationEvent event)
-
getFileMetadata
public ByteBuffer[] getFileMetadata(List<Long> fileIds) throws MetaException
- Throws:
MetaException
-
updatePartitionColumnStatistics
public boolean updatePartitionColumnStatistics(ColumnStatistics statsObj, List<String> partVals) throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException
-
listPrincipalTableGrantsAll
public List<HiveObjectPrivilege> listPrincipalTableGrantsAll(String principalName, PrincipalType principalType)
-
listRolesWithGrants
public List<RolePrincipalGrant> listRolesWithGrants(String principalName, PrincipalType principalType)
-
grantPrivileges
public boolean grantPrivileges(PrivilegeBag privileges) throws InvalidObjectException, MetaException, NoSuchObjectException
-
removeToken
public boolean removeToken(String tokenIdentifier)
-
getCurrentNotificationEventId
public CurrentNotificationEventId getCurrentNotificationEventId()
-
listTableGrantsAll
public List<HiveObjectPrivilege> listTableGrantsAll(String dbName, String tableName)
-
getTableColumnStatistics
public ColumnStatistics getTableColumnStatistics(String dbName, String tableName, List<String> colName) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
getDBPrivilegeSet
public PrincipalPrivilegeSet getDBPrivilegeSet(String dbName, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
listPartitionColumnGrantsAll
public List<HiveObjectPrivilege> listPartitionColumnGrantsAll(String dbName, String tableName, String partitionName, String columnName)
-
getIndexes
public List<Index> getIndexes(String dbName, String origTableName, int max) throws MetaException
- Throws:
MetaException
-
alterPartition
public void alterPartition(String db_name, String tbl_name, List<String> part_vals, Partition new_part) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
getPartitionsByExpr
public boolean getPartitionsByExpr(String dbName, String tblName, byte[] expr, String defaultPartitionName, short maxParts, List<Partition> result) throws org.apache.thrift.TException
- Throws:
org.apache.thrift.TException
-
getAllTables
public List<String> getAllTables(String dbName) throws MetaException
- Throws:
MetaException
-
dropTable
public boolean dropTable(String dbName, String tableName) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException
-
addPartitions
public boolean addPartitions(String dbName, String tblName, List<Partition> parts) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
addPartitions
public boolean addPartitions(String dbName, String tblName, org.apache.hadoop.hive.metastore.partition.spec.PartitionSpecProxy partitionSpec, boolean ifNotExists) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
dropDatabase
public boolean dropDatabase(String dbname) throws NoSuchObjectException, MetaException
- Throws:
NoSuchObjectExceptionMetaException
-
alterDatabase
public boolean alterDatabase(String dbname, Database db) throws NoSuchObjectException, MetaException
- Throws:
NoSuchObjectExceptionMetaException
-
getPartitionsWithAuth
public List<Partition> getPartitionsWithAuth(String dbName, String tblName, short maxParts, String userName, List<String> groupNames) throws MetaException, NoSuchObjectException, InvalidObjectException
-
createTable
public void createTable(Table tbl) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
createDatabase
public void createDatabase(Database db) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
addPartition
public boolean addPartition(Partition part) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
getDatabaseCount
public int getDatabaseCount() throws MetaException- Throws:
MetaException
-
getTableCount
public int getTableCount() throws MetaException- Throws:
MetaException
-
getPartitionCount
public int getPartitionCount() throws MetaException- Throws:
MetaException
-
dropPartition
public boolean dropPartition(String dbName, String tableName, List<String> part_vals) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException
-
getTableMeta
public List<TableMeta> getTableMeta(String dbNames, String tableNames, List<String> tableTypes) throws MetaException
- Throws:
MetaException
-
getAllDatabases
public List<String> getAllDatabases() throws MetaException
- Throws:
MetaException
-
listTableNamesByFilter
public List<String> listTableNamesByFilter(String dbName, String filter, short max_tables) throws MetaException, UnknownDBException
- Throws:
MetaExceptionUnknownDBException
-
alterTable
public void alterTable(String dbname, String name, Table newTable) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
getTableObjectsByName
public List<Table> getTableObjectsByName(String dbname, List<String> tableNames) throws MetaException, UnknownDBException
- Throws:
MetaExceptionUnknownDBException
-
getPartitionsByNames
public List<Partition> getPartitionsByNames(String dbName, String tblName, List<String> partNames) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
doesPartitionExist
public boolean doesPartitionExist(String dbName, String tableName, List<String> part_vals) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
getPartitionsByFilter
public List<Partition> getPartitionsByFilter(String dbName, String tblName, String filter, short maxParts) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
getTables
public List<String> getTables(String dbName, String pattern) throws MetaException
- Throws:
MetaException
-
getTables
public List<String> getTables(String dbName, String pattern, org.apache.hadoop.hive.metastore.TableType tableType) throws MetaException
- Throws:
MetaException
-
getPartitionWithAuth
public Partition getPartitionWithAuth(String dbName, String tblName, List<String> partVals, String user_name, List<String> group_names) throws MetaException, NoSuchObjectException, InvalidObjectException
-
addIndex
public boolean addIndex(Index index) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
listPrincipalPartitionColumnGrants
public List<HiveObjectPrivilege> listPrincipalPartitionColumnGrants(String principalName, PrincipalType principalType, String dbName, String tableName, List<String> partValues, String partName, String columnName)
-
listIndexNames
public List<String> listIndexNames(String dbName, String origTableName, short max) throws MetaException
- Throws:
MetaException
-
listPrincipalTableColumnGrants
public List<HiveObjectPrivilege> listPrincipalTableColumnGrants(String principalName, PrincipalType principalType, String dbName, String tableName, String columnName)
-
addMasterKey
public int addMasterKey(String key) throws MetaException
- Throws:
MetaException
-
removeRole
public boolean removeRole(String roleName) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
cleanNotificationEvents
public void cleanNotificationEvents(int olderThan)
-
flushCache
public void flushCache()
-
updateTableColumnStatistics
public boolean updateTableColumnStatistics(ColumnStatistics colStats) throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException
-
isFileMetadataSupported
public boolean isFileMetadataSupported()
-
listGlobalGrantsAll
public List<HiveObjectPrivilege> listGlobalGrantsAll()
-
getNextNotification
public NotificationEventResponse getNextNotification(NotificationEventRequest rqst)
-
getUserPrivilegeSet
public PrincipalPrivilegeSet getUserPrivilegeSet(String userName, List<String> groupNames) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
revokePrivileges
public boolean revokePrivileges(PrivilegeBag privileges, boolean grantOption) throws InvalidObjectException, MetaException, NoSuchObjectException
-
setMetaStoreSchemaVersion
public void setMetaStoreSchemaVersion(String version, String comment) throws MetaException
- Throws:
MetaException
-
listRoleMembers
public List<RolePrincipalGrant> listRoleMembers(String roleName)
-
cleanupEvents
public long cleanupEvents()
-
updateMasterKey
public void updateMasterKey(Integer seqNo, String key) throws NoSuchObjectException, MetaException
- Throws:
NoSuchObjectExceptionMetaException
-
revokeRole
public boolean revokeRole(Role role, String userName, PrincipalType principalType, boolean grantOption) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
createType
public boolean createType(Type type)
-
getDatabase
public Database getDatabase(String name) throws NoSuchObjectException
- Throws:
NoSuchObjectException
-
getDatabases
public List<String> getDatabases(String pattern) throws MetaException
- Throws:
MetaException
-
dropPartitions
public void dropPartitions(String dbName, String tblName, List<String> partNames) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
getPartition
public Partition getPartition(String dbName, String tableName, List<String> part_vals) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
listPartitionNames
public List<String> listPartitionNames(String db_name, String tbl_name, short max_parts) throws MetaException
- Throws:
MetaException
-
getNumPartitionsByFilter
public int getNumPartitionsByFilter(String dbName, String tblName, String filter) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
listPartitionValues
public PartitionValuesResponse listPartitionValues(String db_name, String tbl_name, List<FieldSchema> cols, boolean applyDistinct, String filter, boolean ascending, List<FieldSchema> order, long maxParts) throws MetaException
- Throws:
MetaException
-
getNumPartitionsByExpr
public int getNumPartitionsByExpr(String dbName, String tblName, byte[] expr) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
listPartitionNamesByFilter
public List<String> listPartitionNamesByFilter(String db_name, String tbl_name, String filter, short max_parts) throws MetaException
- Throws:
MetaException
-
addPrimaryKeys
public void addPrimaryKeys(List<SQLPrimaryKey> pks) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
dropType
public boolean dropType(String typeName)
-
addRole
public boolean addRole(String rowName, String ownerName) throws InvalidObjectException, MetaException, NoSuchObjectException
-
getRole
public Role getRole(String roleName) throws NoSuchObjectException
- Throws:
NoSuchObjectException
-
getMasterKeys
public String[] getMasterKeys()
-
getFileMetadataByExpr
public void getFileMetadataByExpr(List<Long> fileIds, FileMetadataExprType type, byte[] expr, ByteBuffer[] metadatas, ByteBuffer[] exprResults, boolean[] eliminated) throws MetaException
- Throws:
MetaException
-
listPrincipalDBGrantsAll
public List<HiveObjectPrivilege> listPrincipalDBGrantsAll(String principalName, PrincipalType principalType)
-
grantRole
public boolean grantRole(Role role, String userName, PrincipalType principalType, String grantor, PrincipalType grantorType, boolean grantOption) throws MetaException, NoSuchObjectException, InvalidObjectException
-
listPrincipalPartitionGrantsAll
public List<HiveObjectPrivilege> listPrincipalPartitionGrantsAll(String principalName, PrincipalType principalType)
-
listPrincipalTableColumnGrantsAll
public List<HiveObjectPrivilege> listPrincipalTableColumnGrantsAll(String principalName, PrincipalType principalType)
-
listPrincipalPartitionColumnGrantsAll
public List<HiveObjectPrivilege> listPrincipalPartitionColumnGrantsAll(String principalName, PrincipalType principalType)
-
verifySchema
public void verifySchema() throws MetaException- Throws:
MetaException
-
listPrincipalGlobalGrants
public List<HiveObjectPrivilege> listPrincipalGlobalGrants(String principalName, PrincipalType principalType)
-
listRoles
public List<Role> listRoles(String principalName, PrincipalType principalType)
-
addForeignKeys
public void addForeignKeys(List<SQLForeignKey> fks) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
getAllFunctions
public List<Function> getAllFunctions() throws MetaException
- Throws:
MetaException
-
listDBGrantsAll
public List<HiveObjectPrivilege> listDBGrantsAll(String dbName)
-
getTablePrivilegeSet
public PrincipalPrivilegeSet getTablePrivilegeSet(String dbName, String tableName, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
listPartitionNamesPs
public List<String> listPartitionNamesPs(String db_name, String tbl_name, List<String> part_vals, short max_parts) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
getColumnPrivilegeSet
public PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName, String tableName, String partitionName, String columnName, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
getFunctions
public List<String> getFunctions(String dbName, String pattern) throws MetaException
- Throws:
MetaException
-
listTableColumnGrantsAll
public List<HiveObjectPrivilege> listTableColumnGrantsAll(String dbName, String tableName, String columnName)
-
getPartitionColumnStatistics
public List<ColumnStatistics> getPartitionColumnStatistics(String dbName, String tblName, List<String> partNames, List<String> colNames) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
dropFunction
public void dropFunction(String dbName, String funcName) throws MetaException, NoSuchObjectException, InvalidObjectException, InvalidInputException
-
alterFunction
public void alterFunction(String dbName, String funcName, Function newFunction) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
get_aggr_stats_for
public AggrStats get_aggr_stats_for(String dbName, String tblName, List<String> partNames, List<String> colNames) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
getFileMetadataHandler
public org.apache.hadoop.hive.metastore.FileMetadataHandler getFileMetadataHandler(FileMetadataExprType type)
-
putFileMetadata
public void putFileMetadata(List<Long> fileIds, List<ByteBuffer> metadata, FileMetadataExprType type) throws MetaException
- Throws:
MetaException
-
getForeignKeys
public List<SQLForeignKey> getForeignKeys(String parent_db_name, String parent_tbl_name, String foreign_db_name, String foreign_tbl_name) throws MetaException
- Throws:
MetaException
-
getPrimaryKeys
public List<SQLPrimaryKey> getPrimaryKeys(String db_name, String tbl_name) throws MetaException
- Throws:
MetaException
-
dropConstraint
public void dropConstraint(String dbName, String tableName, String constraintName) throws NoSuchObjectException
- Throws:
NoSuchObjectException
-
alterIndex
public void alterIndex(String dbname, String baseTblName, String name, Index newIndex) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
listPrincipalDBGrants
public List<HiveObjectPrivilege> listPrincipalDBGrants(String principalName, PrincipalType principalType, String dbName)
-
createTableWithConstraints
public void createTableWithConstraints(Table tbl, List<SQLPrimaryKey> primaryKeys, List<SQLForeignKey> foreignKeys) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
deletePartitionColumnStatistics
public boolean deletePartitionColumnStatistics(String dbName, String tableName, String partName, List<String> partVals, String colName) throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException
-
isPartitionMarkedForEvent
public boolean isPartitionMarkedForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException
-
deleteTableColumnStatistics
public boolean deleteTableColumnStatistics(String dbName, String tableName, String colName) throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException
-
listPartitionGrantsAll
public List<HiveObjectPrivilege> listPartitionGrantsAll(String dbName, String tableName, String partitionName)
-
getPartitionPrivilegeSet
public PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName, String tableName, String partition, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
markPartitionForEvent
public Table markPartitionForEvent(String dbName, String tblName, Map<String,String> partVals, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException
-
getPartitions
public List<Partition> getPartitions(String dbName, String tableName, int max) throws MetaException, NoSuchObjectException
- Throws:
MetaExceptionNoSuchObjectException
-
alterPartitions
public void alterPartitions(String db_name, String tbl_name, List<List<String>> part_vals_list, List<Partition> new_parts) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
listPartitionsPsWithAuth
public List<Partition> listPartitionsPsWithAuth(String db_name, String tbl_name, List<String> part_vals, short max_parts, String userName, List<String> groupNames) throws MetaException, InvalidObjectException, NoSuchObjectException
-
getFunction
public Function getFunction(String dbName, String funcName) throws MetaException
- Throws:
MetaException
-
createFunction
public void createFunction(Function func) throws InvalidObjectException, MetaException
- Throws:
InvalidObjectExceptionMetaException
-
getIndex
public Index getIndex(String dbName, String origTableName, String indexName) throws MetaException
- Throws:
MetaException
-
-