@InterfaceAudience.Private class CompletedProcedureCleaner<TEnvironment> extends ProcedureInMemoryChore<TEnvironment>
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.
Procedure.LockState
Modifier and Type | Field and Description |
---|---|
private static String |
BATCH_SIZE_CONF_KEY |
(package private) static String |
CLEANER_INTERVAL_CONF_KEY |
private Map<Long,CompletedProcedureRetainer<TEnvironment>> |
completed |
private org.apache.hadoop.conf.Configuration |
conf |
private static int |
DEFAULT_BATCH_SIZE |
private static int |
DEFAULT_CLEANER_INTERVAL |
private static org.slf4j.Logger |
LOG |
private Map<NonceKey,Long> |
nonceKeysToProcIdsMap |
private IdLock |
procExecutionLock |
private ProcedureStore |
store |
NO_PROC_ID, NO_TIMEOUT
Constructor and Description |
---|
CompletedProcedureCleaner(org.apache.hadoop.conf.Configuration conf,
ProcedureStore store,
IdLock procExecutionLock,
Map<Long,CompletedProcedureRetainer<TEnvironment>> completedMap,
Map<NonceKey,Long> nonceKeysToProcIdsMap) |
Modifier and Type | Method and Description |
---|---|
protected void |
periodicExecute(TEnvironment env) |
abort, deserializeStateData, execute, rollback, serializeStateData
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, isRunnable, isSuccess, isWaiting, isYieldAfterExecutionStep, lockedWhenLoading, needPersistence, releaseLock, removeStackIndex, resetPersistence, restoreLock, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setNonceKey, setOwner, setOwner, setParentProcId, setProcId, setResult, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, shouldWaitClientAck, skipPersistence, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, tryRunnable, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, waitInitialized, wasExecuted
private static final org.slf4j.Logger LOG
static final String CLEANER_INTERVAL_CONF_KEY
private static final int DEFAULT_CLEANER_INTERVAL
private static final String BATCH_SIZE_CONF_KEY
private static final int DEFAULT_BATCH_SIZE
private final Map<Long,CompletedProcedureRetainer<TEnvironment>> completed
private final Map<NonceKey,Long> nonceKeysToProcIdsMap
private final ProcedureStore store
private final IdLock procExecutionLock
private org.apache.hadoop.conf.Configuration conf
public CompletedProcedureCleaner(org.apache.hadoop.conf.Configuration conf, ProcedureStore store, IdLock procExecutionLock, Map<Long,CompletedProcedureRetainer<TEnvironment>> completedMap, Map<NonceKey,Long> nonceKeysToProcIdsMap)
protected void periodicExecute(TEnvironment env)
periodicExecute
in class ProcedureInMemoryChore<TEnvironment>
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.