|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.executor.EventHandler
org.apache.hadoop.hbase.master.handler.CreateTableHandler
org.apache.hadoop.hbase.master.snapshot.CloneSnapshotHandler
@InterfaceAudience.Private public class CloneSnapshotHandler
Handler to Clone a snapshot.
Uses RestoreSnapshotHelper
to create a new table with the same
content of the specified snapshot.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.executor.EventHandler |
---|
EventHandler.EventHandlerListener |
Field Summary |
---|
Fields inherited from class org.apache.hadoop.hbase.master.handler.CreateTableHandler |
---|
conf, fileSystemManager, hTableDescriptor |
Fields inherited from class org.apache.hadoop.hbase.executor.EventHandler |
---|
eventType, seqids, server, waitingTimeForEvents |
Constructor Summary | |
---|---|
CloneSnapshotHandler(MasterServices masterServices,
HBaseProtos.SnapshotDescription snapshot,
HTableDescriptor hTableDescriptor)
|
Method Summary | |
---|---|
void |
cancel(String why)
Actively cancel a running snapshot. |
protected void |
completed(Throwable exception)
Called after that process() is completed. |
ForeignException |
getExceptionIfFailed()
Get the exception that caused the snapshot to fail, if the snapshot has failed. |
HBaseProtos.SnapshotDescription |
getSnapshot()
|
protected List<HRegionInfo> |
handleCreateHdfsRegions(org.apache.hadoop.fs.Path tableRootDir,
String tableName)
Create the on-disk regions, using the tableRootDir provided by the CreateTableHandler. |
boolean |
isFinished()
Check to see if the snapshot is finished, where finished may be success or failure. |
CloneSnapshotHandler |
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. |
Methods inherited from class org.apache.hadoop.hbase.master.handler.CreateTableHandler |
---|
process, toString |
Methods inherited from class org.apache.hadoop.hbase.executor.EventHandler |
---|
compareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, run, setListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CloneSnapshotHandler(MasterServices masterServices, HBaseProtos.SnapshotDescription snapshot, HTableDescriptor hTableDescriptor) throws NotAllMetaRegionsOnlineException, TableExistsException, IOException
NotAllMetaRegionsOnlineException
TableExistsException
IOException
Method Detail |
---|
public CloneSnapshotHandler prepare() throws NotAllMetaRegionsOnlineException, TableExistsException, IOException
EventHandler
prepare
in class CreateTableHandler
NotAllMetaRegionsOnlineException
TableExistsException
IOException
protected List<HRegionInfo> handleCreateHdfsRegions(org.apache.hadoop.fs.Path tableRootDir, String tableName) throws IOException
handleCreateHdfsRegions
in class CreateTableHandler
tableRootDir
- directory where the table is being createdtableName
- name of the table under construction
IOException
protected void completed(Throwable exception)
CreateTableHandler
completed
in class CreateTableHandler
exception
- null if process() is successful or not null if something has failed.public boolean isFinished()
SnapshotSentinel
isFinished
in interface SnapshotSentinel
public HBaseProtos.SnapshotDescription getSnapshot()
getSnapshot
in interface SnapshotSentinel
public void cancel(String why)
SnapshotSentinel
cancel
in interface SnapshotSentinel
why
- Reason for cancellation.public ForeignException getExceptionIfFailed()
SnapshotSentinel
getExceptionIfFailed
in interface SnapshotSentinel
ForeignException
that caused the snapshot to fail, or null if the
snapshot is still in progress or has succeeded
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |