org.apache.hadoop.hive.metastore
Interface RawStore

All Superinterfaces:
org.apache.hadoop.conf.Configurable
All Known Implementing Classes:
DummyRawStoreForJdoConnection, ObjectStore

public interface RawStore
extends org.apache.hadoop.conf.Configurable


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 db_name, String tbl_name, List<String> part_vals, Partition new_part)
           
 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)
           
 Database getDatabase(String name)
           
 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> 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)
           
 Role getRole(String roleName)
           
 Table getTable(String dbName, String tableName)
           
 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 db_name, String tbl_name, short max_parts)
           
 List<String> listPartitionNamesByFilter(String db_name, String tbl_name, String filter, short max_parts)
           
 List<String> listPartitionNamesPs(String db_name, String tbl_name, 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 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 max_tables)
          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
 void shutdown()
           
 
Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConf
 

Method Detail

shutdown

void shutdown()

openTransaction

boolean openTransaction()
Opens a new one or the one already created Every call of this function must have corresponding commit or rollback function call

Returns:
an active transaction

commitTransaction

boolean commitTransaction()
if this is the commit of the first open call then an actual commit is called.

Returns:
true or false

rollbackTransaction

void rollbackTransaction()
Rolls back the current transaction if it is active


createDatabase

void createDatabase(Database db)
                    throws InvalidObjectException,
                           MetaException
Throws:
InvalidObjectException
MetaException

getDatabase

Database getDatabase(String name)
                     throws NoSuchObjectException
Throws:
NoSuchObjectException

dropDatabase

boolean dropDatabase(String dbname)
                     throws NoSuchObjectException,
                            MetaException
Throws:
NoSuchObjectException
MetaException

alterDatabase

boolean alterDatabase(String dbname,
                      Database db)
                      throws NoSuchObjectException,
                             MetaException
Throws:
NoSuchObjectException
MetaException

getDatabases

List<String> getDatabases(String pattern)
                          throws MetaException
Throws:
MetaException

getAllDatabases

List<String> getAllDatabases()
                             throws MetaException
Throws:
MetaException

createType

boolean createType(Type type)

getType

Type getType(String typeName)

dropType

boolean dropType(String typeName)

createTable

void createTable(Table tbl)
                 throws InvalidObjectException,
                        MetaException
Throws:
InvalidObjectException
MetaException

dropTable

boolean dropTable(String dbName,
                  String tableName)
                  throws MetaException
Throws:
MetaException

getTable

Table getTable(String dbName,
               String tableName)
               throws MetaException
Throws:
MetaException

addPartition

boolean addPartition(Partition part)
                     throws InvalidObjectException,
                            MetaException
Throws:
InvalidObjectException
MetaException

getPartition

Partition getPartition(String dbName,
                       String tableName,
                       List<String> part_vals)
                       throws MetaException,
                              NoSuchObjectException
Throws:
MetaException
NoSuchObjectException

dropPartition

boolean dropPartition(String dbName,
                      String tableName,
                      List<String> part_vals)
                      throws MetaException
Throws:
MetaException

getPartitions

List<Partition> getPartitions(String dbName,
                              String tableName,
                              int max)
                              throws MetaException
Throws:
MetaException

alterTable

void alterTable(String dbname,
                String name,
                Table newTable)
                throws InvalidObjectException,
                       MetaException
Throws:
InvalidObjectException
MetaException

getTables

List<String> getTables(String dbName,
                       String pattern)
                       throws MetaException
Throws:
MetaException

getTableObjectsByName

List<Table> getTableObjectsByName(String dbname,
                                  List<String> tableNames)
                                  throws MetaException,
                                         UnknownDBException
Parameters:
dbname - The name of the database from which to retrieve the tables
tableNames - The names of the tables to retrieve.
Returns:
A list of the tables retrievable from the database whose names are in the list tableNames. If there are duplicate names, only one instance of the table will be returned
Throws:
MetaException
UnknownDBException

getAllTables

List<String> getAllTables(String dbName)
                          throws MetaException
Throws:
MetaException

listTableNamesByFilter

List<String> listTableNamesByFilter(String dbName,
                                    String filter,
                                    short max_tables)
                                    throws MetaException,
                                           UnknownDBException
Gets a list of tables based on a filter string and filter type.

Parameters:
dbName - The name of the database from which you will retrieve the table names
filter - The filter string
max_tables - The maximum number of tables returned
Returns:
A list of table names that match the desired filter
Throws:
MetaException
UnknownDBException

listPartitionNames

List<String> listPartitionNames(String db_name,
                                String tbl_name,
                                short max_parts)
                                throws MetaException
Throws:
MetaException

listPartitionNamesByFilter

List<String> listPartitionNamesByFilter(String db_name,
                                        String tbl_name,
                                        String filter,
                                        short max_parts)
                                        throws MetaException
Throws:
MetaException

alterPartition

void alterPartition(String db_name,
                    String tbl_name,
                    List<String> part_vals,
                    Partition new_part)
                    throws InvalidObjectException,
                           MetaException
Throws:
InvalidObjectException
MetaException

addIndex

boolean addIndex(Index index)
                 throws InvalidObjectException,
                        MetaException
Throws:
InvalidObjectException
MetaException

getIndex

Index getIndex(String dbName,
               String origTableName,
               String indexName)
               throws MetaException
Throws:
MetaException

dropIndex

boolean dropIndex(String dbName,
                  String origTableName,
                  String indexName)
                  throws MetaException
Throws:
MetaException

getIndexes

List<Index> getIndexes(String dbName,
                       String origTableName,
                       int max)
                       throws MetaException
Throws:
MetaException

listIndexNames

List<String> listIndexNames(String dbName,
                            String origTableName,
                            short max)
                            throws MetaException
Throws:
MetaException

alterIndex

void alterIndex(String dbname,
                String baseTblName,
                String name,
                Index newIndex)
                throws InvalidObjectException,
                       MetaException
Throws:
InvalidObjectException
MetaException

getPartitionsByFilter

List<Partition> getPartitionsByFilter(String dbName,
                                      String tblName,
                                      String filter,
                                      short maxParts)
                                      throws MetaException,
                                             NoSuchObjectException
Throws:
MetaException
NoSuchObjectException

getPartitionsByNames

List<Partition> getPartitionsByNames(String dbName,
                                     String tblName,
                                     List<String> partNames)
                                     throws MetaException,
                                            NoSuchObjectException
Throws:
MetaException
NoSuchObjectException

markPartitionForEvent

Table markPartitionForEvent(String dbName,
                            String tblName,
                            Map<String,String> partVals,
                            PartitionEventType evtType)
                            throws MetaException,
                                   UnknownTableException,
                                   InvalidPartitionException,
                                   UnknownPartitionException
Throws:
MetaException
UnknownTableException
InvalidPartitionException
UnknownPartitionException

isPartitionMarkedForEvent

boolean isPartitionMarkedForEvent(String dbName,
                                  String tblName,
                                  Map<String,String> partName,
                                  PartitionEventType evtType)
                                  throws MetaException,
                                         UnknownTableException,
                                         InvalidPartitionException,
                                         UnknownPartitionException
Throws:
MetaException
UnknownTableException
InvalidPartitionException
UnknownPartitionException

addRole

boolean addRole(String rowName,
                String ownerName)
                throws InvalidObjectException,
                       MetaException,
                       NoSuchObjectException
Throws:
InvalidObjectException
MetaException
NoSuchObjectException

removeRole

boolean removeRole(String roleName)
                   throws MetaException,
                          NoSuchObjectException
Throws:
MetaException
NoSuchObjectException

grantRole

boolean grantRole(Role role,
                  String userName,
                  PrincipalType principalType,
                  String grantor,
                  PrincipalType grantorType,
                  boolean grantOption)
                  throws MetaException,
                         NoSuchObjectException,
                         InvalidObjectException
Throws:
MetaException
NoSuchObjectException
InvalidObjectException

revokeRole

boolean revokeRole(Role role,
                   String userName,
                   PrincipalType principalType)
                   throws MetaException,
                          NoSuchObjectException
Throws:
MetaException
NoSuchObjectException

getUserPrivilegeSet

PrincipalPrivilegeSet getUserPrivilegeSet(String userName,
                                          List<String> groupNames)
                                          throws InvalidObjectException,
                                                 MetaException
Throws:
InvalidObjectException
MetaException

getDBPrivilegeSet

PrincipalPrivilegeSet getDBPrivilegeSet(String dbName,
                                        String userName,
                                        List<String> groupNames)
                                        throws InvalidObjectException,
                                               MetaException
Throws:
InvalidObjectException
MetaException

getTablePrivilegeSet

PrincipalPrivilegeSet getTablePrivilegeSet(String dbName,
                                           String tableName,
                                           String userName,
                                           List<String> groupNames)
                                           throws InvalidObjectException,
                                                  MetaException
Throws:
InvalidObjectException
MetaException

getPartitionPrivilegeSet

PrincipalPrivilegeSet getPartitionPrivilegeSet(String dbName,
                                               String tableName,
                                               String partition,
                                               String userName,
                                               List<String> groupNames)
                                               throws InvalidObjectException,
                                                      MetaException
Throws:
InvalidObjectException
MetaException

getColumnPrivilegeSet

PrincipalPrivilegeSet getColumnPrivilegeSet(String dbName,
                                            String tableName,
                                            String partitionName,
                                            String columnName,
                                            String userName,
                                            List<String> groupNames)
                                            throws InvalidObjectException,
                                                   MetaException
Throws:
InvalidObjectException
MetaException

listPrincipalGlobalGrants

List<MGlobalPrivilege> listPrincipalGlobalGrants(String principalName,
                                                 PrincipalType principalType)

listPrincipalDBGrants

List<MDBPrivilege> listPrincipalDBGrants(String principalName,
                                         PrincipalType principalType,
                                         String dbName)

listAllTableGrants

List<MTablePrivilege> listAllTableGrants(String principalName,
                                         PrincipalType principalType,
                                         String dbName,
                                         String tableName)

listPrincipalPartitionGrants

List<MPartitionPrivilege> listPrincipalPartitionGrants(String principalName,
                                                       PrincipalType principalType,
                                                       String dbName,
                                                       String tableName,
                                                       String partName)

listPrincipalTableColumnGrants

List<MTableColumnPrivilege> listPrincipalTableColumnGrants(String principalName,
                                                           PrincipalType principalType,
                                                           String dbName,
                                                           String tableName,
                                                           String columnName)

listPrincipalPartitionColumnGrants

List<MPartitionColumnPrivilege> listPrincipalPartitionColumnGrants(String principalName,
                                                                   PrincipalType principalType,
                                                                   String dbName,
                                                                   String tableName,
                                                                   String partName,
                                                                   String columnName)

grantPrivileges

boolean grantPrivileges(PrivilegeBag privileges)
                        throws InvalidObjectException,
                               MetaException,
                               NoSuchObjectException
Throws:
InvalidObjectException
MetaException
NoSuchObjectException

revokePrivileges

boolean revokePrivileges(PrivilegeBag privileges)
                         throws InvalidObjectException,
                                MetaException,
                                NoSuchObjectException
Throws:
InvalidObjectException
MetaException
NoSuchObjectException

getRole

Role getRole(String roleName)
             throws NoSuchObjectException
Throws:
NoSuchObjectException

listRoleNames

List<String> listRoleNames()

listRoles

List<MRoleMap> listRoles(String principalName,
                         PrincipalType principalType)

getPartitionWithAuth

Partition getPartitionWithAuth(String dbName,
                               String tblName,
                               List<String> partVals,
                               String user_name,
                               List<String> group_names)
                               throws MetaException,
                                      NoSuchObjectException,
                                      InvalidObjectException
Throws:
MetaException
NoSuchObjectException
InvalidObjectException

getPartitionsWithAuth

List<Partition> getPartitionsWithAuth(String dbName,
                                      String tblName,
                                      short maxParts,
                                      String userName,
                                      List<String> groupNames)
                                      throws MetaException,
                                             NoSuchObjectException,
                                             InvalidObjectException
Throws:
MetaException
NoSuchObjectException
InvalidObjectException

listPartitionNamesPs

List<String> listPartitionNamesPs(String db_name,
                                  String tbl_name,
                                  List<String> part_vals,
                                  short max_parts)
                                  throws MetaException,
                                         NoSuchObjectException
Lists partition names that match a given partial specification

Parameters:
db_name - The name of the database which has the partitions
tbl_name - The name of the table which has the partitions
part_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
Returns:
A list of partition names that match the partial spec.
Throws:
MetaException
NoSuchObjectException

listPartitionsPsWithAuth

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
Lists partitions that match a given partial specification and sets their auth privileges. If userName and groupNames null, then no auth privileges are set.

Parameters:
db_name - The name of the database which has the partitions
tbl_name - The name of the table which has the partitions
part_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 return
userName - The user name for the partition for authentication privileges
groupNames - The groupNames for the partition for authentication privileges
Returns:
A list of partitions that match the partial spec.
Throws:
MetaException
NoSuchObjectException
InvalidObjectException

cleanupEvents

long cleanupEvents()


Copyright © 2011 The Apache Software Foundation