@InterfaceAudience.LimitedPrivate(value="Configuration") @InterfaceStability.Unstable public class RegionServerSnapshotManager extends RegionServerProcedureManager
HRegionServer
.
This provides the mechanism necessary to kick off a online snapshot specific
Subprocedure
that is responsible for the regions being served by this region server.
If any failures occur with the subprocedure, the RegionSeverSnapshotManager's subprocedure
handler, ProcedureMember
, notifies the master's ProcedureCoordinator to abort all
others.
On startup, requires start()
to be called.
On shutdown, requires stop(boolean)
to be called
Modifier and Type | Class and Description |
---|---|
class |
RegionServerSnapshotManager.SnapshotSubprocedureBuilder
Build the actual snapshot runner that will do all the 'hard' work
|
(package private) static class |
RegionServerSnapshotManager.SnapshotSubprocedurePool
We use the SnapshotSubprocedurePool, a class specific thread pool instead of
ExecutorService . |
Modifier and Type | Field and Description |
---|---|
private static String |
CONCURENT_SNAPSHOT_TASKS_KEY
Maximum number of snapshot region tasks that can run concurrently
|
private static int |
DEFAULT_CONCURRENT_SNAPSHOT_TASKS |
private static org.apache.commons.logging.Log |
LOG |
private ProcedureMember |
member |
private ProcedureMemberRpcs |
memberRpcs |
private RegionServerServices |
rss |
static int |
SNAPSHOT_REQUEST_THREADS_DEFAULT
# of threads for snapshotting regions on the rs.
|
static String |
SNAPSHOT_REQUEST_THREADS_KEY
Conf key for number of request threads to start snapshots on regionservers
|
private static long |
SNAPSHOT_REQUEST_WAKE_MILLIS_DEFAULT
Default amount of time to check for errors while regions finish snapshotting
|
static String |
SNAPSHOT_REQUEST_WAKE_MILLIS_KEY
Conf key for millis between checks to see if snapshot completed or if there are errors
|
static long |
SNAPSHOT_TIMEOUT_MILLIS_DEFAULT
Keep threads alive in request pool for max of 300 seconds
|
static String |
SNAPSHOT_TIMEOUT_MILLIS_KEY
Conf key for max time to keep threads in snapshot request pool waiting
|
Constructor and Description |
---|
RegionServerSnapshotManager() |
RegionServerSnapshotManager(org.apache.hadoop.conf.Configuration conf,
HRegionServer parent,
ProcedureMemberRpcs memberRpc,
ProcedureMember procMember)
Exposed for testing.
|
Modifier and Type | Method and Description |
---|---|
Subprocedure |
buildSubprocedure(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot)
If in a running state, creates the specified subprocedure for handling an online snapshot.
|
String |
getProcedureSignature()
Return the unique signature of the procedure.
|
private List<Region> |
getRegionsToSnapshot(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot)
Determine if the snapshot should be handled on this server
NOTE: This is racy -- the master expects a list of regionservers.
|
void |
initialize(RegionServerServices rss)
Create a default snapshot handler - uses a zookeeper based member controller.
|
void |
start()
Start accepting snapshot requests.
|
void |
stop(boolean force)
Close this and all running snapshot tasks
|
equals, hashCode
private static final org.apache.commons.logging.Log LOG
private static final String CONCURENT_SNAPSHOT_TASKS_KEY
private static final int DEFAULT_CONCURRENT_SNAPSHOT_TASKS
public static final String SNAPSHOT_REQUEST_THREADS_KEY
public static final int SNAPSHOT_REQUEST_THREADS_DEFAULT
public static final String SNAPSHOT_TIMEOUT_MILLIS_KEY
public static final long SNAPSHOT_TIMEOUT_MILLIS_DEFAULT
public static final String SNAPSHOT_REQUEST_WAKE_MILLIS_KEY
private static final long SNAPSHOT_REQUEST_WAKE_MILLIS_DEFAULT
private RegionServerServices rss
private ProcedureMemberRpcs memberRpcs
private ProcedureMember member
RegionServerSnapshotManager(org.apache.hadoop.conf.Configuration conf, HRegionServer parent, ProcedureMemberRpcs memberRpc, ProcedureMember procMember)
conf
- HBase configuration.parent
- parent running the snapshot handlermemberRpc
- use specified memberRpc instanceprocMember
- use specified ProcedureMemberpublic RegionServerSnapshotManager()
public void start()
start
in class RegionServerProcedureManager
public void stop(boolean force) throws IOException
stop
in class RegionServerProcedureManager
force
- forcefully stop all running tasksIOException
public Subprocedure buildSubprocedure(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot)
snapshot
- private List<Region> getRegionsToSnapshot(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot) throws IOException
MasterSnapshotVerifier
will double check the
region lists after the online portion of the snapshot completes and will explicitly fail the
snapshot.snapshot
- IOException
public void initialize(RegionServerServices rss) throws org.apache.zookeeper.KeeperException
initialize
in class RegionServerProcedureManager
rss
- region server running the handlerorg.apache.zookeeper.KeeperException
- if the zookeeper cluster cannot be reachedpublic String getProcedureSignature()
ProcedureManager
getProcedureSignature
in class ProcedureManager
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.