use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.
the class DbNotificationListener method onInsert.
@Override
public void onInsert(InsertEvent insertEvent) throws MetaException {
Table tableObj = insertEvent.getTableObj();
NotificationEvent event = new NotificationEvent(0, now(), EventType.INSERT.toString(), msgFactory.buildInsertMessage(tableObj, insertEvent.getPartitionObj(), insertEvent.isReplace(), new FileChksumIterator(insertEvent.getFiles(), insertEvent.getFileChecksums())).toString());
event.setDbName(tableObj.getDbName());
event.setTableName(tableObj.getTableName());
process(event, insertEvent);
}
use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.
the class DbNotificationListener method onDropPartition.
/**
* @param partitionEvent partition event
* @throws MetaException
*/
@Override
public void onDropPartition(DropPartitionEvent partitionEvent) throws MetaException {
Table t = partitionEvent.getTable();
NotificationEvent event = new NotificationEvent(0, now(), EventType.DROP_PARTITION.toString(), msgFactory.buildDropPartitionMessage(t, partitionEvent.getPartitionIterator()).toString());
event.setDbName(t.getDbName());
event.setTableName(t.getTableName());
process(event, partitionEvent);
}
use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.
the class DbNotificationListener method onCreateTable.
/**
* @param tableEvent table event.
* @throws MetaException
*/
@Override
public void onCreateTable(CreateTableEvent tableEvent) throws MetaException {
Table t = tableEvent.getTable();
NotificationEvent event = new NotificationEvent(0, now(), EventType.CREATE_TABLE.toString(), msgFactory.buildCreateTableMessage(t, new FileIterator(t.getSd().getLocation())).toString());
event.setDbName(t.getDbName());
event.setTableName(t.getTableName());
process(event, tableEvent);
}
use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.
the class DbNotificationListener method onCreateFunction.
/**
* @param fnEvent function event
* @throws MetaException
*/
@Override
public void onCreateFunction(CreateFunctionEvent fnEvent) throws MetaException {
Function fn = fnEvent.getFunction();
NotificationEvent event = new NotificationEvent(0, now(), EventType.CREATE_FUNCTION.toString(), msgFactory.buildCreateFunctionMessage(fn).toString());
event.setDbName(fn.getDbName());
process(event, fnEvent);
}
use of org.apache.hadoop.hive.metastore.api.NotificationEvent in project hive by apache.
the class DbNotificationListener method onAddPrimaryKey.
/**
* @param addPrimaryKeyEvent add primary key event
* @throws MetaException
*/
@Override
public void onAddPrimaryKey(AddPrimaryKeyEvent addPrimaryKeyEvent) throws MetaException {
List<SQLPrimaryKey> cols = addPrimaryKeyEvent.getPrimaryKeyCols();
if (cols.size() > 0) {
NotificationEvent event = new NotificationEvent(0, now(), EventType.ADD_PRIMARYKEY.toString(), msgFactory.buildAddPrimaryKeyMessage(addPrimaryKeyEvent.getPrimaryKeyCols()).toString());
event.setDbName(cols.get(0).getTable_db());
event.setTableName(cols.get(0).getTable_name());
process(event, addPrimaryKeyEvent);
}
}
Aggregations