Class InternalProcedure<Env>
java.lang.Object
org.apache.iotdb.confignode.procedure.Procedure<Env>
org.apache.iotdb.confignode.procedure.InternalProcedure<Env>
- Type Parameters:
Env-
- All Implemented Interfaces:
Comparable<Procedure<Env>>
- Direct Known Subclasses:
CompletedProcedureRecycler,PartitionTableAutoCleaner
Internal Procedure, do some periodic job for framework.
-
Field Summary
Fields inherited from class org.apache.iotdb.confignode.procedure.Procedure
NO_PROC_ID, NO_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeserialize(ByteBuffer byteBuffer) The main code of the procedure.protected abstract voidperiodicExecute(Env env) protected voidThe code to undo what was done by the execute() code.Methods inherited from class org.apache.iotdb.confignode.procedure.Procedure
acquireLock, addStackIndex, compareTo, deserializeTypeInfoForCompatibility, doAcquireLock, doExecute, doReleaseLock, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getParentProcId, getProcId, getProcType, getResult, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasParent, hasTimeout, haveSameParent, holdLock, incChildrenLatch, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, isYieldAfterExecution, releaseLock, removeStackIndex, restoreLock, serialize, setChildrenLatch, setFailure, setFailure, setLastUpdate, setParentProcId, setProcId, setProcRunnable, setResult, setRootProcedureId, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, toString, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, updateMetricsOnFinish, updateMetricsOnSubmit, updateTimestamp, wasExecuted
-
Constructor Details
-
InternalProcedure
protected InternalProcedure(long toMillis)
-
-
Method Details
-
periodicExecute
-
execute
Description copied from class:ProcedureThe main code of the procedure. It must be idempotent since execute() may be called multiple times in case of machine failure in the middle of the execution.- Specified by:
executein classProcedure<Env>- Parameters:
env- the environment passed to the ProcedureExecutor- Returns:
- a set of sub-procedures to run or ourselves if there is more work to do or null if the procedure is done.
- Throws:
InterruptedException- the procedure will be added back to the queue and retried later.
-
rollback
Description copied from class:ProcedureThe code to undo what was done by the execute() code. It is called when the procedure or one of the sub-procedures failed or an abort was requested. It should cleanup all the resources created by the execute() call. The implementation must be idempotent since rollback() may be called multiple time in case of machine failure in the middle of the execution.- Specified by:
rollbackin classProcedure<Env>- Parameters:
env- the environment passed to the ProcedureExecutor- Throws:
IOException- temporary failure, the rollback will retry laterInterruptedException- the procedure will be added back to the queue and retried later
-
deserialize
- Overrides:
deserializein classProcedure<Env>
-