Class HiveClient
- java.lang.Object
-
- com.expediagroup.beekeeper.cleanup.hive.HiveClient
-
- All Implemented Interfaces:
CleanerClient,java.io.Closeable,java.lang.AutoCloseable
public class HiveClient extends java.lang.Object implements CleanerClient
-
-
Constructor Summary
Constructors Constructor Description HiveClient(com.hotels.hcommon.hive.metastore.client.api.CloseableMetaStoreClient client, boolean dryRunEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleandropPartition(java.lang.String databaseName, java.lang.String tableName, java.lang.String partitionName)Will drop the partition from the table if it exists.voiddropTable(java.lang.String databaseName, java.lang.String tableName)Will drop the table from the database if it exists.java.util.Map<java.lang.String,java.lang.String>getTableProperties(java.lang.String databaseName, java.lang.String tableName)booleantableExists(java.lang.String databaseName, java.lang.String tableName)
-
-
-
Method Detail
-
dropTable
public void dropTable(java.lang.String databaseName, java.lang.String tableName)Will drop the table from the database if it exists.- Specified by:
dropTablein interfaceCleanerClient- Parameters:
databaseName-tableName-
-
dropPartition
public boolean dropPartition(java.lang.String databaseName, java.lang.String tableName, java.lang.String partitionName)Will drop the partition from the table if it exists.- Specified by:
dropPartitionin interfaceCleanerClient- Parameters:
databaseName-tableName-partitionName- expected format: "event_date=2020-01-01/event_hour=0/event_type=A"
-
tableExists
public boolean tableExists(java.lang.String databaseName, java.lang.String tableName)- Specified by:
tableExistsin interfaceCleanerClient
-
getTableProperties
public java.util.Map<java.lang.String,java.lang.String> getTableProperties(java.lang.String databaseName, java.lang.String tableName)- Specified by:
getTablePropertiesin interfaceCleanerClient
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-