|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.metastore.DummyRawStoreControlledCommit
public class DummyRawStoreControlledCommit
A wrapper around ObjectStore
with the ability to control the result of commitTransaction().
All other functions simply delegate to an embedded ObjectStore object.
Ideally, we should have just extended ObjectStore instead of using
delegation. However, since HiveMetaStore uses a Proxy, this class must
not inherit from any other class.
| Constructor Summary | |
|---|---|
DummyRawStoreControlledCommit()
|
|
| Method Summary | |
|---|---|
boolean |
addIndex(Index index)
|
boolean |
addPartition(Partition part)
|
boolean |
addRole(String rowName,
String ownerName)
|
boolean |
alterDatabase(String dbName,
Database db)
|
void |
alterIndex(String dbName,
String baseTblName,
String name,
Index newIndex)
|
void |
alterPartition(String dbName,
String tblName,
List<String> partVals,
Partition newPart)
|
void |
alterPartitions(String dbName,
String tblName,
List<List<String>> partValsList,
List<Partition> newParts)
|
void |
alterTable(String dbName,
String name,
Table newTable)
|
long |
cleanupEvents()
|
boolean |
commitTransaction()
if this is the commit of the first open call then an actual commit is called. |
void |
createDatabase(Database db)
|
void |
createTable(Table tbl)
|
boolean |
createType(Type type)
|
boolean |
deletePartitionColumnStatistics(String dbName,
String tableName,
String partName,
List<String> partVals,
String colName)
Deletes column statistics if present associated with a given db, table, partition and col. |
boolean |
deleteTableColumnStatistics(String dbName,
String tableName,
String colName)
Deletes column statistics if present associated with a given db, table and col. |
boolean |
dropDatabase(String dbName)
|
boolean |
dropIndex(String dbName,
String origTableName,
String indexName)
|
boolean |
dropPartition(String dbName,
String tableName,
List<String> partVals)
|
boolean |
dropTable(String dbName,
String tableName)
|
boolean |
dropType(String typeName)
|
List<String> |
getAllDatabases()
|
List<String> |
getAllTables(String dbName)
|
PrincipalPrivilegeSet |
getColumnPrivilegeSet(String dbName,
String tableName,
String partitionName,
String columnName,
String userName,
List<String> groupNames)
|
Configuration |
getConf()
|
Database |
getDatabase(String dbName)
|
List<String> |
getDatabases(String pattern)
|
PrincipalPrivilegeSet |
getDBPrivilegeSet(String dbName,
String userName,
List<String> groupNames)
|
Index |
getIndex(String dbName,
String origTableName,
String indexName)
|
List<Index> |
getIndexes(String dbName,
String origTableName,
int max)
|
Partition |
getPartition(String dbName,
String tableName,
List<String> partVals)
|
ColumnStatistics |
getPartitionColumnStatistics(String dbName,
String tableName,
String partName,
List<String> partVal,
String colName)
Returns the relevant column statistics for a given column in a given partition in a given table in a given database if such statistics exist. |
PrincipalPrivilegeSet |
getPartitionPrivilegeSet(String dbName,
String tableName,
String partition,
String userName,
List<String> groupNames)
|
List<Partition> |
getPartitions(String dbName,
String tableName,
int max)
|
List<Partition> |
getPartitionsByFilter(String dbName,
String tblName,
String filter,
short maxParts)
|
List<Partition> |
getPartitionsByNames(String dbName,
String tblName,
List<String> partNames)
|
List<Partition> |
getPartitionsWithAuth(String dbName,
String tblName,
short maxParts,
String userName,
List<String> groupNames)
|
Partition |
getPartitionWithAuth(String dbName,
String tblName,
List<String> partVals,
String userName,
List<String> groupNames)
|
Role |
getRole(String roleName)
|
Table |
getTable(String dbName,
String tableName)
|
ColumnStatistics |
getTableColumnStatistics(String dbName,
String tableName,
String colName)
Returns the relevant column statistics for a given column in a given table in a given database if such statistics exist. |
List<Table> |
getTableObjectsByName(String dbName,
List<String> tableNames)
|
PrincipalPrivilegeSet |
getTablePrivilegeSet(String dbName,
String tableName,
String userName,
List<String> groupNames)
|
List<String> |
getTables(String dbName,
String pattern)
|
Type |
getType(String typeName)
|
PrincipalPrivilegeSet |
getUserPrivilegeSet(String userName,
List<String> groupNames)
|
boolean |
grantPrivileges(PrivilegeBag privileges)
|
boolean |
grantRole(Role role,
String userName,
PrincipalType principalType,
String grantor,
PrincipalType grantorType,
boolean grantOption)
|
boolean |
isPartitionMarkedForEvent(String dbName,
String tblName,
Map<String,String> partName,
PartitionEventType evtType)
|
List<MTablePrivilege> |
listAllTableGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName)
|
List<String> |
listIndexNames(String dbName,
String origTableName,
short max)
|
List<String> |
listPartitionNames(String dbName,
String tblName,
short maxParts)
|
List<String> |
listPartitionNamesByFilter(String dbName,
String tblName,
String filter,
short maxParts)
|
List<String> |
listPartitionNamesPs(String dbName,
String tblName,
List<String> partVals,
short maxParts)
Lists partition names that match a given partial specification |
List<Partition> |
listPartitionsPsWithAuth(String dbName,
String tblName,
List<String> partVals,
short maxParts,
String userName,
List<String> groupNames)
Lists partitions that match a given partial specification and sets their auth privileges. |
List<MDBPrivilege> |
listPrincipalDBGrants(String principalName,
PrincipalType principalType,
String dbName)
|
List<MGlobalPrivilege> |
listPrincipalGlobalGrants(String principalName,
PrincipalType principalType)
|
List<MPartitionColumnPrivilege> |
listPrincipalPartitionColumnGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName,
String partName,
String columnName)
|
List<MPartitionPrivilege> |
listPrincipalPartitionGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName,
String partName)
|
List<MTableColumnPrivilege> |
listPrincipalTableColumnGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName,
String columnName)
|
List<String> |
listRoleNames()
|
List<MRoleMap> |
listRoles(String principalName,
PrincipalType principalType)
|
List<String> |
listTableNamesByFilter(String dbName,
String filter,
short maxTables)
Gets a list of tables based on a filter string and filter type. |
Table |
markPartitionForEvent(String dbName,
String tblName,
Map<String,String> partVals,
PartitionEventType evtType)
|
boolean |
openTransaction()
Opens a new one or the one already created Every call of this function must have corresponding commit or rollback function call |
boolean |
removeRole(String roleName)
|
boolean |
revokePrivileges(PrivilegeBag privileges)
|
boolean |
revokeRole(Role role,
String userName,
PrincipalType principalType)
|
void |
rollbackTransaction()
Rolls back the current transaction if it is active |
static void |
setCommitSucceed(boolean flag)
|
void |
setConf(Configuration conf)
|
void |
shutdown()
|
boolean |
updatePartitionColumnStatistics(ColumnStatistics statsObj,
List<String> partVals)
Persists the given column statistics object to the metastore |
boolean |
updateTableColumnStatistics(ColumnStatistics statsObj)
Persists the given column statistics object to the metastore |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DummyRawStoreControlledCommit()
| Method Detail |
|---|
public static void setCommitSucceed(boolean flag)
public boolean commitTransaction()
RawStore
commitTransaction in interface RawStorepublic Configuration getConf()
public void setConf(Configuration conf)
public void shutdown()
shutdown in interface RawStorepublic boolean openTransaction()
RawStore
openTransaction in interface RawStorepublic void rollbackTransaction()
RawStore
rollbackTransaction in interface RawStore
public void createDatabase(Database db)
throws InvalidObjectException,
MetaException
createDatabase in interface RawStoreInvalidObjectException
MetaException
public Database getDatabase(String dbName)
throws NoSuchObjectException
getDatabase in interface RawStoreNoSuchObjectException
public boolean dropDatabase(String dbName)
throws NoSuchObjectException,
MetaException
dropDatabase in interface RawStoreNoSuchObjectException
MetaException
public boolean alterDatabase(String dbName,
Database db)
throws NoSuchObjectException,
MetaException
alterDatabase in interface RawStoreNoSuchObjectException
MetaException
public List<String> getDatabases(String pattern)
throws MetaException
getDatabases in interface RawStoreMetaException
public List<String> getAllDatabases()
throws MetaException
getAllDatabases in interface RawStoreMetaExceptionpublic boolean createType(Type type)
createType in interface RawStorepublic Type getType(String typeName)
getType in interface RawStorepublic boolean dropType(String typeName)
dropType in interface RawStore
public void createTable(Table tbl)
throws InvalidObjectException,
MetaException
createTable in interface RawStoreInvalidObjectException
MetaException
public boolean dropTable(String dbName,
String tableName)
throws MetaException,
NoSuchObjectException,
InvalidObjectException,
InvalidInputException
dropTable in interface RawStoreMetaException
NoSuchObjectException
InvalidObjectException
InvalidInputException
public Table getTable(String dbName,
String tableName)
throws MetaException
getTable in interface RawStoreMetaException
public boolean addPartition(Partition part)
throws InvalidObjectException,
MetaException
addPartition in interface RawStoreInvalidObjectException
MetaException
public Partition getPartition(String dbName,
String tableName,
List<String> partVals)
throws MetaException,
NoSuchObjectException
getPartition in interface RawStoreMetaException
NoSuchObjectException
public boolean dropPartition(String dbName,
String tableName,
List<String> partVals)
throws MetaException,
NoSuchObjectException,
InvalidObjectException,
InvalidInputException
dropPartition in interface RawStoreMetaException
NoSuchObjectException
InvalidObjectException
InvalidInputException
public List<Partition> getPartitions(String dbName,
String tableName,
int max)
throws MetaException
getPartitions in interface RawStoreMetaException
public void alterTable(String dbName,
String name,
Table newTable)
throws InvalidObjectException,
MetaException
alterTable in interface RawStoreInvalidObjectException
MetaException
public List<String> getTables(String dbName,
String pattern)
throws MetaException
getTables in interface RawStoreMetaException
public List<Table> getTableObjectsByName(String dbName,
List<String> tableNames)
throws MetaException,
UnknownDBException
getTableObjectsByName in interface RawStoredbName - The name of the database from which to retrieve the tablestableNames - The names of the tables to retrieve.
MetaException
UnknownDBException
public List<String> getAllTables(String dbName)
throws MetaException
getAllTables in interface RawStoreMetaException
public List<String> listTableNamesByFilter(String dbName,
String filter,
short maxTables)
throws MetaException,
UnknownDBException
RawStore
listTableNamesByFilter in interface RawStoredbName - The name of the database from which you will retrieve the table namesfilter - The filter stringmaxTables - The maximum number of tables returned
MetaException
UnknownDBException
public List<String> listPartitionNames(String dbName,
String tblName,
short maxParts)
throws MetaException
listPartitionNames in interface RawStoreMetaException
public List<String> listPartitionNamesByFilter(String dbName,
String tblName,
String filter,
short maxParts)
throws MetaException
listPartitionNamesByFilter in interface RawStoreMetaException
public void alterPartition(String dbName,
String tblName,
List<String> partVals,
Partition newPart)
throws InvalidObjectException,
MetaException
alterPartition in interface RawStoreInvalidObjectException
MetaException
public void alterPartitions(String dbName,
String tblName,
List<List<String>> partValsList,
List<Partition> newParts)
throws InvalidObjectException,
MetaException
alterPartitions in interface RawStoreInvalidObjectException
MetaException
public boolean addIndex(Index index)
throws InvalidObjectException,
MetaException
addIndex in interface RawStoreInvalidObjectException
MetaException
public Index getIndex(String dbName,
String origTableName,
String indexName)
throws MetaException
getIndex in interface RawStoreMetaException
public boolean dropIndex(String dbName,
String origTableName,
String indexName)
throws MetaException
dropIndex in interface RawStoreMetaException
public List<Index> getIndexes(String dbName,
String origTableName,
int max)
throws MetaException
getIndexes in interface RawStoreMetaException
public List<String> listIndexNames(String dbName,
String origTableName,
short max)
throws MetaException
listIndexNames in interface RawStoreMetaException
public void alterIndex(String dbName,
String baseTblName,
String name,
Index newIndex)
throws InvalidObjectException,
MetaException
alterIndex in interface RawStoreInvalidObjectException
MetaException
public List<Partition> getPartitionsByFilter(String dbName,
String tblName,
String filter,
short maxParts)
throws MetaException,
NoSuchObjectException
getPartitionsByFilter in interface RawStoreMetaException
NoSuchObjectException
public List<Partition> getPartitionsByNames(String dbName,
String tblName,
List<String> partNames)
throws MetaException,
NoSuchObjectException
getPartitionsByNames in interface RawStoreMetaException
NoSuchObjectException
public Table markPartitionForEvent(String dbName,
String tblName,
Map<String,String> partVals,
PartitionEventType evtType)
throws MetaException,
UnknownTableException,
InvalidPartitionException,
UnknownPartitionException
markPartitionForEvent in interface RawStoreMetaException
UnknownTableException
InvalidPartitionException
UnknownPartitionException
public boolean isPartitionMarkedForEvent(String dbName,
String tblName,
Map<String,String> partName,
PartitionEventType evtType)
throws MetaException,
UnknownTableException,
InvalidPartitionException,
UnknownPartitionException
isPartitionMarkedForEvent in interface RawStoreMetaException
UnknownTableException
InvalidPartitionException
UnknownPartitionException
public boolean addRole(String rowName,
String ownerName)
throws InvalidObjectException,
MetaException,
NoSuchObjectException
addRole in interface RawStoreInvalidObjectException
MetaException
NoSuchObjectException
public boolean removeRole(String roleName)
throws MetaException,
NoSuchObjectException
removeRole in interface RawStoreMetaException
NoSuchObjectException
public boolean grantRole(Role role,
String userName,
PrincipalType principalType,
String grantor,
PrincipalType grantorType,
boolean grantOption)
throws MetaException,
NoSuchObjectException,
InvalidObjectException
grantRole in interface RawStoreMetaException
NoSuchObjectException
InvalidObjectException
public boolean revokeRole(Role role,
String userName,
PrincipalType principalType)
throws MetaException,
NoSuchObjectException
revokeRole in interface RawStoreMetaException
NoSuchObjectException
public PrincipalPrivilegeSet getUserPrivilegeSet(String userName,
List<String> groupNames)
throws InvalidObjectException,
MetaException
getUserPrivilegeSet in interface RawStoreInvalidObjectException
MetaException
public PrincipalPrivilegeSet getDBPrivilegeSet(String dbName,
String userName,
List<String> groupNames)
throws InvalidObjectException,
MetaException
getDBPrivilegeSet in interface RawStoreInvalidObjectException
MetaException
public PrincipalPrivilegeSet getTablePrivilegeSet(String dbName,
String tableName,
String userName,
List<String> groupNames)
throws InvalidObjectException,
MetaException
getTablePrivilegeSet in interface RawStoreInvalidObjectException
MetaException
public PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName,
String tableName,
String partition,
String userName,
List<String> groupNames)
throws InvalidObjectException,
MetaException
getPartitionPrivilegeSet in interface RawStoreInvalidObjectException
MetaException
public PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName,
String tableName,
String partitionName,
String columnName,
String userName,
List<String> groupNames)
throws InvalidObjectException,
MetaException
getColumnPrivilegeSet in interface RawStoreInvalidObjectException
MetaException
public List<MGlobalPrivilege> listPrincipalGlobalGrants(String principalName,
PrincipalType principalType)
listPrincipalGlobalGrants in interface RawStore
public List<MDBPrivilege> listPrincipalDBGrants(String principalName,
PrincipalType principalType,
String dbName)
listPrincipalDBGrants in interface RawStore
public List<MTablePrivilege> listAllTableGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName)
listAllTableGrants in interface RawStore
public List<MPartitionPrivilege> listPrincipalPartitionGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName,
String partName)
listPrincipalPartitionGrants in interface RawStore
public List<MTableColumnPrivilege> listPrincipalTableColumnGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName,
String columnName)
listPrincipalTableColumnGrants in interface RawStore
public List<MPartitionColumnPrivilege> listPrincipalPartitionColumnGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName,
String partName,
String columnName)
listPrincipalPartitionColumnGrants in interface RawStore
public boolean grantPrivileges(PrivilegeBag privileges)
throws InvalidObjectException,
MetaException,
NoSuchObjectException
grantPrivileges in interface RawStoreInvalidObjectException
MetaException
NoSuchObjectException
public boolean revokePrivileges(PrivilegeBag privileges)
throws InvalidObjectException,
MetaException,
NoSuchObjectException
revokePrivileges in interface RawStoreInvalidObjectException
MetaException
NoSuchObjectException
public Role getRole(String roleName)
throws NoSuchObjectException
getRole in interface RawStoreNoSuchObjectExceptionpublic List<String> listRoleNames()
listRoleNames in interface RawStore
public List<MRoleMap> listRoles(String principalName,
PrincipalType principalType)
listRoles in interface RawStore
public Partition getPartitionWithAuth(String dbName,
String tblName,
List<String> partVals,
String userName,
List<String> groupNames)
throws MetaException,
NoSuchObjectException,
InvalidObjectException
getPartitionWithAuth in interface RawStoreMetaException
NoSuchObjectException
InvalidObjectException
public List<Partition> getPartitionsWithAuth(String dbName,
String tblName,
short maxParts,
String userName,
List<String> groupNames)
throws MetaException,
NoSuchObjectException,
InvalidObjectException
getPartitionsWithAuth in interface RawStoreMetaException
NoSuchObjectException
InvalidObjectException
public List<String> listPartitionNamesPs(String dbName,
String tblName,
List<String> partVals,
short maxParts)
throws MetaException,
NoSuchObjectException
RawStore
listPartitionNamesPs in interface RawStoredbName - The name of the database which has the partitionstblName - The name of the table which has the partitionspartVals - A partial list of values for partitions in order of the table's partition keys.
Entries can be empty if you only want to specify latter partitions.maxParts - The maximum number of partitions to return
MetaException
NoSuchObjectException
public List<Partition> listPartitionsPsWithAuth(String dbName,
String tblName,
List<String> partVals,
short maxParts,
String userName,
List<String> groupNames)
throws MetaException,
InvalidObjectException,
NoSuchObjectException
RawStore
listPartitionsPsWithAuth in interface RawStoredbName - The name of the database which has the partitionstblName - The name of the table which has the partitionspartVals - A partial list of values for partitions in order of the table's partition keys
Entries can be empty if you need to specify latter partitions.maxParts - The maximum number of partitions to returnuserName - The user name for the partition for authentication privilegesgroupNames - The groupNames for the partition for authentication privileges
MetaException
InvalidObjectException
NoSuchObjectExceptionpublic long cleanupEvents()
cleanupEvents in interface RawStore
public ColumnStatistics getTableColumnStatistics(String dbName,
String tableName,
String colName)
throws MetaException,
NoSuchObjectException,
InvalidInputException
RawStore
getTableColumnStatistics in interface RawStoreMetaException
NoSuchObjectException
InvalidInputException
public boolean deleteTableColumnStatistics(String dbName,
String tableName,
String colName)
throws NoSuchObjectException,
MetaException,
InvalidObjectException,
InvalidInputException
RawStore
deleteTableColumnStatistics in interface RawStoreNoSuchObjectException
MetaException
InvalidObjectException
InvalidInputException
public boolean deletePartitionColumnStatistics(String dbName,
String tableName,
String partName,
List<String> partVals,
String colName)
throws NoSuchObjectException,
MetaException,
InvalidObjectException,
InvalidInputException
RawStore
deletePartitionColumnStatistics in interface RawStoreNoSuchObjectException
MetaException
InvalidObjectException
InvalidInputException
public ColumnStatistics getPartitionColumnStatistics(String dbName,
String tableName,
String partName,
List<String> partVal,
String colName)
throws MetaException,
NoSuchObjectException,
InvalidInputException,
InvalidObjectException
RawStore
getPartitionColumnStatistics in interface RawStoreMetaException
NoSuchObjectException
InvalidInputException
InvalidObjectException
public boolean updateTableColumnStatistics(ColumnStatistics statsObj)
throws NoSuchObjectException,
MetaException,
InvalidObjectException,
InvalidInputException
RawStore
updateTableColumnStatistics in interface RawStoreNoSuchObjectException
MetaException
InvalidObjectException
InvalidInputException
public boolean updatePartitionColumnStatistics(ColumnStatistics statsObj,
List<String> partVals)
throws NoSuchObjectException,
MetaException,
InvalidObjectException,
InvalidInputException
RawStore
updatePartitionColumnStatistics in interface RawStoreNoSuchObjectException
MetaException
InvalidObjectException
InvalidInputException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||