@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 |
---|---|
private boolean |
isPrepareCalled |
private static org.apache.commons.logging.Log |
LOG |
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) |
(package private) byte[] |
hasColumnFamily(HTableDescriptor htd,
byte[] cf) |
private boolean |
isOnlineSchemaChangeAllowed() |
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, toString
private static final org.apache.commons.logging.Log LOG
protected final MasterServices masterServices
protected final TableName tableName
protected TableLockManager.TableLock tableLock
private boolean isPrepareCalled
public TableEventHandler(EventType eventType, TableName tableName, Server server, MasterServices masterServices)
public TableEventHandler prepare() throws IOException
EventHandler
prepare
in class EventHandler
IOException
protected void prepareWithTableLock() throws IOException
IOException
private boolean isOnlineSchemaChangeAllowed()
public void process()
EventHandler
process
in class EventHandler
protected 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
IOException
public HTableDescriptor getTableDescriptor() throws FileNotFoundException, IOException
FileNotFoundException
IOException
byte[] hasColumnFamily(HTableDescriptor htd, byte[] cf) throws InvalidFamilyOperationException
InvalidFamilyOperationException
protected abstract void handleTableOperation(List<HRegionInfo> regions) throws IOException, CoordinatedStateException
IOException
CoordinatedStateException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.