Class CompletedProcedureCleaner<TEnvironment>
java.lang.Object
org.apache.hadoop.hbase.procedure2.Procedure<TEnvironment>
org.apache.hadoop.hbase.procedure2.ProcedureInMemoryChore<TEnvironment>
org.apache.hadoop.hbase.procedure2.CompletedProcedureCleaner<TEnvironment>
- All Implemented Interfaces:
Comparable<Procedure<TEnvironment>>
Internal cleaner that removes the completed procedure results after a TTL.
NOTE: This is a special case handled in timeoutLoop().
Since the client code looks more or less like:
procId = master.doOperation() while (master.getProcResult(procId) == ProcInProgress);The master should not throw away the proc result as soon as the procedure is done but should wait a result request from the client (see executor.removeResult(procId)) The client will call something like master.isProcDone() or master.getProcResult() which will return the result/state to the client, and it will mark the completed proc as ready to delete. note that the client may not receive the response from the master (e.g. master failover) so, if we delay a bit the real deletion of the proc result the client will be able to get the result the next try.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.procedure2.Procedure
Procedure.LockState
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
(package private) static final String
private final Map<Long,
CompletedProcedureRetainer<TEnvironment>> private org.apache.hadoop.conf.Configuration
private static final int
private static final int
private static final org.slf4j.Logger
private final IdLock
private final ProcedureStore
Fields inherited from class org.apache.hadoop.hbase.procedure2.Procedure
NO_PROC_ID, NO_TIMEOUT
-
Constructor Summary
ConstructorDescriptionCompletedProcedureCleaner
(org.apache.hadoop.conf.Configuration conf, ProcedureStore store, IdLock procExecutionLock, Map<Long, CompletedProcedureRetainer<TEnvironment>> completedMap, Map<NonceKey, Long> nonceKeysToProcIdsMap) -
Method Summary
Methods inherited from class org.apache.hadoop.hbase.procedure2.ProcedureInMemoryChore
abort, deserializeStateData, execute, rollback, serializeStateData
Methods inherited from class org.apache.hadoop.hbase.procedure2.Procedure
acquireLock, addStackIndex, afterReplay, beforeReplay, bypass, compareTo, completionCleanup, doAcquireLock, doExecute, doReleaseLock, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getNonceKey, getOwner, getParentProcId, getProcedureMetrics, getProcId, getProcIdHashCode, getProcName, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasOwner, hasParent, hasTimeout, haveSameParent, holdLock, incChildrenLatch, isBypass, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRollbackSupported, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, lockedWhenLoading, needPersistence, releaseLock, removeStackIndex, resetPersistence, restoreLock, setAbortFailure, setChildrenLatch, setExecuted, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, suspend, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, tryRunnable, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecuted
-
Field Details
-
LOG
-
CLEANER_INTERVAL_CONF_KEY
- See Also:
-
DEFAULT_CLEANER_INTERVAL
- See Also:
-
BATCH_SIZE_CONF_KEY
- See Also:
-
DEFAULT_BATCH_SIZE
- See Also:
-
completed
-
nonceKeysToProcIdsMap
-
store
-
procExecutionLock
-
conf
-
-
Constructor Details
-
CompletedProcedureCleaner
public CompletedProcedureCleaner(org.apache.hadoop.conf.Configuration conf, ProcedureStore store, IdLock procExecutionLock, Map<Long, CompletedProcedureRetainer<TEnvironment>> completedMap, Map<NonceKey, Long> nonceKeysToProcIdsMap)
-
-
Method Details
-
periodicExecute
- Specified by:
periodicExecute
in classProcedureInMemoryChore<TEnvironment>
-