org.apache.hadoop.hbase.snapshot
Class SnapshotTask

java.lang.Object
  extended by org.apache.hadoop.hbase.snapshot.SnapshotTask
All Implemented Interfaces:
Callable<Void>, ForeignExceptionSnare
Direct Known Subclasses:
CopyRecoveredEditsTask, ReferenceRegionHFilesTask, ReferenceServerWALsTask, TableInfoCopyTask

@InterfaceAudience.Private
public abstract class SnapshotTask
extends Object
implements ForeignExceptionSnare, Callable<Void>

General snapshot operation taken on a regionserver


Field Summary
protected  ForeignExceptionDispatcher errorMonitor
           
protected  HBaseProtos.SnapshotDescription snapshot
           
 
Constructor Summary
SnapshotTask(HBaseProtos.SnapshotDescription snapshot, ForeignExceptionDispatcher monitor)
           
 
Method Summary
 ForeignException getException()
          Get the value of the captured exception.
 boolean hasException()
          Non-exceptional form of ForeignExceptionSnare.rethrowException().
 void rethrowException()
          Rethrow an exception currently held by the ForeignExceptionSnare.
 void snapshotFailure(String message, Exception e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Callable
call
 

Field Detail

snapshot

protected final HBaseProtos.SnapshotDescription snapshot

errorMonitor

protected final ForeignExceptionDispatcher errorMonitor
Constructor Detail

SnapshotTask

public SnapshotTask(HBaseProtos.SnapshotDescription snapshot,
                    ForeignExceptionDispatcher monitor)
Parameters:
snapshot - Description of the snapshot we are going to operate on
monitor - listener interested in failures to the snapshot caused by this operation
Method Detail

snapshotFailure

public void snapshotFailure(String message,
                            Exception e)

rethrowException

public void rethrowException()
                      throws ForeignException
Description copied from interface: ForeignExceptionSnare
Rethrow an exception currently held by the ForeignExceptionSnare. If there is no exception this is a no-op

Specified by:
rethrowException in interface ForeignExceptionSnare
Throws:
ForeignException - all exceptions from remote sources are procedure exceptions

hasException

public boolean hasException()
Description copied from interface: ForeignExceptionSnare
Non-exceptional form of ForeignExceptionSnare.rethrowException(). Checks to see if any process to which the exception checkers is bound has created an error that would cause a failure.

Specified by:
hasException in interface ForeignExceptionSnare
Returns:
true if there has been an error,false otherwise

getException

public ForeignException getException()
Description copied from interface: ForeignExceptionSnare
Get the value of the captured exception.

Specified by:
getException in interface ForeignExceptionSnare
Returns:
the captured foreign exception or null if no exception captured.


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.