@InterfaceAudience.Private public abstract class TableEventHandler extends EventHandler
process(). The idea is to fail fast rather than
later down in an async invocation of process() (which currently has
no means of reporting back issues once started).EventHandler.EventHandlerListener| Modifier and Type | Field and Description |
|---|---|
protected MasterServices |
masterServices |
protected TableLockManager.TableLock |
tableLock |
protected TableName |
tableName |
eventType, seqids, server, waitingTimeForEvents| Constructor and Description |
|---|
TableEventHandler(EventType eventType,
TableName tableName,
Server server,
MasterServices masterServices) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
completed(Throwable exception)
Called after that process() is completed.
|
HTableDescriptor |
getTableDescriptor()
Gets a TableDescriptor from the masterServices.
|
protected abstract void |
handleTableOperation(List<HRegionInfo> regions) |
TableEventHandler |
prepare()
Event handlers should do all the necessary checks in this method (rather than
in the constructor, or in process()) so that the caller, which is mostly executed
in the ipc context can fail fast.
|
protected void |
prepareWithTableLock()
Called from prepare() while holding the table lock.
|
void |
process()
This method is the main processing loop to be implemented by the various
subclasses.
|
protected void |
releaseTableLock() |
boolean |
reOpenAllRegions(List<HRegionInfo> regions) |
compareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, handleException, run, setListener, toStringprotected final MasterServices masterServices
protected final TableName tableName
protected TableLockManager.TableLock tableLock
public TableEventHandler(EventType eventType, TableName tableName, Server server, MasterServices masterServices)
public TableEventHandler prepare() throws IOException
EventHandlerprepare in class EventHandlerIOExceptionprotected void prepareWithTableLock()
throws IOException
IOExceptionpublic void process()
EventHandlerprocess in class EventHandlerprotected void releaseTableLock()
protected void completed(Throwable exception)
exception - null if process() is successful or not null if something has failed.public boolean reOpenAllRegions(List<HRegionInfo> regions) throws IOException
IOExceptionpublic HTableDescriptor getTableDescriptor() throws FileNotFoundException, IOException
TableExistsExceptionFileNotFoundExceptionIOExceptionprotected abstract void handleTableOperation(List<HRegionInfo> regions) throws IOException, org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionCopyright © 2014 The Apache Software Foundation. All rights reserved.