NotificationListener
insteadpublic class NotificationListener extends MetaStoreEventListener
MetaStoreEventListener
It sends
message on two type of topics. One has name of form dbName.tblName On this
topic, two kind of messages are sent: add/drop partition and
finalize_partition message. Second topic has name "HCAT" and messages sent on
it are: add/drop database and add/drop table. All messages also has a
property named "HCAT_EVENT" set on them whose value can be used to configure
message selector on subscriber side.Modifier and Type | Field and Description |
---|---|
protected javax.jms.Connection |
conn
Deprecated.
|
protected javax.jms.Session |
session
Deprecated.
|
Constructor and Description |
---|
NotificationListener(Configuration conf)
Deprecated.
Create message bus connection and session in constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createConnection()
Deprecated.
|
protected void |
finalize()
Deprecated.
|
protected javax.jms.Topic |
getTopic(java.lang.String topicName)
Deprecated.
Get the topic object for the topicName, it also tries to reconnect
if the connection appears to be broken.
|
void |
onAddPartition(AddPartitionEvent partitionEvent)
Deprecated.
|
void |
onAlterPartition(AlterPartitionEvent ape)
Deprecated.
|
void |
onAlterTable(AlterTableEvent ate)
Deprecated.
|
void |
onCreateDatabase(CreateDatabaseEvent dbEvent)
Deprecated.
|
void |
onCreateTable(CreateTableEvent tableEvent)
Deprecated.
|
void |
onDropDatabase(DropDatabaseEvent dbEvent)
Deprecated.
|
void |
onDropPartition(DropPartitionEvent partitionEvent)
Deprecated.
Send dropped partition notifications.
|
void |
onDropTable(DropTableEvent tableEvent)
Deprecated.
Send dropped table notifications.
|
void |
onLoadPartitionDone(LoadPartitionDoneEvent lpde)
Deprecated.
|
protected void |
send(HCatEventMessage hCatEventMessage,
java.lang.String topicName)
Deprecated.
|
getConf, setConf
protected javax.jms.Session session
protected javax.jms.Connection conn
public NotificationListener(Configuration conf)
public void onAddPartition(AddPartitionEvent partitionEvent) throws MetaException
onAddPartition
in class MetaStoreEventListener
MetaException
public void onDropPartition(DropPartitionEvent partitionEvent) throws MetaException
onDropPartition
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 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
protected void send(HCatEventMessage hCatEventMessage, java.lang.String topicName)
hCatEventMessage
- The HCatEventMessage being sent over JMS.topicName
- is the name on message broker on which message is sent.protected javax.jms.Topic getTopic(java.lang.String topicName) throws javax.jms.JMSException
topicName
- The String identifying the message-topic.Topic
object corresponding to the specified topicName.javax.jms.JMSException
protected void createConnection()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void onLoadPartitionDone(LoadPartitionDoneEvent lpde) throws MetaException
onLoadPartitionDone
in class MetaStoreEventListener
MetaException
public void onAlterPartition(AlterPartitionEvent ape) throws MetaException
onAlterPartition
in class MetaStoreEventListener
ape
- partition eventMetaException
public void onAlterTable(AlterTableEvent ate) throws MetaException
onAlterTable
in class MetaStoreEventListener
ate
- alter table eventMetaException
Copyright © 2012 The Apache Software Foundation