|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.master.snapshot.SnapshotManager
@InterfaceAudience.Private @InterfaceStability.Unstable public class SnapshotManager
This class manages the procedure of taking and restoring snapshots. There is only one SnapshotManager for the master.
The class provides methods for monitoring in-progress snapshot actions.
Note: Currently there can only be one snapshot being taken at a time over the cluster. This is a simplification in the current implementation.
Field Summary | |
---|---|
static String |
HBASE_SNAPSHOT_ENABLED
Enable or disable snapshot support |
static String |
ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION
Name of the operation to use in the controller |
Constructor Summary | |
---|---|
SnapshotManager(MasterServices master,
MetricsMaster metricsMaster)
Construct a snapshot manager. |
|
SnapshotManager(MasterServices master,
MetricsMaster metricsMaster,
ProcedureCoordinator coordinator,
ExecutorService pool)
Fully specify all necessary components of a snapshot manager. |
Method Summary | |
---|---|
void |
checkSnapshotSupport()
Throws an exception if snapshot operations (take a snapshot, restore, clone) are not supported. |
void |
deleteSnapshot(HBaseProtos.SnapshotDescription snapshot)
Delete the specified snapshot |
List<HBaseProtos.SnapshotDescription> |
getCompletedSnapshots()
Gets the list of all completed snapshots. |
boolean |
isRestoreDone(HBaseProtos.SnapshotDescription snapshot)
Returns the status of a restore operation. |
boolean |
isSnapshotDone(HBaseProtos.SnapshotDescription expected)
Check if the specified snapshot is done |
boolean |
isStopped()
|
void |
restoreSnapshot(HBaseProtos.SnapshotDescription reqSnapshot)
Restore the specified snapshot |
void |
setSnapshotHandlerForTesting(TableName tableName,
SnapshotSentinel handler)
Set the handler for the current snapshot |
void |
stop(String why)
Stop this service. |
void |
takeSnapshot(HBaseProtos.SnapshotDescription snapshot)
Take a snapshot based on the enabled/disabled state of the table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String HBASE_SNAPSHOT_ENABLED
public static final String ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION
Constructor Detail |
---|
public SnapshotManager(MasterServices master, MetricsMaster metricsMaster) throws org.apache.zookeeper.KeeperException, IOException, UnsupportedOperationException
master
-
org.apache.zookeeper.KeeperException
IOException
UnsupportedOperationException
public SnapshotManager(MasterServices master, MetricsMaster metricsMaster, ProcedureCoordinator coordinator, ExecutorService pool) throws IOException, UnsupportedOperationException
master
- services for the master where the manager is runningcoordinator
- procedure coordinator instance. exposed for testing.pool
- HBase ExecutorServcie instance, exposed for testing.
IOException
UnsupportedOperationException
Method Detail |
---|
public List<HBaseProtos.SnapshotDescription> getCompletedSnapshots() throws IOException
IOException
- File system exceptionpublic void deleteSnapshot(HBaseProtos.SnapshotDescription snapshot) throws SnapshotDoesNotExistException, IOException
snapshot
-
SnapshotDoesNotExistException
- If the specified snapshot does not exist.
IOException
- For filesystem IOExceptionspublic boolean isSnapshotDone(HBaseProtos.SnapshotDescription expected) throws IOException
expected
-
IOException
- IOException if error from HDFS or RPC
UnknownSnapshotException
- if snapshot is invalid or does not exist.public void takeSnapshot(HBaseProtos.SnapshotDescription snapshot) throws IOException
snapshot
-
HBaseSnapshotException
- when a snapshot specific exception occurs.
IOException
- when some sort of generic IO exception occurs.public void setSnapshotHandlerForTesting(TableName tableName, SnapshotSentinel handler)
Exposed for TESTING
tableName
- handler
- handler the master should use
TODO get rid of this if possible, repackaging, modify tests.public void restoreSnapshot(HBaseProtos.SnapshotDescription reqSnapshot) throws IOException
reqSnapshot
-
IOException
public boolean isRestoreDone(HBaseProtos.SnapshotDescription snapshot) throws IOException
snapshot
-
IOException
- if there was a failure during the restorepublic void stop(String why)
Stoppable
stop
in interface Stoppable
why
- Why we're stopping.public boolean isStopped()
isStopped
in interface Stoppable
Stoppable.stop(String)
has been closed.public void checkSnapshotSupport() throws UnsupportedOperationException
UnsupportedOperationException
- if snapshot are not supported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |