@InterfaceAudience.Private public abstract class TakeSnapshotHandler extends EventHandler implements SnapshotSentinel, ForeignExceptionSnare
snapshotRegions(List) call should get implemented for each snapshot flavor.| 限定符和类型 | 字段和说明 |
|---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.fs.FileSystem |
fs |
protected TableDescriptor |
htd |
protected MasterServices |
master |
protected MetricsSnapshot |
metricsSnapshot |
protected ForeignExceptionDispatcher |
monitor |
protected org.apache.hadoop.fs.Path |
rootDir |
protected org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription |
snapshot |
protected SnapshotManager |
snapshotManager |
protected SnapshotManifest |
snapshotManifest |
protected TableName |
snapshotTable |
protected MonitoredTask |
status |
protected org.apache.hadoop.fs.Path |
workingDir |
eventType, seqids, server, waitingTimeForEvents| 构造器和说明 |
|---|
TakeSnapshotHandler(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot,
MasterServices masterServices,
SnapshotManager snapshotManager) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel(String why)
Actively cancel a running snapshot.
|
void |
completeSnapshot(org.apache.hadoop.fs.Path snapshotDir,
org.apache.hadoop.fs.Path workingDir,
org.apache.hadoop.fs.FileSystem fs)
Reset the manager to allow another snapshot to proceed
|
protected abstract boolean |
downgradeToSharedTableLock()
When taking snapshot, first we must acquire the exclusive table lock to confirm that there are
no ongoing merge/split procedures.
|
long |
getCompletionTimestamp() |
ForeignException |
getException()
Get the value of the captured exception.
|
ForeignException |
getExceptionIfFailed()
Get the exception that caused the snapshot to fail, if the snapshot has failed.
|
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription |
getSnapshot() |
boolean |
hasException()
Non-exceptional form of
ForeignExceptionSnare.rethrowException(). |
boolean |
isFinished()
Check to see if the snapshot is finished, where finished may be success or failure.
|
TakeSnapshotHandler |
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 |
process()
Execute the core common portions of taking a snapshot.
|
void |
rethrowException()
Rethrow an exception currently held by the
ForeignExceptionSnare. |
void |
rethrowExceptionIfFailed()
Rethrow the exception returned by
SnapshotSentinel.getExceptionIfFailed(). |
protected void |
snapshotDisabledRegion(RegionInfo regionInfo)
Take a snapshot of the specified disabled region
|
protected abstract void |
snapshotRegions(List<Pair<RegionInfo,ServerName>> regions)
Snapshot the specified regions
|
compareTo, getEventType, getInformativeName, getPriority, getSeqid, handleException, run, toStringprotected final MasterServices master
protected final MetricsSnapshot metricsSnapshot
protected final org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot
protected final org.apache.hadoop.conf.Configuration conf
protected final org.apache.hadoop.fs.FileSystem fs
protected final org.apache.hadoop.fs.Path rootDir
protected final org.apache.hadoop.fs.Path workingDir
protected final ForeignExceptionDispatcher monitor
protected final MonitoredTask status
protected final TableName snapshotTable
protected final SnapshotManifest snapshotManifest
protected final SnapshotManager snapshotManager
protected TableDescriptor htd
public TakeSnapshotHandler(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, MasterServices masterServices, SnapshotManager snapshotManager)
snapshot - descriptor of the snapshot to takemasterServices - master services providerpublic TakeSnapshotHandler prepare() throws Exception
EventHandlerprepare 在类中 EventHandlerException - when something goes wrongpublic void process()
snapshotRegions(List)
call should get implemented for each snapshot flavor.process 在类中 EventHandlerpublic void completeSnapshot(org.apache.hadoop.fs.Path snapshotDir,
org.apache.hadoop.fs.Path workingDir,
org.apache.hadoop.fs.FileSystem fs)
throws SnapshotCreationException,
IOException
snapshotDir - final path of the snapshotworkingDir - directory where the in progress snapshot was builtfs - FileSystem where the snapshot was builtSnapshotCreationException - if the snapshot could not be movedIOException - the filesystem could not be reachedprotected abstract boolean downgradeToSharedTableLock()
protected abstract void snapshotRegions(List<Pair<RegionInfo,ServerName>> regions) throws IOException, org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionprotected void snapshotDisabledRegion(RegionInfo regionInfo) throws IOException
IOExceptionpublic void cancel(String why)
SnapshotSentinelcancel 在接口中 SnapshotSentinelwhy - Reason for cancellation.public boolean isFinished()
SnapshotSentinelisFinished 在接口中 SnapshotSentinelpublic long getCompletionTimestamp()
getCompletionTimestamp 在接口中 SnapshotSentinelpublic org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription getSnapshot()
getSnapshot 在接口中 SnapshotSentinelpublic 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 exceptionspublic void rethrowException()
throws ForeignException
ForeignExceptionSnareForeignExceptionSnare. If there is
no exception this is a no-oprethrowException 在接口中 ForeignExceptionSnareForeignException - all exceptions from remote sources are procedure exceptionspublic boolean hasException()
ForeignExceptionSnareForeignExceptionSnare.rethrowException(). Checks to see if any
process to which the exception checkers is bound has created an error that
would cause a failure.hasException 在接口中 ForeignExceptionSnarepublic ForeignException getException()
ForeignExceptionSnaregetException 在接口中 ForeignExceptionSnareCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.