Class RegionProcedureStore
java.lang.Object
org.apache.hadoop.hbase.procedure2.store.ProcedureStoreBase
org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore
- All Implemented Interfaces:
ProcedureStore
A procedure store which uses the master local store to store all the procedures.
We use proc:d column to store the serialized protobuf format procedure, and when deleting we will
first fill the proc:d column with an empty byte array, and then actually delete them in the
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.procedure2.store.ProcedureStore
ProcedureStore.ProcedureIterator, ProcedureStore.ProcedureLoader, ProcedureStore.ProcedureStoreListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LeaseRecoveryprivate static final org.slf4j.Loggerprivate int(package private) static final byte[](package private) final MasterRegionprivate final Serverprivate static final org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<Class<?>> -
Constructor Summary
ConstructorsConstructorDescriptionRegionProcedureStore(Server server, MasterRegion region, LeaseRecovery leaseRecovery) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckUnsupportedProcedure(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.voidcleanup()Will be called by the framework to give the store a chance to do some clean up works.voiddelete(long procId) The specified procId was removed from the executor, due to completion, abort or failure.voiddelete(long[] procIds, int offset, int count) The specified procIds were removed from the executor, due to completion, abort or failure.voidThe parent procedure completed.intReturns the number of threads/slots passed to start()voidSerialize a set of new procedures.voidWhen a procedure is submitted to the executor insert(proc, null) will be called.voidload(ProcedureStore.ProcedureLoader loader) Load the Procedures in the store.voidAcquire the lease for the procedure store.private voidserializeDelete(long procId, List<Mutation> mutations, List<byte[]> rowsToLock) private voidserializePut(Procedure<?> proc, List<Mutation> mutations, List<byte[]> rowsToLock) intsetRunningProcedureCount(int count) Set the number of procedure running.voidstart(int numThreads) Start/Open the procedure storevoidstop(boolean abort) Stop/Close the procedure storeprivate voidtryMigrate(org.apache.hadoop.fs.FileSystem fs) voidThe specified procedure was executed, and the new state should be written to the store.Methods inherited from class org.apache.hadoop.hbase.procedure2.store.ProcedureStoreBase
isRunning, registerListener, sendAbortProcessSignal, sendForceUpdateSignal, sendPostSyncSignal, setRunning, unregisterListener
-
Field Details
-
LOG
-
PROC_QUALIFIER
-
server
-
leaseRecovery
-
region
-
numThreads
-
UNSUPPORTED_PROCEDURES
private static final org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet<Class<?>> UNSUPPORTED_PROCEDURES
-
-
Constructor Details
-
RegionProcedureStore
-
-
Method Details
-
start
Description copied from interface:ProcedureStoreStart/Open the procedure store- Parameters:
numThreads- number of threads to be used by the procedure store- Throws:
IOException
-
stop
Description copied from interface:ProcedureStoreStop/Close the procedure store- Parameters:
abort- true if the stop is an abort
-
getNumThreads
Description copied from interface:ProcedureStoreReturns the number of threads/slots passed to start() -
setRunningProcedureCount
Description copied from interface:ProcedureStoreSet the number of procedure running. This can be used, for example, by the store to know how long to wait before a sync.- Returns:
- how many procedures are running (may not be same as
count).
-
checkUnsupportedProcedure
private void checkUnsupportedProcedure(Map<Class<?>, List<Procedure<?>>> procsByType) throws HBaseIOExceptionIn HBASE-20811, we have introduced a new TRSP to assign/unassign/move regions, and it is incompatible with the old AssignProcedure/UnassignProcedure/MoveRegionProcedure. So we need to make sure that there are none these procedures when upgrading. If there are, the master will quit, you need to go back to the old version to finish these procedures first before upgrading.- Throws:
HBaseIOException
-
tryMigrate
- Throws:
IOException
-
recoverLease
Description copied from interface:ProcedureStoreAcquire the lease for the procedure store.- Throws:
IOException
-
load
Description copied from interface:ProcedureStoreLoad the Procedures in the store.- Parameters:
loader- the ProcedureLoader that will handle the store-load events- Throws:
IOException
-
serializePut
private void serializePut(Procedure<?> proc, List<Mutation> mutations, List<byte[]> rowsToLock) throws IOException - Throws:
IOException
-
serializeDelete
-
insert
Description copied from interface:ProcedureStoreWhen a procedure is submitted to the executor insert(proc, null) will be called. 'proc' has a 'RUNNABLE' state and the initial information required to start up. When a procedure is executed and it returns children insert(proc, subprocs) will be called. 'proc' has a 'WAITING' state and an update state. 'subprocs' are the children in 'RUNNABLE' state with the initial information.- Parameters:
proc- the procedure to serialize and write to the store.subProcs- the newly created child of the proc.
-
insert
Description copied from interface:ProcedureStoreSerialize a set of new procedures. These procedures are freshly submitted to the executor and each procedure has a 'RUNNABLE' state and the initial information required to start up.- Parameters:
procs- the procedures to serialize and write to the store.
-
update
Description copied from interface:ProcedureStoreThe specified procedure was executed, and the new state should be written to the store.- Parameters:
proc- the procedure to serialize and write to the store.
-
delete
Description copied from interface:ProcedureStoreThe specified procId was removed from the executor, due to completion, abort or failure. The store implementor should remove all the information about the specified procId.- Parameters:
procId- the ID of the procedure to remove.
-
delete
Description copied from interface:ProcedureStoreThe parent procedure completed. Update the state and mark all the child deleted.- Parameters:
parentProc- the parent procedure to serialize and write to the store.subProcIds- the IDs of the sub-procedure to remove.
-
delete
Description copied from interface:ProcedureStoreThe specified procIds were removed from the executor, due to completion, abort or failure. The store implementor should remove all the information about the specified procIds.- Parameters:
procIds- the IDs of the procedures to remove.offset- the array offset from where to start to deletecount- the number of IDs to delete
-
cleanup
Description copied from interface:ProcedureStoreWill be called by the framework to give the store a chance to do some clean up works. Notice that this is for periodical clean up work, not for the clean up after close, if you want to close the store just call theProcedureStore.stop(boolean)method above.
-