|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectHCatClient
HCatClientHMSImpl
public class HCatClientHMSImpl
The HCatClientHMSImpl is the Hive Metastore client based implementation of HCatClient.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class HCatClient |
---|
HCatClient.DropDBMode |
Field Summary |
---|
Fields inherited from class HCatClient |
---|
HCAT_CLIENT_IMPL_CLASS |
Constructor Summary | |
---|---|
HCatClientHMSImpl()
|
Method Summary | |
---|---|
void |
addPartition(HCatAddPartitionDesc partInfo)
Adds the partition. |
int |
addPartitions(List<HCatAddPartitionDesc> partInfoList)
Adds a list of partitions. |
void |
cancelDelegationToken(String tokenStrForm)
Cancel delegation token. |
void |
close()
Close the hcatalog client. |
void |
createDatabase(HCatCreateDBDesc dbInfo)
Creates the database. |
void |
createTable(HCatCreateTableDesc createTableDesc)
Creates the table. |
void |
createTableLike(String dbName,
String existingTblName,
String newTableName,
boolean ifNotExists,
boolean isExternal,
String location)
Creates the table like an existing table. |
void |
dropDatabase(String dbName,
boolean ifExists,
HCatClient.DropDBMode mode)
Drops a database. |
void |
dropPartitions(String dbName,
String tableName,
Map<String,String> partitionSpec,
boolean ifExists)
Drops partition(s) that match the specified (and possibly partial) partition specification. |
void |
dropTable(String dbName,
String tableName,
boolean ifExists)
Drop table. |
HCatDatabase |
getDatabase(String dbName)
Gets the database. |
String |
getDelegationToken(String owner,
String renewerKerberosPrincipalName)
Gets the delegation token. |
String |
getMessageBusTopicName(String dbName,
String tableName)
Retrieve Message-bus topic for a table. |
HCatPartition |
getPartition(String dbName,
String tableName,
Map<String,String> partitionSpec)
Gets the partition. |
List<HCatPartition> |
getPartitions(String dbName,
String tblName)
Gets all the partitions. |
List<HCatPartition> |
getPartitions(String dbName,
String tblName,
Map<String,String> partitionSpec)
Gets all the partitions that match the specified (and possibly partial) partition specification. |
HCatTable |
getTable(String dbName,
String tableName)
Gets the table. |
boolean |
isPartitionMarkedForEvent(String dbName,
String tblName,
Map<String,String> partKVs,
PartitionEventType eventType)
Checks if a partition is marked for event. |
List<String> |
listDatabaseNamesByPattern(String pattern)
Get all existing databases that match the given pattern. |
List<HCatPartition> |
listPartitionsByFilter(String dbName,
String tblName,
String filter)
List partitions by filter. |
List<String> |
listTableNamesByPattern(String dbName,
String tablePattern)
Returns all existing tables from the specified database which match the given pattern. |
void |
markPartitionForEvent(String dbName,
String tblName,
Map<String,String> partKVs,
PartitionEventType eventType)
Mark partition for event. |
void |
renameTable(String dbName,
String oldName,
String newName)
Renames a table. |
long |
renewDelegationToken(String tokenStrForm)
Renew delegation token. |
void |
updateTableSchema(String dbName,
String tableName,
List<HCatFieldSchema> columnSchema)
Updates the Table's column schema to the specified definition. |
Methods inherited from class HCatClient |
---|
create |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HCatClientHMSImpl()
Method Detail |
---|
public List<String> listDatabaseNamesByPattern(String pattern) throws HCatException
HCatClient
listDatabaseNamesByPattern
in class HCatClient
pattern
- java re pattern
HCatException
public HCatDatabase getDatabase(String dbName) throws HCatException
HCatClient
getDatabase
in class HCatClient
dbName
- The name of the database.
HCatException
public void createDatabase(HCatCreateDBDesc dbInfo) throws HCatException
HCatClient
createDatabase
in class HCatClient
dbInfo
- An instance of HCatCreateDBDesc.
HCatException
public void dropDatabase(String dbName, boolean ifExists, HCatClient.DropDBMode mode) throws HCatException
HCatClient
dropDatabase
in class HCatClient
dbName
- The name of the database to delete.ifExists
- Hive returns an error if the database specified does not exist,
unless ifExists is set to true.mode
- This is set to either "restrict" or "cascade". Restrict will
remove the schema if all the tables are empty. Cascade removes
everything including data and definitions.
HCatException
public List<String> listTableNamesByPattern(String dbName, String tablePattern) throws HCatException
HCatClient
listTableNamesByPattern
in class HCatClient
dbName
- The name of the DB (to be searched)tablePattern
- The regex for the table-name
HCatException
public HCatTable getTable(String dbName, String tableName) throws HCatException
HCatClient
getTable
in class HCatClient
dbName
- The name of the database.tableName
- The name of the table.
HCatException
public void createTable(HCatCreateTableDesc createTableDesc) throws HCatException
HCatClient
createTable
in class HCatClient
createTableDesc
- An instance of HCatCreateTableDesc class.
HCatException
public void updateTableSchema(String dbName, String tableName, List<HCatFieldSchema> columnSchema) throws HCatException
HCatClient
updateTableSchema
in class HCatClient
dbName
- The name of the database.tableName
- The name of the table.columnSchema
- The (new) definition of the column schema (i.e. list of fields).
HCatException
public void createTableLike(String dbName, String existingTblName, String newTableName, boolean ifNotExists, boolean isExternal, String location) throws HCatException
HCatClient
createTableLike
in class HCatClient
dbName
- The name of the database.existingTblName
- The name of the existing table.newTableName
- The name of the new table.ifNotExists
- If true, then error related to already table existing is skipped.isExternal
- Set to "true", if table has be created at a different
location other than default.location
- The location for the table.
HCatException
public void dropTable(String dbName, String tableName, boolean ifExists) throws HCatException
HCatClient
dropTable
in class HCatClient
dbName
- The name of the database.tableName
- The name of the table.ifExists
- Hive returns an error if the database specified does not exist,
unless ifExists is set to true.
HCatException
public void renameTable(String dbName, String oldName, String newName) throws HCatException
HCatClient
renameTable
in class HCatClient
dbName
- The name of the database.oldName
- The name of the table to be renamed.newName
- The new name of the table.
HCatException
public List<HCatPartition> getPartitions(String dbName, String tblName) throws HCatException
HCatClient
getPartitions
in class HCatClient
dbName
- The name of the database.tblName
- The name of the table.
HCatException
public List<HCatPartition> getPartitions(String dbName, String tblName, Map<String,String> partitionSpec) throws HCatException
HCatClient
getPartitions
in class HCatClient
dbName
- The name of the database.tblName
- The name of the table.partitionSpec
- The partition specification. (Need not include all partition keys.)
HCatException
public HCatPartition getPartition(String dbName, String tableName, Map<String,String> partitionSpec) throws HCatException
HCatClient
getPartition
in class HCatClient
dbName
- The database name.tableName
- The table name.partitionSpec
- The partition specification, {[col_name,value],[col_name2,value2]}. All partition-key-values
must be specified.
HCatException
public void addPartition(HCatAddPartitionDesc partInfo) throws HCatException
HCatClient
addPartition
in class HCatClient
partInfo
- An instance of HCatAddPartitionDesc.
HCatException
public void dropPartitions(String dbName, String tableName, Map<String,String> partitionSpec, boolean ifExists) throws HCatException
HCatClient
dropPartitions
in class HCatClient
dbName
- The database name.tableName
- The table name.partitionSpec
- The partition specification, {[col_name,value],[col_name2,value2]}.ifExists
- Hive returns an error if the partition specified does not exist, unless ifExists is set to true.
HCatException
public List<HCatPartition> listPartitionsByFilter(String dbName, String tblName, String filter) throws HCatException
HCatClient
listPartitionsByFilter
in class HCatClient
dbName
- The database name.tblName
- The table name.filter
- The filter string,
for example "part1 = \"p1_abc\" and part2 <= "\p2_test\"". Filtering can
be done only on string partition keys.
HCatException
public void markPartitionForEvent(String dbName, String tblName, Map<String,String> partKVs, PartitionEventType eventType) throws HCatException
HCatClient
markPartitionForEvent
in class HCatClient
dbName
- The database name.tblName
- The table name.partKVs
- the key-values associated with the partition.eventType
- the event type
HCatException
public boolean isPartitionMarkedForEvent(String dbName, String tblName, Map<String,String> partKVs, PartitionEventType eventType) throws HCatException
HCatClient
isPartitionMarkedForEvent
in class HCatClient
dbName
- the db nametblName
- the table namepartKVs
- the key-values associated with the partition.eventType
- the event type
HCatException
public String getDelegationToken(String owner, String renewerKerberosPrincipalName) throws HCatException
HCatClient
getDelegationToken
in class HCatClient
owner
- the ownerrenewerKerberosPrincipalName
- the renewer kerberos principal name
HCatException
public long renewDelegationToken(String tokenStrForm) throws HCatException
HCatClient
renewDelegationToken
in class HCatClient
tokenStrForm
- the token string
HCatException
public void cancelDelegationToken(String tokenStrForm) throws HCatException
HCatClient
cancelDelegationToken
in class HCatClient
tokenStrForm
- the token string
HCatException
public void close() throws HCatException
HCatClient
close
in class HCatClient
HCatException
public int addPartitions(List<HCatAddPartitionDesc> partInfoList) throws HCatException
HCatClient
addPartitions
in class HCatClient
partInfoList
- A list of HCatAddPartitionDesc.
HCatException
public String getMessageBusTopicName(String dbName, String tableName) throws HCatException
HCatClient
getMessageBusTopicName
in class HCatClient
dbName
- The name of the DB.tableName
- The name of the table.
HCatException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |