@InterfaceAudience.Private public class RestoreSnapshotHandler extends TableEventHandler implements SnapshotSentinel
Uses RestoreSnapshotHelper to replace the table content with the
data available in the snapshot.
EventHandler.EventHandlerListenermasterServices, tableLock, tableNameeventType, seqids, server, waitingTimeForEvents| 构造器和说明 |
|---|
RestoreSnapshotHandler(MasterServices masterServices,
org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot,
HTableDescriptor htd,
boolean restoreAcl) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
org.apache.hadoop.hbase.protobuf.generated.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(). |
getTableDescriptor, prepareWithTableLock, process, releaseTableLock, reOpenAllRegionscompareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, handleException, run, setListener, toStringpublic RestoreSnapshotHandler(MasterServices masterServices, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot, HTableDescriptor htd, boolean restoreAcl) throws IOException
IOExceptionpublic RestoreSnapshotHandler prepare() throws IOException
EventHandlerprepare 在类中 TableEventHandlerIOExceptionprotected void handleTableOperation(List<HRegionInfo> hris) throws IOException
handleTableOperation 在类中 TableEventHandlerIOExceptionprotected void completed(Throwable exception)
TableEventHandlercompleted 在类中 TableEventHandlerexception - null if process() is successful or not null if something has failed.public boolean isFinished()
SnapshotSentinelisFinished 在接口中 SnapshotSentinelpublic long getCompletionTimestamp()
getCompletionTimestamp 在接口中 SnapshotSentinelpublic org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription getSnapshot()
getSnapshot 在接口中 SnapshotSentinelpublic void cancel(String why)
SnapshotSentinelcancel 在接口中 SnapshotSentinelwhy - Reason for cancellation.public ForeignException getExceptionIfFailed()
SnapshotSentinelgetExceptionIfFailed 在接口中 SnapshotSentinelForeignException that caused the snapshot to fail, or null if the
snapshot is still in progress or has succeededpublic void rethrowExceptionIfFailed()
throws ForeignException
SnapshotSentinelSnapshotSentinel.getExceptionIfFailed().
If there is no exception this is a no-op.rethrowExceptionIfFailed 在接口中 SnapshotSentinelForeignException - all exceptions from remote sources are procedure exceptionsCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.