|
||||||||||
| 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.TableEventHandler
org.apache.hadoop.hbase.master.snapshot.RestoreSnapshotHandler
@InterfaceAudience.Private public class RestoreSnapshotHandler
Handler to Restore a snapshot.
Uses RestoreSnapshotHelper to replace the table content with the
data available in the 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.TableEventHandler |
|---|
masterServices, tableLock, tableName |
| Fields inherited from class org.apache.hadoop.hbase.executor.EventHandler |
|---|
eventType, seqids, server, waitingTimeForEvents |
| Constructor Summary | |
|---|---|
RestoreSnapshotHandler(MasterServices masterServices,
HBaseProtos.SnapshotDescription snapshot,
HTableDescriptor htd,
MetricsMaster metricsMaster)
|
|
| Method Summary | |
|---|---|
void |
cancel(String why)
Actively cancel a running snapshot. |
protected void |
completed(Throwable exception)
Called after that process() is completed. |
long |
getCompletionTimestamp()
|
ForeignException |
getExceptionIfFailed()
Get the exception that caused the snapshot to fail, if the snapshot has failed. |
HBaseProtos.SnapshotDescription |
getSnapshot()
|
protected void |
handleTableOperation(List<HRegionInfo> hris)
The restore table is executed in place. |
boolean |
isFinished()
Check to see if the snapshot is finished, where finished may be success or failure. |
RestoreSnapshotHandler |
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. |
void |
rethrowExceptionIfFailed()
Rethrow the exception returned by SnapshotSentinel.getExceptionIfFailed(). |
| Methods inherited from class org.apache.hadoop.hbase.master.handler.TableEventHandler |
|---|
getTableDescriptor, prepareWithTableLock, process, releaseTableLock, reOpenAllRegions |
| Methods inherited from class org.apache.hadoop.hbase.executor.EventHandler |
|---|
compareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, run, setListener, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RestoreSnapshotHandler(MasterServices masterServices,
HBaseProtos.SnapshotDescription snapshot,
HTableDescriptor htd,
MetricsMaster metricsMaster)
throws IOException
IOException| Method Detail |
|---|
public RestoreSnapshotHandler prepare()
throws IOException
EventHandler
prepare in class TableEventHandlerIOException
protected void handleTableOperation(List<HRegionInfo> hris)
throws IOException
handleTableOperation in class TableEventHandlerIOExceptionprotected void completed(Throwable exception)
TableEventHandler
completed in class TableEventHandlerexception - null if process() is successful or not null if something has failed.public boolean isFinished()
SnapshotSentinel
isFinished in interface SnapshotSentinelpublic long getCompletionTimestamp()
getCompletionTimestamp in interface SnapshotSentinelpublic HBaseProtos.SnapshotDescription getSnapshot()
getSnapshot in interface SnapshotSentinelpublic void cancel(String why)
SnapshotSentinel
cancel in interface SnapshotSentinelwhy - Reason for cancellation.public ForeignException getExceptionIfFailed()
SnapshotSentinel
getExceptionIfFailed in interface SnapshotSentinelForeignException that caused the snapshot to fail, or null if the
snapshot is still in progress or has succeeded
public void rethrowExceptionIfFailed()
throws ForeignException
SnapshotSentinelSnapshotSentinel.getExceptionIfFailed().
If there is no exception this is a no-op.
rethrowExceptionIfFailed in interface SnapshotSentinelForeignException - all exceptions from remote sources are procedure exceptions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||