|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.executor.HBaseEventHandler
public abstract class HBaseEventHandler
Abstract base class for all HBase event handlers. Subclasses should implement the process() method where the actual handling of the event happens. HBaseEventType is a list of ALL events (which also corresponds to messages - either internal to one component or between components). The event type names specify the component from which the event originated, and the component which is supposed to handle it. Listeners can listen to all the events by implementing the interface HBaseEventHandlerListener, and by registering themselves as a listener. They will be called back before and after the process of every event. TODO: Rename HBaseEvent and HBaseEventType to EventHandler and EventType after ZK refactor as it currently would clash with EventType from ZK and make the code very confusing.
Nested Class Summary | |
---|---|
static interface |
HBaseEventHandler.HBaseEventHandlerListener
This interface provides hooks to listen to various events received by the queue. |
static class |
HBaseEventHandler.HBaseEventType
These are a list of HBase events that can be handled by the various HBaseExecutorService's. |
Field Summary | |
---|---|
protected static List<HBaseEventHandler.HBaseEventHandlerListener> |
eventHandlerListeners
|
protected HBaseEventHandler.HBaseEventType |
eventType
|
protected boolean |
isRegionServer
|
protected String |
serverName
|
Constructor Summary | |
---|---|
HBaseEventHandler(boolean isRegionServer,
String serverName,
HBaseEventHandler.HBaseEventType eventType)
Default base class constructor. |
Method Summary | |
---|---|
void |
execute()
Executes this event object in the caller's thread. |
HBaseExecutorService.HBaseExecutorServiceType |
getEventHandlerName()
Return the name for this event type. |
HBaseEventHandler.HBaseEventType |
getHBEvent()
Return the event type |
boolean |
isRegionServer()
|
abstract void |
process()
This method is the main processing loop to be implemented by the various subclasses. |
static void |
registerListener(HBaseEventHandler.HBaseEventHandlerListener listener)
Subscribe to updates before and after processing events |
void |
run()
This is a wrapper around process, used to update listeners before and after events are processed. |
void |
submit()
Submits this event object to the correct executor service. |
static void |
unregisterListener(HBaseEventHandler.HBaseEventHandlerListener listener)
Stop receiving updates before and after processing events |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HBaseEventHandler.HBaseEventType eventType
protected boolean isRegionServer
protected String serverName
protected static List<HBaseEventHandler.HBaseEventHandlerListener> eventHandlerListeners
Constructor Detail |
---|
public HBaseEventHandler(boolean isRegionServer, String serverName, HBaseEventHandler.HBaseEventType eventType)
Method Detail |
---|
public void run()
run
in interface Runnable
public abstract void process()
public static void registerListener(HBaseEventHandler.HBaseEventHandlerListener listener)
public static void unregisterListener(HBaseEventHandler.HBaseEventHandlerListener listener)
public boolean isRegionServer()
public HBaseExecutorService.HBaseExecutorServiceType getEventHandlerName()
public HBaseEventHandler.HBaseEventType getHBEvent()
public void submit()
public void execute()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |