org.apache.hadoop.hive.metastore
Interface HiveMetaHook


public interface HiveMetaHook

HiveMetaHook defines notification methods which are invoked as part of transactions against the metastore, allowing external catalogs such as HBase to be kept in sync with Hive's metastore.

Implementations can use MetaStoreUtils.isExternalTable(org.apache.hadoop.hive.metastore.api.Table) to distinguish external tables from managed tables.


Method Summary
 void commitCreateTable(Table table)
          Called after successfully adding a new table definition to the metastore during CREATE TABLE.
 void commitDropTable(Table table, boolean deleteData)
          Called after successfully removing a table definition from the metastore during DROP TABLE.
 void preCreateTable(Table table)
          Called before a new table definition is added to the metastore during CREATE TABLE.
 void preDropTable(Table table)
          Called before a table definition is removed from the metastore during DROP TABLE.
 void rollbackCreateTable(Table table)
          Called after failure adding a new table definition to the metastore during CREATE TABLE.
 void rollbackDropTable(Table table)
          Called after failure removing a table definition from the metastore during DROP TABLE.
 

Method Detail

preCreateTable

void preCreateTable(Table table)
                    throws MetaException
Called before a new table definition is added to the metastore during CREATE TABLE.

Parameters:
table - new table definition
Throws:
MetaException

rollbackCreateTable

void rollbackCreateTable(Table table)
                         throws MetaException
Called after failure adding a new table definition to the metastore during CREATE TABLE.

Parameters:
table - new table definition
Throws:
MetaException

commitCreateTable

void commitCreateTable(Table table)
                       throws MetaException
Called after successfully adding a new table definition to the metastore during CREATE TABLE.

Parameters:
table - new table definition
Throws:
MetaException

preDropTable

void preDropTable(Table table)
                  throws MetaException
Called before a table definition is removed from the metastore during DROP TABLE.

Parameters:
table - table definition
Throws:
MetaException

rollbackDropTable

void rollbackDropTable(Table table)
                       throws MetaException
Called after failure removing a table definition from the metastore during DROP TABLE.

Parameters:
table - table definition
Throws:
MetaException

commitDropTable

void commitDropTable(Table table,
                     boolean deleteData)
                     throws MetaException
Called after successfully removing a table definition from the metastore during DROP TABLE.

Parameters:
table - table definition
deleteData - whether to delete data as well; this should typically be ignored in the case of an external table
Throws:
MetaException


Copyright © 2013 The Apache Software Foundation