|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.metastore.ObjectStore
public class ObjectStore
This class is the interface between the application logic and the database store that contains the objects. Refrain putting any logic in mode.M* objects or in this file as former could be auto generated and this class would need to be made into a interface that can read both from a database and a filestore.
Constructor Summary | |
---|---|
ObjectStore()
|
Method Summary | |
---|---|
boolean |
addIndex(Index index)
|
boolean |
addPartition(Partition part)
|
boolean |
addRole(String roleName,
String ownerName)
|
boolean |
alterDatabase(String dbName,
Database db)
Alter the database object in metastore. |
void |
alterIndex(String dbname,
String baseTblName,
String name,
Index newIndex)
|
void |
alterPartition(String dbname,
String name,
List<String> part_vals,
Partition newPart)
|
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 |
dropDatabase(String dbname)
|
boolean |
dropIndex(String dbName,
String origTableName,
String indexName)
|
boolean |
dropPartition(String dbName,
String tableName,
List<String> part_vals)
|
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)
|
org.apache.hadoop.conf.Configuration |
getConf()
|
Database |
getDatabase(String name)
|
List<String> |
getDatabases(String pattern)
|
List<PrivilegeGrantInfo> |
getDBPrivilege(String dbName,
String principalName,
PrincipalType principalType)
|
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> part_vals)
|
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 user_name,
List<String> group_names)
|
javax.jdo.PersistenceManager |
getPersistenceManager()
|
Role |
getRole(String roleName)
|
Table |
getTable(String dbName,
String tableName)
|
List<Table> |
getTableObjectsByName(String db,
List<String> tbl_names)
|
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 |
isActiveTransaction()
|
boolean |
isPartitionMarkedForEvent(String dbName,
String tblName,
Map<String,String> partName,
PartitionEventType evtType)
|
List<MTablePrivilege> |
listAllTableGrants(String principalName,
PrincipalType principalType,
String dbName,
String tableName)
|
List<MTablePrivilege> |
listAllTableGrants(String dbName,
String tableName)
|
List<String> |
listIndexNames(String dbName,
String origTableName,
short max)
|
List<MPartitionColumnPrivilege> |
listPartitionAllColumnGrants(String dbName,
String tableName,
String partName)
|
List<String> |
listPartitionNames(String dbName,
String tableName,
short max)
|
List<String> |
listPartitionNamesByFilter(String dbName,
String tableName,
String filter,
short maxParts)
|
List<String> |
listPartitionNamesPs(String dbName,
String tableName,
List<String> part_vals,
short max_parts)
Lists partition names that match a given partial specification |
List<Partition> |
listPartitionsPsWithAuth(String db_name,
String tbl_name,
List<String> part_vals,
short max_parts,
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 partitionName,
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<MTableColumnPrivilege> |
listTableAllColumnGrants(String dbName,
String tableName)
|
List<MPartitionColumnPrivilege> |
listTableAllPartitionColumnGrants(String dbName,
String tableName)
|
List<MPartitionPrivilege> |
listTableAllPartitionGrants(String dbName,
String tableName)
|
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> partName,
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 |
void |
setConf(org.apache.hadoop.conf.Configuration conf)
Called whenever this object is instantiated using ReflectionUils, and also on connection retries. |
void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectStore()
Method Detail |
---|
public org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
@InterfaceAudience.LimitedPrivate(value="HCATALOG") @InterfaceStability.Evolving public javax.jdo.PersistenceManager getPersistenceManager()
public void shutdown()
shutdown
in interface RawStore
public boolean openTransaction()
openTransaction
in interface RawStore
public boolean commitTransaction()
commitTransaction
in interface RawStore
public boolean isActiveTransaction()
public void rollbackTransaction()
rollbackTransaction
in interface RawStore
public void createDatabase(Database db) throws InvalidObjectException, MetaException
createDatabase
in interface RawStore
InvalidObjectException
MetaException
public Database getDatabase(String name) throws NoSuchObjectException
getDatabase
in interface RawStore
NoSuchObjectException
public boolean alterDatabase(String dbName, Database db) throws MetaException, NoSuchObjectException
alterDatabase
in interface RawStore
dbName
- the database namedb
- the Hive Database object
MetaException
NoSuchObjectException
public boolean dropDatabase(String dbname) throws NoSuchObjectException, MetaException
dropDatabase
in interface RawStore
NoSuchObjectException
MetaException
public List<String> getDatabases(String pattern) throws MetaException
getDatabases
in interface RawStore
MetaException
public List<String> getAllDatabases() throws MetaException
getAllDatabases
in interface RawStore
MetaException
public boolean createType(Type type)
createType
in interface RawStore
public Type getType(String typeName)
getType
in interface RawStore
public boolean dropType(String typeName)
dropType
in interface RawStore
public void createTable(Table tbl) throws InvalidObjectException, MetaException
createTable
in interface RawStore
InvalidObjectException
MetaException
public boolean dropTable(String dbName, String tableName) throws MetaException
dropTable
in interface RawStore
MetaException
public Table getTable(String dbName, String tableName) throws MetaException
getTable
in interface RawStore
MetaException
public List<String> getTables(String dbName, String pattern) throws MetaException
getTables
in interface RawStore
MetaException
public List<String> getAllTables(String dbName) throws MetaException
getAllTables
in interface RawStore
MetaException
public List<Table> getTableObjectsByName(String db, List<String> tbl_names) throws MetaException, UnknownDBException
getTableObjectsByName
in interface RawStore
db
- The name of the database from which to retrieve the tablestbl_names
- The names of the tables to retrieve.
MetaException
UnknownDBException
public boolean addPartition(Partition part) throws InvalidObjectException, MetaException
addPartition
in interface RawStore
InvalidObjectException
MetaException
public Partition getPartition(String dbName, String tableName, List<String> part_vals) throws NoSuchObjectException, MetaException
getPartition
in interface RawStore
NoSuchObjectException
MetaException
public boolean dropPartition(String dbName, String tableName, List<String> part_vals) throws MetaException
dropPartition
in interface RawStore
MetaException
public List<Partition> getPartitions(String dbName, String tableName, int max) throws MetaException
getPartitions
in interface RawStore
MetaException
public List<Partition> getPartitionsWithAuth(String dbName, String tblName, short maxParts, String userName, List<String> groupNames) throws MetaException, NoSuchObjectException, InvalidObjectException
getPartitionsWithAuth
in interface RawStore
MetaException
NoSuchObjectException
InvalidObjectException
public Partition getPartitionWithAuth(String dbName, String tblName, List<String> partVals, String user_name, List<String> group_names) throws NoSuchObjectException, MetaException, InvalidObjectException
getPartitionWithAuth
in interface RawStore
NoSuchObjectException
MetaException
InvalidObjectException
public List<String> listPartitionNames(String dbName, String tableName, short max) throws MetaException
listPartitionNames
in interface RawStore
MetaException
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
RawStore
listPartitionsPsWithAuth
in interface RawStore
db_name
- The name of the database which has the partitionstbl_name
- The name of the table which has the partitionspart_vals
- 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.max_parts
- 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
NoSuchObjectException
public List<String> listPartitionNamesPs(String dbName, String tableName, List<String> part_vals, short max_parts) throws MetaException, NoSuchObjectException
RawStore
listPartitionNamesPs
in interface RawStore
dbName
- The name of the database which has the partitionstableName
- The name of the table which has the partitionspart_vals
- 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.max_parts
- The maximum number of partitions to return
MetaException
NoSuchObjectException
public List<Partition> getPartitionsByNames(String dbName, String tblName, List<String> partNames) throws MetaException, NoSuchObjectException
getPartitionsByNames
in interface RawStore
MetaException
NoSuchObjectException
public List<Partition> getPartitionsByFilter(String dbName, String tblName, String filter, short maxParts) throws MetaException, NoSuchObjectException
getPartitionsByFilter
in interface RawStore
MetaException
NoSuchObjectException
public List<String> listTableNamesByFilter(String dbName, String filter, short maxTables) throws MetaException
RawStore
listTableNamesByFilter
in interface RawStore
dbName
- The name of the database from which you will retrieve the table namesfilter
- The filter stringmaxTables
- The maximum number of tables returned
MetaException
public List<String> listPartitionNamesByFilter(String dbName, String tableName, String filter, short maxParts) throws MetaException
listPartitionNamesByFilter
in interface RawStore
MetaException
public void alterTable(String dbname, String name, Table newTable) throws InvalidObjectException, MetaException
alterTable
in interface RawStore
InvalidObjectException
MetaException
public void alterIndex(String dbname, String baseTblName, String name, Index newIndex) throws InvalidObjectException, MetaException
alterIndex
in interface RawStore
InvalidObjectException
MetaException
public void alterPartition(String dbname, String name, List<String> part_vals, Partition newPart) throws InvalidObjectException, MetaException
alterPartition
in interface RawStore
InvalidObjectException
MetaException
public boolean addIndex(Index index) throws InvalidObjectException, MetaException
addIndex
in interface RawStore
InvalidObjectException
MetaException
public boolean dropIndex(String dbName, String origTableName, String indexName) throws MetaException
dropIndex
in interface RawStore
MetaException
public Index getIndex(String dbName, String origTableName, String indexName) throws MetaException
getIndex
in interface RawStore
MetaException
public List<Index> getIndexes(String dbName, String origTableName, int max) throws MetaException
getIndexes
in interface RawStore
MetaException
public List<String> listIndexNames(String dbName, String origTableName, short max) throws MetaException
listIndexNames
in interface RawStore
MetaException
public boolean addRole(String roleName, String ownerName) throws InvalidObjectException, MetaException, NoSuchObjectException
addRole
in interface RawStore
InvalidObjectException
MetaException
NoSuchObjectException
public boolean grantRole(Role role, String userName, PrincipalType principalType, String grantor, PrincipalType grantorType, boolean grantOption) throws MetaException, NoSuchObjectException, InvalidObjectException
grantRole
in interface RawStore
MetaException
NoSuchObjectException
InvalidObjectException
public boolean revokeRole(Role role, String userName, PrincipalType principalType) throws MetaException, NoSuchObjectException
revokeRole
in interface RawStore
MetaException
NoSuchObjectException
public boolean removeRole(String roleName) throws MetaException, NoSuchObjectException
removeRole
in interface RawStore
MetaException
NoSuchObjectException
public List<MRoleMap> listRoles(String principalName, PrincipalType principalType)
listRoles
in interface RawStore
public Role getRole(String roleName) throws NoSuchObjectException
getRole
in interface RawStore
NoSuchObjectException
public List<String> listRoleNames()
listRoleNames
in interface RawStore
public PrincipalPrivilegeSet getUserPrivilegeSet(String userName, List<String> groupNames) throws InvalidObjectException, MetaException
getUserPrivilegeSet
in interface RawStore
InvalidObjectException
MetaException
public List<PrivilegeGrantInfo> getDBPrivilege(String dbName, String principalName, PrincipalType principalType) throws InvalidObjectException, MetaException
InvalidObjectException
MetaException
public PrincipalPrivilegeSet getDBPrivilegeSet(String dbName, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
getDBPrivilegeSet
in interface RawStore
InvalidObjectException
MetaException
public PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName, String tableName, String partition, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
getPartitionPrivilegeSet
in interface RawStore
InvalidObjectException
MetaException
public PrincipalPrivilegeSet getTablePrivilegeSet(String dbName, String tableName, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
getTablePrivilegeSet
in interface RawStore
InvalidObjectException
MetaException
public PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName, String tableName, String partitionName, String columnName, String userName, List<String> groupNames) throws InvalidObjectException, MetaException
getColumnPrivilegeSet
in interface RawStore
InvalidObjectException
MetaException
public boolean grantPrivileges(PrivilegeBag privileges) throws InvalidObjectException, MetaException, NoSuchObjectException
grantPrivileges
in interface RawStore
InvalidObjectException
MetaException
NoSuchObjectException
public boolean revokePrivileges(PrivilegeBag privileges) throws InvalidObjectException, MetaException, NoSuchObjectException
revokePrivileges
in interface RawStore
InvalidObjectException
MetaException
NoSuchObjectException
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 dbName, String tableName)
public List<MPartitionPrivilege> listTableAllPartitionGrants(String dbName, String tableName)
public List<MTableColumnPrivilege> listTableAllColumnGrants(String dbName, String tableName)
public List<MPartitionColumnPrivilege> listTableAllPartitionColumnGrants(String dbName, String tableName)
public List<MPartitionColumnPrivilege> listPartitionAllColumnGrants(String dbName, String tableName, String partName)
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 partitionName, String columnName)
listPrincipalPartitionColumnGrants
in interface RawStore
public boolean isPartitionMarkedForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws UnknownTableException, MetaException, InvalidPartitionException, UnknownPartitionException
isPartitionMarkedForEvent
in interface RawStore
UnknownTableException
MetaException
InvalidPartitionException
UnknownPartitionException
public Table markPartitionForEvent(String dbName, String tblName, Map<String,String> partName, PartitionEventType evtType) throws MetaException, UnknownTableException, InvalidPartitionException, UnknownPartitionException
markPartitionForEvent
in interface RawStore
MetaException
UnknownTableException
InvalidPartitionException
UnknownPartitionException
public long cleanupEvents()
cleanupEvents
in interface RawStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |