|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.metastore.HiveMetaStoreClient
public class HiveMetaStoreClient
Hive Metastore Client.
Constructor Summary | |
---|---|
HiveMetaStoreClient(HiveConf conf)
|
|
HiveMetaStoreClient(HiveConf conf,
HiveMetaHookLoader hookLoader)
|
Method Summary | |
---|---|
Partition |
add_partition(Partition new_part)
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 dbname,
String tbl_name,
Table new_tbl)
|
Partition |
appendPartition(String db_name,
String table_name,
List<String> part_vals)
|
Partition |
appendPartition(String dbName,
String tableName,
String partName)
|
Partition |
appendPartitionByName(String dbName,
String tableName,
String partName)
|
void |
close()
|
void |
createDatabase(Database db)
Create a new Database |
void |
createTable(Table tbl)
|
boolean |
createType(Type type)
|
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 |
dropPartition(String db_name,
String tbl_name,
List<String> part_vals,
boolean deleteData)
|
boolean |
dropPartition(String dbName,
String tableName,
String partName,
boolean deleteData)
|
boolean |
dropPartitionByName(String dbName,
String tableName,
String partName,
boolean deleteData)
|
void |
dropTable(String tableName,
boolean deleteData)
Deprecated. |
void |
dropTable(String dbname,
String name)
|
void |
dropTable(String dbname,
String name,
boolean deleteData,
boolean ignoreUknownTab)
Drop the table. |
boolean |
dropType(String type)
|
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 name)
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 db_name,
String tbl_name,
List<String> part_vals)
|
Partition |
getPartition(String db,
String tableName,
String partName)
|
List<FieldSchema> |
getSchema(String db,
String tableName)
|
Table |
getTable(String tableName)
Deprecated. |
Table |
getTable(String dbname,
String name)
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. |
Type |
getType(String name)
|
Map<String,Type> |
getTypeAll(String name)
|
List<String> |
listPartitionNames(String db_name,
String tbl_name,
List<String> part_vals,
short max_parts)
|
List<String> |
listPartitionNames(String dbName,
String tblName,
short max)
|
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. |
boolean |
tableExists(String databaseName,
String tableName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HiveMetaStoreClient(HiveConf conf) throws MetaException
MetaException
public HiveMetaStoreClient(HiveConf conf, HiveMetaHookLoader hookLoader) throws MetaException
MetaException
Method Detail |
---|
public void alter_table(String dbname, String tbl_name, Table new_tbl) throws InvalidOperationException, MetaException, org.apache.thrift.TException
alter_table
in interface IMetaStoreClient
dbname
- tbl_name
- new_tbl
-
InvalidOperationException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.alter_table(java.lang.String,
java.lang.String, org.apache.hadoop.hive.metastore.api.Table)
public void close()
close
in interface IMetaStoreClient
public Partition add_partition(Partition new_part) throws InvalidObjectException, AlreadyExistsException, MetaException, org.apache.thrift.TException
IMetaStoreClient
add_partition
in interface IMetaStoreClient
new_part
-
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.add_partition(org.apache.hadoop.hive.metastore.api.Partition)
public Partition appendPartition(String db_name, String table_name, List<String> part_vals) throws InvalidObjectException, AlreadyExistsException, MetaException, org.apache.thrift.TException
appendPartition
in interface IMetaStoreClient
table_name
- db_name
- part_vals
-
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.append_partition(java.lang.String,
java.lang.String, java.util.List)
public Partition appendPartition(String dbName, String tableName, String partName) throws InvalidObjectException, AlreadyExistsException, MetaException, org.apache.thrift.TException
appendPartition
in interface IMetaStoreClient
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException
public void createDatabase(Database db) throws AlreadyExistsException, InvalidObjectException, MetaException, org.apache.thrift.TException
createDatabase
in interface IMetaStoreClient
db
-
AlreadyExistsException
InvalidObjectException
MetaException
org.apache.thrift.TException
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#create_database(java.lang.String,
java.lang.String)
public void createTable(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, org.apache.thrift.TException
createTable
in interface IMetaStoreClient
tbl
-
MetaException
NoSuchObjectException
org.apache.thrift.TException
AlreadyExistsException
InvalidObjectException
ThriftHiveMetastore.Iface.create_table(org.apache.hadoop.hive.metastore.api.Table)
public boolean createType(Type type) throws AlreadyExistsException, InvalidObjectException, MetaException, org.apache.thrift.TException
type
-
AlreadyExistsException
InvalidObjectException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.create_type(org.apache.hadoop.hive.metastore.api.Type)
public void dropDatabase(String name) throws NoSuchObjectException, InvalidOperationException, MetaException, org.apache.thrift.TException
dropDatabase
in interface IMetaStoreClient
name
-
NoSuchObjectException
InvalidOperationException
MetaException
org.apache.thrift.TException
org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#drop_database(java.lang.String)
public void dropDatabase(String name, boolean deleteData, boolean ignoreUnknownDb) throws NoSuchObjectException, InvalidOperationException, MetaException, org.apache.thrift.TException
dropDatabase
in interface IMetaStoreClient
NoSuchObjectException
InvalidOperationException
MetaException
org.apache.thrift.TException
public boolean dropPartition(String db_name, String tbl_name, List<String> part_vals) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
tbl_name
- db_name
- part_vals
-
NoSuchObjectException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.drop_partition(java.lang.String,
java.lang.String, java.util.List, boolean)
public boolean dropPartition(String dbName, String tableName, String partName, boolean deleteData) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
dropPartition
in interface IMetaStoreClient
NoSuchObjectException
MetaException
org.apache.thrift.TException
public boolean dropPartition(String db_name, String tbl_name, List<String> part_vals, boolean deleteData) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
dropPartition
in interface IMetaStoreClient
db_name
- tbl_name
- part_vals
- deleteData
- delete the underlying data or just delete the table in metadata
NoSuchObjectException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.drop_partition(java.lang.String,
java.lang.String, java.util.List, boolean)
public void dropTable(String dbname, String name) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
dropTable
in interface IMetaStoreClient
name
- dbname
-
NoSuchObjectException
ExistingDependentsException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.drop_table(java.lang.String,
java.lang.String, boolean)
@Deprecated public void dropTable(String tableName, boolean deleteData) throws MetaException, UnknownTableException, org.apache.thrift.TException, NoSuchObjectException
dropTable
in interface IMetaStoreClient
tableName
- The table to dropdeleteData
- Should we delete the underlying data
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.public void dropTable(String dbname, String name, boolean deleteData, boolean ignoreUknownTab) throws MetaException, org.apache.thrift.TException, NoSuchObjectException
IMetaStoreClient
dropTable
in interface IMetaStoreClient
dbname
- name
- deleteData
- delete the underlying data or just delete the table in metadata
NoSuchObjectException
ExistingDependentsException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.drop_table(java.lang.String,
java.lang.String, boolean)
public boolean dropType(String type) throws MetaException, NoSuchObjectException, org.apache.thrift.TException
type
-
MetaException
NoSuchObjectException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.drop_type(java.lang.String)
public Map<String,Type> getTypeAll(String name) throws MetaException, org.apache.thrift.TException
name
-
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.get_type_all(java.lang.String)
public List<String> getDatabases(String databasePattern) throws MetaException
getDatabases
in interface IMetaStoreClient
MetaException
public List<String> getAllDatabases() throws MetaException
getAllDatabases
in interface IMetaStoreClient
MetaException
public List<Partition> listPartitions(String db_name, String tbl_name, short max_parts) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
listPartitions
in interface IMetaStoreClient
tbl_name
- db_name
- max_parts
-
NoSuchObjectException
MetaException
org.apache.thrift.TException
public List<Partition> listPartitions(String db_name, String tbl_name, List<String> part_vals, short max_parts) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
listPartitions
in interface IMetaStoreClient
NoSuchObjectException
MetaException
org.apache.thrift.TException
public Database getDatabase(String name) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
IMetaStoreClient
getDatabase
in interface IMetaStoreClient
name
-
NoSuchObjectException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.get_database(java.lang.String)
public Partition getPartition(String db_name, String tbl_name, List<String> part_vals) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
getPartition
in interface IMetaStoreClient
tbl_name
- db_name
- part_vals
-
MetaException
org.apache.thrift.TException
NoSuchObjectException
ThriftHiveMetastore.Iface.get_partition(java.lang.String,
java.lang.String, java.util.List)
public Table getTable(String dbname, String name) throws MetaException, org.apache.thrift.TException, NoSuchObjectException
IMetaStoreClient
getTable
in interface IMetaStoreClient
name
- dbname
-
NoSuchObjectException
MetaException
org.apache.thrift.TException
NoSuchObjectException
ThriftHiveMetastore.Iface.get_table(java.lang.String,
java.lang.String)
@Deprecated public Table getTable(String tableName) throws MetaException, org.apache.thrift.TException, NoSuchObjectException
getTable
in interface IMetaStoreClient
tableName
- Name of the table to fetch.
MetaException
- Could not fetch the table
org.apache.thrift.TException
- A thrift communication error occurred
NoSuchObjectException
- In case the table wasn't found.public Type getType(String name) throws MetaException, NoSuchObjectException, org.apache.thrift.TException
name
-
MetaException
NoSuchObjectException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.get_type(java.lang.String)
public List<String> getTables(String dbname, String tablePattern) throws MetaException
getTables
in interface IMetaStoreClient
MetaException
public List<String> getAllTables(String dbname) throws MetaException
getAllTables
in interface IMetaStoreClient
MetaException
public boolean tableExists(String databaseName, String tableName) throws MetaException, org.apache.thrift.TException, UnknownDBException
tableExists
in interface IMetaStoreClient
MetaException
org.apache.thrift.TException
UnknownDBException
@Deprecated public boolean tableExists(String tableName) throws MetaException, org.apache.thrift.TException, UnknownDBException
tableExists
in interface IMetaStoreClient
MetaException
org.apache.thrift.TException
UnknownDBException
public List<String> listPartitionNames(String dbName, String tblName, short max) throws MetaException, org.apache.thrift.TException
listPartitionNames
in interface IMetaStoreClient
MetaException
org.apache.thrift.TException
public List<String> listPartitionNames(String db_name, String tbl_name, List<String> part_vals, short max_parts) throws MetaException, org.apache.thrift.TException
listPartitionNames
in interface IMetaStoreClient
MetaException
org.apache.thrift.TException
public void alter_partition(String dbName, String tblName, Partition newPart) throws InvalidOperationException, MetaException, org.apache.thrift.TException
IMetaStoreClient
alter_partition
in interface IMetaStoreClient
dbName
- database of the old partitiontblName
- table name of the old partitionnewPart
- new partition
InvalidOperationException
- if the old partition does not exist
MetaException
- if error in updating metadata
org.apache.thrift.TException
- if error in communicating with metastore serverpublic List<FieldSchema> getFields(String db, String tableName) throws MetaException, org.apache.thrift.TException, UnknownTableException, UnknownDBException
getFields
in interface IMetaStoreClient
db
- tableName
-
UnknownTableException
UnknownDBException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.get_fields(java.lang.String,
java.lang.String)
public List<FieldSchema> getSchema(String db, String tableName) throws MetaException, org.apache.thrift.TException, UnknownTableException, UnknownDBException
getSchema
in interface IMetaStoreClient
db
- tableName
-
UnknownTableException
UnknownDBException
MetaException
org.apache.thrift.TException
ThriftHiveMetastore.Iface.get_schema(java.lang.String,
java.lang.String)
public String getConfigValue(String name, String defaultValue) throws org.apache.thrift.TException, ConfigValSecurityException
getConfigValue
in interface IMetaStoreClient
name
- name of the configuration property to get the value ofdefaultValue
- the value to return if property with the given name doesn't exist
org.apache.thrift.TException
ConfigValSecurityException
public Partition getPartition(String db, String tableName, String partName) throws MetaException, org.apache.thrift.TException, UnknownTableException, NoSuchObjectException
getPartition
in interface IMetaStoreClient
partName
- - partition name i.e. 'ds=2010-02-03/ts=2010-02-03 18%3A16%3A01'
MetaException
org.apache.thrift.TException
UnknownTableException
NoSuchObjectException
ThriftHiveMetastore.Iface.get_partition(java.lang.String,
java.lang.String, java.util.List)
public Partition appendPartitionByName(String dbName, String tableName, String partName) throws InvalidObjectException, AlreadyExistsException, MetaException, org.apache.thrift.TException
InvalidObjectException
AlreadyExistsException
MetaException
org.apache.thrift.TException
public boolean dropPartitionByName(String dbName, String tableName, String partName, boolean deleteData) throws NoSuchObjectException, MetaException, org.apache.thrift.TException
NoSuchObjectException
MetaException
org.apache.thrift.TException
public List<String> partitionNameToVals(String name) throws MetaException, org.apache.thrift.TException
partitionNameToVals
in interface IMetaStoreClient
name
- the partition name e.g. ("ds=2010-03-03/hr=12")
MetaException
org.apache.thrift.TException
public Map<String,String> partitionNameToSpec(String name) throws MetaException, org.apache.thrift.TException
partitionNameToSpec
in interface IMetaStoreClient
name
- the partition name e.g. ("ds=2010-03-03/hr=12")
MetaException
org.apache.thrift.TException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |