public class DbNotificationListener extends MetaStoreEventListener
MetaStoreEventListener
that
stores events in the database.
Design overview: This listener takes any event, builds a NotificationEventResponse,
and puts it on a queue. There is a dedicated thread that reads entries from the queue and
places them in the database. The reason for doing it in a separate thread is that we want to
avoid slowing down other metadata operations with the work of putting the notification into
the database. Also, occasionally the thread needs to clean the database of old records. We
definitely don't want to do that as part of another metadata operation.Constructor and Description |
---|
DbNotificationListener(org.apache.hadoop.conf.Configuration config) |
Modifier and Type | Method and Description |
---|---|
void |
onAddIndex(AddIndexEvent indexEvent) |
void |
onAddPartition(AddPartitionEvent partitionEvent) |
void |
onAlterIndex(AlterIndexEvent indexEvent) |
void |
onAlterPartition(AlterPartitionEvent partitionEvent) |
void |
onAlterTable(AlterTableEvent tableEvent) |
void |
onConfigChange(ConfigChangeEvent tableEvent) |
void |
onCreateDatabase(CreateDatabaseEvent dbEvent) |
void |
onCreateFunction(CreateFunctionEvent fnEvent) |
void |
onCreateTable(CreateTableEvent tableEvent) |
void |
onDropDatabase(DropDatabaseEvent dbEvent) |
void |
onDropFunction(DropFunctionEvent fnEvent) |
void |
onDropIndex(DropIndexEvent indexEvent) |
void |
onDropPartition(DropPartitionEvent partitionEvent) |
void |
onDropTable(DropTableEvent tableEvent) |
void |
onInsert(InsertEvent insertEvent)
This will be called when an insert is executed that does not cause a partition to be added.
|
void |
onLoadPartitionDone(LoadPartitionDoneEvent partSetDoneEvent) |
getConf, setConf
public DbNotificationListener(org.apache.hadoop.conf.Configuration config)
public void onConfigChange(ConfigChangeEvent tableEvent) throws MetaException
onConfigChange
in class MetaStoreEventListener
tableEvent
- table event.MetaException
public void onCreateTable(CreateTableEvent tableEvent) throws MetaException
onCreateTable
in class MetaStoreEventListener
tableEvent
- table event.MetaException
public void onDropTable(DropTableEvent tableEvent) throws MetaException
onDropTable
in class MetaStoreEventListener
tableEvent
- table event.MetaException
public void onAlterTable(AlterTableEvent tableEvent) throws MetaException
onAlterTable
in class MetaStoreEventListener
tableEvent
- alter table eventMetaException
public void onAddPartition(AddPartitionEvent partitionEvent) throws MetaException
onAddPartition
in class MetaStoreEventListener
partitionEvent
- partition eventMetaException
public void onDropPartition(DropPartitionEvent partitionEvent) throws MetaException
onDropPartition
in class MetaStoreEventListener
partitionEvent
- partition eventMetaException
public void onAlterPartition(AlterPartitionEvent partitionEvent) throws MetaException
onAlterPartition
in class MetaStoreEventListener
partitionEvent
- partition eventMetaException
public void onCreateDatabase(CreateDatabaseEvent dbEvent) throws MetaException
onCreateDatabase
in class MetaStoreEventListener
dbEvent
- database eventMetaException
public void onDropDatabase(DropDatabaseEvent dbEvent) throws MetaException
onDropDatabase
in class MetaStoreEventListener
dbEvent
- database eventMetaException
public void onCreateFunction(CreateFunctionEvent fnEvent) throws MetaException
onCreateFunction
in class MetaStoreEventListener
fnEvent
- function eventMetaException
public void onDropFunction(DropFunctionEvent fnEvent) throws MetaException
onDropFunction
in class MetaStoreEventListener
fnEvent
- function eventMetaException
public void onAddIndex(AddIndexEvent indexEvent) throws MetaException
onAddIndex
in class MetaStoreEventListener
indexEvent
- index eventMetaException
public void onDropIndex(DropIndexEvent indexEvent) throws MetaException
onDropIndex
in class MetaStoreEventListener
indexEvent
- index eventMetaException
public void onAlterIndex(AlterIndexEvent indexEvent) throws MetaException
onAlterIndex
in class MetaStoreEventListener
indexEvent
- index eventMetaException
public void onInsert(InsertEvent insertEvent) throws MetaException
MetaStoreEventListener
MetaStoreEventListener.onAddPartition(org.apache.hadoop.hive.metastore.events.AddPartitionEvent)
to be
called instead.onInsert
in class MetaStoreEventListener
MetaException
public void onLoadPartitionDone(LoadPartitionDoneEvent partSetDoneEvent) throws MetaException
onLoadPartitionDone
in class MetaStoreEventListener
partSetDoneEvent
- MetaException
Copyright © 2017 The Apache Software Foundation. All rights reserved.