|
||||||||||
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.snapshot.TakeSnapshotHandler
@InterfaceAudience.Private public abstract class TakeSnapshotHandler
A handler for taking snapshots from the master.
This is not a subclass of TableEventHandler because using that would incur an extra META scan.
The snapshotRegions(List)
call should get implemented for each snapshot flavor.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.executor.EventHandler |
---|
EventHandler.EventHandlerListener, EventHandler.EventType |
Field Summary | |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf
|
protected org.apache.hadoop.fs.FileSystem |
fs
|
protected MasterServices |
master
|
protected MasterMetrics |
metricsMaster
|
protected ForeignExceptionDispatcher |
monitor
|
protected org.apache.hadoop.fs.Path |
rootDir
|
protected HBaseProtos.SnapshotDescription |
snapshot
|
protected MonitoredTask |
status
|
protected org.apache.hadoop.fs.Path |
workingDir
|
Fields inherited from class org.apache.hadoop.hbase.executor.EventHandler |
---|
eventType, seqids, server, waitingTimeForEvents |
Constructor Summary | |
---|---|
TakeSnapshotHandler(HBaseProtos.SnapshotDescription snapshot,
MasterServices masterServices,
MasterMetrics metricsMaster)
|
Method Summary | |
---|---|
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 |
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. |
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. |
void |
process()
Execute the core common portions of taking a snapshot. |
void |
rethrowException()
Rethrow an exception currently held by the ForeignExceptionSnare . |
protected abstract void |
snapshotRegions(List<Pair<HRegionInfo,ServerName>> regions)
Snapshot the specified regions |
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 |
Field Detail |
---|
protected final MasterServices master
protected final MasterMetrics metricsMaster
protected final HBaseProtos.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
Constructor Detail |
---|
public TakeSnapshotHandler(HBaseProtos.SnapshotDescription snapshot, MasterServices masterServices, MasterMetrics metricsMaster) throws IOException
snapshot
- descriptor of the snapshot to takemasterServices
- master services provider
IOException
- on unexpected errorMethod Detail |
---|
public void process()
snapshotRegions(List)
call should get implemented for each snapshot flavor.
process
in class EventHandler
public 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 built
SnapshotCreationException
- if the snapshot could not be moved
IOException
- the filesystem could not be reachedprotected abstract void snapshotRegions(List<Pair<HRegionInfo,ServerName>> regions) throws IOException, org.apache.zookeeper.KeeperException
IOException
org.apache.zookeeper.KeeperException
public void cancel(String why)
SnapshotSentinel
cancel
in interface SnapshotSentinel
why
- Reason for cancellation.public boolean isFinished()
SnapshotSentinel
isFinished
in interface SnapshotSentinel
public HBaseProtos.SnapshotDescription getSnapshot()
getSnapshot
in interface SnapshotSentinel
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 succeededpublic void rethrowException() throws ForeignException
ForeignExceptionSnare
ForeignExceptionSnare
. If there is
no exception this is a no-op
rethrowException
in interface ForeignExceptionSnare
ForeignException
- all exceptions from remote sources are procedure exceptionspublic boolean hasException()
ForeignExceptionSnare
ForeignExceptionSnare.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 ForeignExceptionSnare
public ForeignException getException()
ForeignExceptionSnare
getException
in interface ForeignExceptionSnare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |