org.apache.hadoop.hbase.master.handler
Class TableEventHandler
java.lang.Object
org.apache.hadoop.hbase.executor.EventHandler
org.apache.hadoop.hbase.master.handler.TableEventHandler
- All Implemented Interfaces:
- Comparable<Runnable>, Runnable
- Direct Known Subclasses:
- DeleteTableHandler, ModifyTableHandler, RestoreSnapshotHandler, TableAddFamilyHandler, TableDeleteFamilyHandler, TableModifyFamilyHandler
public abstract class TableEventHandler
- extends EventHandler
Base class for performing operations against tables.
Checks on whether the process can go forward are done in constructor rather
than later on in 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).
masterServices
protected final MasterServices masterServices
tableName
protected final byte[] tableName
tableNameStr
protected final String tableNameStr
isEventBeingHandled
protected boolean isEventBeingHandled
TableEventHandler
public TableEventHandler(EventHandler.EventType eventType,
byte[] tableName,
Server server,
MasterServices masterServices)
throws IOException
- Throws:
IOException
process
public void process()
- Description copied from class:
EventHandler
- This method is the main processing loop to be implemented by the various
subclasses.
- Specified by:
process
in class EventHandler
completed
protected void completed(Throwable exception)
- Called after that process() is completed.
- Parameters:
exception
- null if process() is successful or not null if something has failed.
reOpenAllRegions
public boolean reOpenAllRegions(List<HRegionInfo> regions)
throws IOException
- Throws:
IOException
getTableDescriptor
public HTableDescriptor getTableDescriptor()
throws FileNotFoundException,
IOException
- Gets a TableDescriptor from the masterServices. Can Throw exceptions.
- Returns:
- Table descriptor for this table
- Throws:
TableExistsException
FileNotFoundException
IOException
handleTableOperation
protected abstract void handleTableOperation(List<HRegionInfo> regions)
throws IOException,
org.apache.zookeeper.KeeperException
- Throws:
IOException
org.apache.zookeeper.KeeperException
waitForEventBeingHandled
public void waitForEventBeingHandled()
throws IOException
- Table modifications are processed asynchronously, but provide an API for you to query their
status.
- Throws:
IOException
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.