@InterfaceAudience.LimitedPrivate(value="Configuration") @InterfaceStability.Unstable public class SnapshotManager extends MasterProcedureManager implements Stoppable
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.
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
SnapshotManager() |
SnapshotManager(MasterServices master,
MetricsMaster metricsMaster,
ProcedureCoordinator coordinator,
ExecutorService pool)
Fully specify all necessary components of a snapshot manager.
|
execProcedureWithRetequals, hashCodepublic static final String HBASE_SNAPSHOT_ENABLED
public static final String ONLINE_SNAPSHOT_CONTROLLER_DESCRIPTION
public SnapshotManager()
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.IOExceptionUnsupportedOperationExceptionpublic List<org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription> getCompletedSnapshots() throws IOException
IOException - File system exceptionpublic void deleteSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot) throws SnapshotDoesNotExistException, IOException
snapshot - SnapshotDoesNotExistException - If the specified snapshot does not exist.IOException - For filesystem IOExceptionspublic boolean isSnapshotDone(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription expected) throws IOException
expected - IOException - IOException if error from HDFS or RPCUnknownSnapshotException - if snapshot is invalid or does not exist.public void takeSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.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 long restoreOrCloneSnapshot(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription reqSnapshot, NonceKey nonceKey, boolean restoreAcl) throws IOException
reqSnapshot - nonceKey - unique identifier to prevent duplicated RPCIOExceptionpublic void checkSnapshotSupport()
throws UnsupportedOperationException
UnsupportedOperationException - if snapshot are not supportedpublic void initialize(MasterServices master, MetricsMaster metricsMaster) throws org.apache.zookeeper.KeeperException, IOException, UnsupportedOperationException
MasterProcedureManagerinitialize in class MasterProcedureManagermaster - Master service interfaceorg.apache.zookeeper.KeeperExceptionIOExceptionUnsupportedOperationExceptionpublic String getProcedureSignature()
ProcedureManagergetProcedureSignature in class ProcedureManagerpublic void execProcedure(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription desc) throws IOException
MasterProcedureManagerexecProcedure in class MasterProcedureManagerdesc - Procedure descriptionIOExceptionpublic void checkPermissions(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription desc, AccessChecker accessChecker, User user) throws IOException
MasterProcedureManagercheckPermissions in class MasterProcedureManagerIOException - if permissions requirements are not met.public boolean isProcedureDone(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription desc) throws IOException
MasterProcedureManagerisProcedureDone in class MasterProcedureManagerdesc - Procedure descriptionIOExceptionCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.