@InterfaceAudience.Private public class RegionProcedureStore extends ProcedureStoreBase
cleanup()
method. This is because that we need to retain the max procedure id, so we can
not directly delete a procedure row as we do not know if it is the one with the max procedure id.ProcedureStore.ProcedureIterator, ProcedureStore.ProcedureLoader, ProcedureStore.ProcedureStoreListener
Modifier and Type | Field and Description |
---|---|
private LeaseRecovery |
leaseRecovery |
private static org.slf4j.Logger |
LOG |
private int |
numThreads |
(package private) static byte[] |
PROC_QUALIFIER |
(package private) MasterRegion |
region |
private Server |
server |
private static org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<Class<?>> |
UNSUPPORTED_PROCEDURES |
Constructor and Description |
---|
RegionProcedureStore(Server server,
MasterRegion region,
LeaseRecovery leaseRecovery) |
Modifier and Type | Method and Description |
---|---|
private void |
checkUnsupportedProcedure(Map<Class<?>,List<Procedure<?>>> procsByType)
In HBASE-20811, we have introduced a new TRSP to assign/unassign/move regions, and it is
incompatible with the old AssignProcedure/UnassignProcedure/MoveRegionProcedure.
|
void |
cleanup()
Will be called by the framework to give the store a chance to do some clean up works.
|
void |
delete(long procId)
The specified procId was removed from the executor,
due to completion, abort or failure.
|
void |
delete(long[] procIds,
int offset,
int count)
The specified procIds were removed from the executor,
due to completion, abort or failure.
|
void |
delete(Procedure<?> parentProc,
long[] subProcIds)
The parent procedure completed.
|
int |
getNumThreads() |
void |
insert(Procedure<?>[] procs)
Serialize a set of new procedures.
|
void |
insert(Procedure<?> proc,
Procedure<?>[] subProcs)
When a procedure is submitted to the executor insert(proc, null) will be called.
|
void |
load(ProcedureStore.ProcedureLoader loader)
Load the Procedures in the store.
|
void |
recoverLease()
Acquire the lease for the procedure store.
|
private void |
runWithoutRpcCall(Runnable runnable)
Insert procedure may be called by master's rpc call.
|
private void |
serializeDelete(long procId,
List<Mutation> mutations,
List<byte[]> rowsToLock) |
private void |
serializePut(Procedure<?> proc,
List<Mutation> mutations,
List<byte[]> rowsToLock) |
int |
setRunningProcedureCount(int count)
Set the number of procedure running.
|
void |
start(int numThreads)
Start/Open the procedure store
|
void |
stop(boolean abort)
Stop/Close the procedure store
|
private void |
tryMigrate(org.apache.hadoop.fs.FileSystem fs) |
void |
update(Procedure<?> proc)
The specified procedure was executed,
and the new state should be written to the store.
|
isRunning, registerListener, sendAbortProcessSignal, sendForceUpdateSignal, sendPostSyncSignal, setRunning, unregisterListener
private static final org.slf4j.Logger LOG
static final byte[] PROC_QUALIFIER
private final LeaseRecovery leaseRecovery
final MasterRegion region
private int numThreads
private static final org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<Class<?>> UNSUPPORTED_PROCEDURES
public RegionProcedureStore(Server server, MasterRegion region, LeaseRecovery leaseRecovery)
public void start(int numThreads) throws IOException
ProcedureStore
numThreads
- number of threads to be used by the procedure storeIOException
public void stop(boolean abort)
ProcedureStore
abort
- true if the stop is an abortpublic int getNumThreads()
public int setRunningProcedureCount(int count)
ProcedureStore
count
).private void checkUnsupportedProcedure(Map<Class<?>,List<Procedure<?>>> procsByType) throws HBaseIOException
HBaseIOException
private void tryMigrate(org.apache.hadoop.fs.FileSystem fs) throws IOException
IOException
public void recoverLease() throws IOException
ProcedureStore
IOException
public void load(ProcedureStore.ProcedureLoader loader) throws IOException
ProcedureStore
loader
- the ProcedureLoader that will handle the store-load eventsIOException
private void serializePut(Procedure<?> proc, List<Mutation> mutations, List<byte[]> rowsToLock) throws IOException
IOException
private void serializeDelete(long procId, List<Mutation> mutations, List<byte[]> rowsToLock)
private void runWithoutRpcCall(Runnable runnable)
public void insert(Procedure<?> proc, Procedure<?>[] subProcs)
ProcedureStore
proc
- the procedure to serialize and write to the store.subProcs
- the newly created child of the proc.public void insert(Procedure<?>[] procs)
ProcedureStore
procs
- the procedures to serialize and write to the store.public void update(Procedure<?> proc)
ProcedureStore
proc
- the procedure to serialize and write to the store.public void delete(long procId)
ProcedureStore
procId
- the ID of the procedure to remove.public void delete(Procedure<?> parentProc, long[] subProcIds)
ProcedureStore
parentProc
- the parent procedure to serialize and write to the store.subProcIds
- the IDs of the sub-procedure to remove.public void delete(long[] procIds, int offset, int count)
ProcedureStore
procIds
- the IDs of the procedures to remove.offset
- the array offset from where to start to deletecount
- the number of IDs to deletepublic void cleanup()
ProcedureStore
ProcedureStore.stop(boolean)
method above.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.