org.apache.hadoop.hive.metastore
Interface IMetaStoreClient

All Known Implementing Classes:
HiveMetaStoreClient

public interface IMetaStoreClient

TODO Unnecessary when the server sides for both dbstore and filestore are merged


Method Summary
 Partition add_partition(Partition partition)
          Add a partition to the table.
 void alter_partition(String dbName, String tblName, Partition newPart)
          updates a partition to new partition
 void alter_table(String defaultDatabaseName, String tblName, Table table)
           
 Partition appendPartition(String tableName, String dbName, List<String> partVals)
           
 Partition appendPartition(String tableName, String dbName, String name)
           
 void close()
           
 void createDatabase(Database db)
           
 void createTable(Table tbl)
           
 void dropDatabase(String name)
           
 void dropDatabase(String name, boolean deleteData, boolean ignoreUnknownDb)
           
 boolean dropPartition(String db_name, String tbl_name, List<String> part_vals, boolean deleteData)
           
 boolean dropPartition(String db_name, String tbl_name, String name, boolean deleteData)
           
 void dropTable(String tableName, boolean deleteData)
          Deprecated. As of release 0.6.0 replaced by dropTable(String, String, boolean, boolean). This method will be removed in release 0.7.0.
 void dropTable(String dbname, String tableName)
           
 void dropTable(String dbname, String tableName, boolean deleteData, boolean ignoreUknownTab)
          Drop the table.
 List<String> getAllDatabases()
          Get the names of all databases in the MetaStore.
 List<String> getAllTables(String dbName)
          Get the names of all tables in the specified database.
 String getConfigValue(String name, String defaultValue)
           
 Database getDatabase(String databaseName)
          Get a Database Object
 List<String> getDatabases(String databasePattern)
          Get the names of all databases in the MetaStore that match the given pattern.
 List<FieldSchema> getFields(String db, String tableName)
           
 Partition getPartition(String tblName, String dbName, List<String> partVals)
           
 Partition getPartition(String dbName, String tblName, String name)
           
 List<FieldSchema> getSchema(String db, String tableName)
           
 Table getTable(String tableName)
          Deprecated. As of release 0.6.0 replaced by getTable(String, String). This method will be removed in release 0.7.0.
 Table getTable(String dbName, String tableName)
          Get a table object.
 List<String> getTables(String dbName, String tablePattern)
          Get the names of all tables in the specified database that satisfy the supplied table name pattern.
 List<String> listPartitionNames(String db_name, String tbl_name, List<String> part_vals, short max_parts)
           
 List<String> listPartitionNames(String db_name, String tbl_name, short max_parts)
           
 List<Partition> listPartitions(String db_name, String tbl_name, List<String> part_vals, short max_parts)
           
 List<Partition> listPartitions(String db_name, String tbl_name, short max_parts)
           
 Map<String,String> partitionNameToSpec(String name)
           
 List<String> partitionNameToVals(String name)
           
 boolean tableExists(String tableName)
          Deprecated. As of release 0.6.0 replaced by tableExists(String, String). This method will be removed in release 0.7.0.
 boolean tableExists(String databaseName, String tableName)
           
 

Method Detail

close

void close()

getDatabases

List<String> getDatabases(String databasePattern)
                          throws MetaException,
                                 org.apache.thrift.TException
Get the names of all databases in the MetaStore that match the given pattern.

Parameters:
databasePattern -
Returns:
List of database names.
Throws:
MetaException
org.apache.thrift.TException

getAllDatabases

List<String> getAllDatabases()
                             throws MetaException,
                                    org.apache.thrift.TException
Get the names of all databases in the MetaStore.

Returns:
List of database names.
Throws:
MetaException
org.apache.thrift.TException

getTables

List<String> getTables(String dbName,
                       String tablePattern)
                       throws MetaException,
                              org.apache.thrift.TException,
                              UnknownDBException
Get the names of all tables in the specified database that satisfy the supplied table name pattern.

Parameters:
dbName -
tablePattern -
Returns:
List of table names.
Throws:
MetaException
org.apache.thrift.TException
UnknownDBException

getAllTables

List<String> getAllTables(String dbName)
                          throws MetaException,
                                 org.apache.thrift.TException,
                                 UnknownDBException
Get the names of all tables in the specified database.

Parameters:
dbName -
Returns:
List of table names.
Throws:
MetaException
org.apache.thrift.TException
UnknownDBException

dropTable

void dropTable(String dbname,
               String tableName,
               boolean deleteData,
               boolean ignoreUknownTab)
               throws MetaException,
                      org.apache.thrift.TException,
                      NoSuchObjectException
Drop the table.

Parameters:
dbname - The database for this table
tableName - The table to drop
Throws:
MetaException - Could not drop table properly.
NoSuchObjectException - The table wasn't found.
org.apache.thrift.TException - A thrift communication error occurred
ExistingDependentsException

dropTable

@Deprecated
void dropTable(String tableName,
                          boolean deleteData)
               throws MetaException,
                      UnknownTableException,
                      org.apache.thrift.TException,
                      NoSuchObjectException
Deprecated. As of release 0.6.0 replaced by dropTable(String, String, boolean, boolean). This method will be removed in release 0.7.0.

Drop the table in the DEFAULT database.

Parameters:
tableName - The table to drop
deleteData - Should we delete the underlying data
Throws:
MetaException - Could not drop table properly.
UnknownTableException - The table wasn't found.
org.apache.thrift.TException - A thrift communication error occurred
NoSuchObjectException - The table wasn't found.

dropTable

void dropTable(String dbname,
               String tableName)
               throws MetaException,
                      org.apache.thrift.TException,
                      NoSuchObjectException
Throws:
MetaException
org.apache.thrift.TException
NoSuchObjectException

tableExists

boolean tableExists(String databaseName,
                    String tableName)
                    throws MetaException,
                           org.apache.thrift.TException,
                           UnknownDBException
Throws:
MetaException
org.apache.thrift.TException
UnknownDBException

tableExists

@Deprecated
boolean tableExists(String tableName)
                    throws MetaException,
                           org.apache.thrift.TException,
                           UnknownDBException
Deprecated. As of release 0.6.0 replaced by tableExists(String, String). This method will be removed in release 0.7.0.

Check to see if the specified table exists in the DEFAULT database.

Parameters:
tableName -
Returns:
TRUE if DEFAULT.tableName exists, FALSE otherwise.
Throws:
MetaException
org.apache.thrift.TException
UnknownDBException

getTable

@Deprecated
Table getTable(String tableName)
               throws MetaException,
                      org.apache.thrift.TException,
                      NoSuchObjectException
Deprecated. As of release 0.6.0 replaced by getTable(String, String). This method will be removed in release 0.7.0.

Get a table object from the DEFAULT database.

Parameters:
tableName - Name of the table to fetch.
Returns:
An object representing the table.
Throws:
MetaException - Could not fetch the table
org.apache.thrift.TException - A thrift communication error occurred
NoSuchObjectException - In case the table wasn't found.

getDatabase

Database getDatabase(String databaseName)
                     throws NoSuchObjectException,
                            MetaException,
                            org.apache.thrift.TException
Get a Database Object

Parameters:
databaseName - name of the database to fetch
Returns:
Throws:
NoSuchObjectException - The database does not exist
MetaException - Could not fetch the database
org.apache.thrift.TException - A thrift communication error occurred

getTable

Table getTable(String dbName,
               String tableName)
               throws MetaException,
                      org.apache.thrift.TException,
                      NoSuchObjectException
Get a table object.

Parameters:
dbName - The database the table is located in.
tableName - Name of the table to fetch.
Returns:
An object representing the table.
Throws:
MetaException - Could not fetch the table
org.apache.thrift.TException - A thrift communication error occurred
NoSuchObjectException - In case the table wasn't found.

appendPartition

Partition appendPartition(String tableName,
                          String dbName,
                          List<String> partVals)
                          throws InvalidObjectException,
                                 AlreadyExistsException,
                                 MetaException,
                                 org.apache.thrift.TException
Parameters:
tableName -
dbName -
partVals -
Returns:
the partition object
Throws:
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException
See Also:
ThriftHiveMetastore.Iface.append_partition(java.lang.String, java.lang.String, java.util.List)

appendPartition

Partition appendPartition(String tableName,
                          String dbName,
                          String name)
                          throws InvalidObjectException,
                                 AlreadyExistsException,
                                 MetaException,
                                 org.apache.thrift.TException
Throws:
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException

add_partition

Partition add_partition(Partition partition)
                        throws InvalidObjectException,
                               AlreadyExistsException,
                               MetaException,
                               org.apache.thrift.TException
Add a partition to the table.

Parameters:
partition - The partition to add
Returns:
The partition added
Throws:
InvalidObjectException - Could not find table to add to
AlreadyExistsException - Partition already exists
MetaException - Could not add partition
org.apache.thrift.TException - Thrift exception

getPartition

Partition getPartition(String tblName,
                       String dbName,
                       List<String> partVals)
                       throws NoSuchObjectException,
                              MetaException,
                              org.apache.thrift.TException
Parameters:
tblName -
dbName -
partVals -
Returns:
the partition object
Throws:
MetaException
org.apache.thrift.TException
NoSuchObjectException
See Also:
ThriftHiveMetastore.Iface.get_partition(java.lang.String, java.lang.String, java.util.List)

getPartition

Partition getPartition(String dbName,
                       String tblName,
                       String name)
                       throws MetaException,
                              UnknownTableException,
                              NoSuchObjectException,
                              org.apache.thrift.TException
Parameters:
dbName -
tblName -
name - - partition name i.e. 'ds=2010-02-03/ts=2010-02-03 18%3A16%3A01'
Returns:
the partition object
Throws:
MetaException
org.apache.thrift.TException
UnknownTableException
NoSuchObjectException
See Also:
ThriftHiveMetastore.Iface.get_partition(java.lang.String, java.lang.String, java.util.List)

listPartitions

List<Partition> listPartitions(String db_name,
                               String tbl_name,
                               short max_parts)
                               throws NoSuchObjectException,
                                      MetaException,
                                      org.apache.thrift.TException
Parameters:
tbl_name -
db_name -
max_parts -
Returns:
the list of partitions
Throws:
NoSuchObjectException
MetaException
org.apache.thrift.TException

listPartitions

List<Partition> listPartitions(String db_name,
                               String tbl_name,
                               List<String> part_vals,
                               short max_parts)
                               throws NoSuchObjectException,
                                      MetaException,
                                      org.apache.thrift.TException
Throws:
NoSuchObjectException
MetaException
org.apache.thrift.TException

listPartitionNames

List<String> listPartitionNames(String db_name,
                                String tbl_name,
                                short max_parts)
                                throws MetaException,
                                       org.apache.thrift.TException
Throws:
MetaException
org.apache.thrift.TException

listPartitionNames

List<String> listPartitionNames(String db_name,
                                String tbl_name,
                                List<String> part_vals,
                                short max_parts)
                                throws MetaException,
                                       org.apache.thrift.TException
Throws:
MetaException
org.apache.thrift.TException

createTable

void createTable(Table tbl)
                 throws AlreadyExistsException,
                        InvalidObjectException,
                        MetaException,
                        NoSuchObjectException,
                        org.apache.thrift.TException
Parameters:
tbl -
Throws:
AlreadyExistsException
InvalidObjectException
MetaException
NoSuchObjectException
org.apache.thrift.TException
See Also:
ThriftHiveMetastore.Iface.create_table(org.apache.hadoop.hive.metastore.api.Table)

alter_table

void alter_table(String defaultDatabaseName,
                 String tblName,
                 Table table)
                 throws InvalidOperationException,
                        MetaException,
                        org.apache.thrift.TException
Throws:
InvalidOperationException
MetaException
org.apache.thrift.TException

createDatabase

void createDatabase(Database db)
                    throws InvalidObjectException,
                           AlreadyExistsException,
                           MetaException,
                           org.apache.thrift.TException
Throws:
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException

dropDatabase

void dropDatabase(String name)
                  throws NoSuchObjectException,
                         InvalidOperationException,
                         MetaException,
                         org.apache.thrift.TException
Throws:
NoSuchObjectException
InvalidOperationException
MetaException
org.apache.thrift.TException

dropDatabase

void dropDatabase(String name,
                  boolean deleteData,
                  boolean ignoreUnknownDb)
                  throws NoSuchObjectException,
                         InvalidOperationException,
                         MetaException,
                         org.apache.thrift.TException
Throws:
NoSuchObjectException
InvalidOperationException
MetaException
org.apache.thrift.TException

dropPartition

boolean dropPartition(String db_name,
                      String tbl_name,
                      List<String> part_vals,
                      boolean deleteData)
                      throws NoSuchObjectException,
                             MetaException,
                             org.apache.thrift.TException
Parameters:
db_name -
tbl_name -
part_vals -
deleteData - delete the underlying data or just delete the table in metadata
Returns:
true or false
Throws:
NoSuchObjectException
MetaException
org.apache.thrift.TException
See Also:
ThriftHiveMetastore.Iface.drop_partition(java.lang.String, java.lang.String, java.util.List, boolean)

dropPartition

boolean dropPartition(String db_name,
                      String tbl_name,
                      String name,
                      boolean deleteData)
                      throws NoSuchObjectException,
                             MetaException,
                             org.apache.thrift.TException
Throws:
NoSuchObjectException
MetaException
org.apache.thrift.TException

alter_partition

void alter_partition(String dbName,
                     String tblName,
                     Partition newPart)
                     throws InvalidOperationException,
                            MetaException,
                            org.apache.thrift.TException
updates a partition to new partition

Parameters:
dbName - database of the old partition
tblName - table name of the old partition
newPart - new partition
Throws:
InvalidOperationException - if the old partition does not exist
MetaException - if error in updating metadata
org.apache.thrift.TException - if error in communicating with metastore server

getFields

List<FieldSchema> getFields(String db,
                            String tableName)
                            throws MetaException,
                                   org.apache.thrift.TException,
                                   UnknownTableException,
                                   UnknownDBException
Parameters:
db -
tableName -
Throws:
UnknownTableException
UnknownDBException
MetaException
org.apache.thrift.TException
See Also:
ThriftHiveMetastore.Iface.get_fields(java.lang.String, java.lang.String)

getSchema

List<FieldSchema> getSchema(String db,
                            String tableName)
                            throws MetaException,
                                   org.apache.thrift.TException,
                                   UnknownTableException,
                                   UnknownDBException
Parameters:
db -
tableName -
Throws:
UnknownTableException
UnknownDBException
MetaException
org.apache.thrift.TException
See Also:
ThriftHiveMetastore.Iface.get_schema(java.lang.String, java.lang.String)

getConfigValue

String getConfigValue(String name,
                      String defaultValue)
                      throws org.apache.thrift.TException,
                             ConfigValSecurityException
Parameters:
name - name of the configuration property to get the value of
defaultValue - the value to return if property with the given name doesn't exist
Returns:
value of the specified configuration property
Throws:
org.apache.thrift.TException
ConfigValSecurityException

partitionNameToVals

List<String> partitionNameToVals(String name)
                                 throws MetaException,
                                        org.apache.thrift.TException
Parameters:
name - the partition name e.g. ("ds=2010-03-03/hr=12")
Returns:
a list containing the partition col values, in the same order as the name
Throws:
MetaException
org.apache.thrift.TException

partitionNameToSpec

Map<String,String> partitionNameToSpec(String name)
                                       throws MetaException,
                                              org.apache.thrift.TException
Parameters:
name - the partition name e.g. ("ds=2010-03-03/hr=12")
Returns:
a map from the partition col to the value, as listed in the name
Throws:
MetaException
org.apache.thrift.TException


Copyright © 2010 The Apache Software Foundation