org.apache.hadoop.hive.metastore
Interface IMetaStoreClient

All Known Implementing Classes:
HiveMetaStoreClient, MetaStoreClient

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_table(String defaultDatabaseName, String tblName, Table table)
           
 Partition appendPartition(String tableName, String dbName, List<String> partVals)
           
 void close()
           
 boolean createDatabase(String name, String location_uri)
           
 void createTable(Table tbl)
           
 boolean dropDatabase(String name)
           
 boolean dropPartition(String db_name, String tbl_name, List<String> part_vals, boolean deleteData)
           
 void dropTable(String tableName, boolean deleteData)
          Drop the table.
 void dropTable(String dbname, String tableName, boolean deleteData, boolean ignoreUknownTab)
          Drop the table.
 Partition getPartition(String tblName, String dbName, List<String> partVals)
           
 Table getTable(String tableName)
          Get a table object.
 Table getTable(String dbName, String tableName)
          Get a table object.
 List<String> getTables(String dbName, String tablePattern)
           
 List<String> listPartitionNames(String db_name, String tbl_name, short max_parts)
           
 List<Partition> listPartitions(String db_name, String tbl_name, short max_parts)
           
 boolean tableExists(String tableName)
           
 

Method Detail

close

void close()

getTables

List<String> getTables(String dbName,
                       String tablePattern)
                       throws MetaException,
                              UnknownTableException,
                              com.facebook.thrift.TException,
                              UnknownDBException
Throws:
MetaException
UnknownTableException
com.facebook.thrift.TException
UnknownDBException

dropTable

void dropTable(String tableName,
               boolean deleteData)
               throws MetaException,
                      UnknownTableException,
                      com.facebook.thrift.TException,
                      NoSuchObjectException
Drop the table.

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.
com.facebook.thrift.TException - A thrift communication error occurred
NoSuchObjectException - The table wasn't found.

dropTable

void dropTable(String dbname,
               String tableName,
               boolean deleteData,
               boolean ignoreUknownTab)
               throws ExistingDependentsException,
                      MetaException,
                      com.facebook.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.
com.facebook.thrift.TException - A thrift communication error occurred
ExistingDependentsException

tableExists

boolean tableExists(String tableName)
                    throws MetaException,
                           com.facebook.thrift.TException,
                           UnknownDBException
Throws:
MetaException
com.facebook.thrift.TException
UnknownDBException

getTable

Table getTable(String tableName)
               throws MetaException,
                      com.facebook.thrift.TException,
                      NoSuchObjectException
Get a table object.

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

getTable

Table getTable(String dbName,
               String tableName)
               throws MetaException,
                      com.facebook.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
com.facebook.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,
                                 com.facebook.thrift.TException
Parameters:
tableName -
dbName -
partVals -
Returns:
the partition object
Throws:
InvalidObjectException
AlreadyExistsException
MetaException
com.facebook.thrift.TException
See Also:
ThriftHiveMetastore.Iface.append_partition(java.lang.String, java.lang.String, java.util.List)

add_partition

Partition add_partition(Partition partition)
                        throws InvalidObjectException,
                               AlreadyExistsException,
                               MetaException,
                               com.facebook.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
com.facebook.thrift.TException - Thrift exception

getPartition

Partition getPartition(String tblName,
                       String dbName,
                       List<String> partVals)
                       throws MetaException,
                              com.facebook.thrift.TException
Parameters:
tblName -
dbName -
partVals -
Returns:
the partition object
Throws:
MetaException
com.facebook.thrift.TException
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,
                                      com.facebook.thrift.TException
Parameters:
tbl_name -
db_name -
max_parts -
Returns:
the list of partitions
Throws:
NoSuchObjectException
MetaException
com.facebook.thrift.TException

listPartitionNames

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

createTable

void createTable(Table tbl)
                 throws AlreadyExistsException,
                        InvalidObjectException,
                        MetaException,
                        NoSuchObjectException,
                        com.facebook.thrift.TException
Parameters:
tbl -
Throws:
AlreadyExistsException
InvalidObjectException
MetaException
NoSuchObjectException
com.facebook.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,
                        com.facebook.thrift.TException
Throws:
InvalidOperationException
MetaException
com.facebook.thrift.TException

createDatabase

boolean createDatabase(String name,
                       String location_uri)
                       throws AlreadyExistsException,
                              MetaException,
                              com.facebook.thrift.TException
Throws:
AlreadyExistsException
MetaException
com.facebook.thrift.TException

dropDatabase

boolean dropDatabase(String name)
                     throws MetaException,
                            com.facebook.thrift.TException
Throws:
MetaException
com.facebook.thrift.TException

dropPartition

boolean dropPartition(String db_name,
                      String tbl_name,
                      List<String> part_vals,
                      boolean deleteData)
                      throws NoSuchObjectException,
                             MetaException,
                             com.facebook.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
com.facebook.thrift.TException
See Also:
ThriftHiveMetastore.Iface.drop_partition(java.lang.String, java.lang.String, java.util.List, boolean)


Copyright © 2009 The Apache Software Foundation