@InterfaceAudience.Private public abstract class TakeSnapshotHandler extends EventHandler implements SnapshotSentinel, ForeignExceptionSnare
snapshotRegions(List) call should get implemented for each snapshot flavor.EventHandler.EventHandlerListener| Modifier and Type | Field and Description | 
|---|---|
| protected org.apache.hadoop.conf.Configuration | conf | 
| protected HTableDescriptor | htd | 
| protected MasterServices | master | 
| protected MetricsSnapshot | metricsSnapshot | 
| protected ForeignExceptionDispatcher | monitor | 
| protected org.apache.hadoop.fs.Path | rootDir | 
| protected org.apache.hadoop.fs.FileSystem | rootFs | 
| protected org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription | snapshot | 
| protected SnapshotManager | snapshotManager | 
| protected SnapshotManifest | snapshotManifest | 
| protected TableName | snapshotTable | 
| protected MonitoredTask | status | 
| protected TableLockManager.TableLock | tableLock | 
| protected TableLockManager | tableLockManager | 
| protected org.apache.hadoop.fs.Path | workingDir | 
| protected org.apache.hadoop.fs.FileSystem | workingDirFs | 
eventType, seqids, server, waitingTimeForEvents| Constructor and Description | 
|---|
| TakeSnapshotHandler(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot,
                   MasterServices masterServices,
                   SnapshotManager snapshotManager) | 
| Modifier and Type | Method and Description | 
|---|---|
| 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,
                org.apache.hadoop.fs.FileSystem workingDirFs)Reset the manager to allow another snapshot to proceed. | 
| 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.protobuf.generated.HBaseProtos.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. | 
| protected void | releaseTableLock() | 
| void | rethrowException()Rethrow an exception currently held by the  ForeignExceptionSnare. | 
| void | rethrowExceptionIfFailed()Rethrow the exception returned by  SnapshotSentinel.getExceptionIfFailed(). | 
| protected void | snapshotDisabledRegion(HRegionInfo regionInfo)Take a snapshot of the specified disabled region | 
| protected abstract void | snapshotRegions(List<Pair<HRegionInfo,ServerName>> regions)Snapshot the specified regions | 
compareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, handleException, run, setListener, toStringprotected final MasterServices master
protected final MetricsSnapshot metricsSnapshot
protected final org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot
protected final org.apache.hadoop.conf.Configuration conf
protected final org.apache.hadoop.fs.FileSystem rootFs
protected final org.apache.hadoop.fs.FileSystem workingDirFs
protected final org.apache.hadoop.fs.Path rootDir
protected final org.apache.hadoop.fs.Path workingDir
protected final ForeignExceptionDispatcher monitor
protected final TableLockManager tableLockManager
protected final TableLockManager.TableLock tableLock
protected final MonitoredTask status
protected final TableName snapshotTable
protected final SnapshotManifest snapshotManifest
protected final SnapshotManager snapshotManager
protected HTableDescriptor htd
public TakeSnapshotHandler(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot,
                   MasterServices masterServices,
                   SnapshotManager snapshotManager)
                    throws IOException
snapshot - descriptor of the snapshot to takemasterServices - master services providerIllegalArgumentException - if the working snapshot directory set from the
   configuration is the same as the completed snapshot directoryIOException - if the file system of the working snapshot directory cannot be
   determinedpublic TakeSnapshotHandler prepare() throws Exception
EventHandlerprepare in class EventHandlerException - when something goes wrongpublic void process()
snapshotRegions(List)
 call should get implemented for each snapshot flavor.process in class EventHandlerprotected void releaseTableLock()
public void completeSnapshot(org.apache.hadoop.fs.Path snapshotDir,
                    org.apache.hadoop.fs.Path workingDir,
                    org.apache.hadoop.fs.FileSystem fs,
                    org.apache.hadoop.fs.FileSystem workingDirFs)
                      throws SnapshotCreationException,
                             IOException
snapshotDir - The file path of the completed snapshotsworkingDir - The file path of the in progress snapshotsfs - The file system of the completed snapshotsworkingDirFs - The file system of the in progress snapshotsSnapshotCreationException - if the snapshot could not be movedIOException - the filesystem could not be reachedprotected abstract void snapshotRegions(List<Pair<HRegionInfo,ServerName>> regions) throws IOException, org.apache.zookeeper.KeeperException
IOExceptionorg.apache.zookeeper.KeeperExceptionprotected void snapshotDisabledRegion(HRegionInfo regionInfo) throws IOException
IOExceptionpublic void cancel(String why)
SnapshotSentinelcancel in interface SnapshotSentinelwhy - Reason for cancellation.public boolean isFinished()
SnapshotSentinelisFinished in interface SnapshotSentinelpublic long getCompletionTimestamp()
getCompletionTimestamp in interface SnapshotSentinelpublic org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription getSnapshot()
getSnapshot in interface SnapshotSentinelpublic ForeignException getExceptionIfFailed()
SnapshotSentinelgetExceptionIfFailed in interface 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 in interface SnapshotSentinelForeignException - all exceptions from remote sources are procedure exceptionspublic void rethrowException()
                      throws ForeignException
ForeignExceptionSnareForeignExceptionSnare. If there is
 no exception this is a no-oprethrowException in interface 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 in interface ForeignExceptionSnarepublic ForeignException getException()
ForeignExceptionSnaregetException in interface ForeignExceptionSnareCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.