类 InternalProcedure<Env>
- java.lang.Object
-
- org.apache.iotdb.confignode.procedure.Procedure<Env>
-
- org.apache.iotdb.confignode.procedure.InternalProcedure<Env>
-
- 类型参数:
Env-
- 所有已实现的接口:
java.lang.Comparable<Procedure<Env>>
- 直接已知子类:
CompletedProcedureRecycler
public abstract class InternalProcedure<Env> extends Procedure<Env>
Internal Procedure, do some preiodic job for framework
-
-
字段概要
-
从类继承的字段 org.apache.iotdb.confignode.procedure.Procedure
NO_PROC_ID, NO_TIMEOUT
-
-
构造器概要
构造器 限定符 构造器 说明 protectedInternalProcedure(long toMillis)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected booleanabort(Env env)The abort() call is asynchronous and each procedure must decide how to deal with it, if they want to be abortable.voiddeserialize(java.nio.ByteBuffer byteBuffer)protected Procedure<Env>[]execute(Env env)The main code of the procedure.protected abstract voidperiodicExecute(Env env)protected voidrollback(Env env)The code to undo what was done by the execute() code.-
从类继承的方法 org.apache.iotdb.confignode.procedure.Procedure
acquireLock, addStackIndex, afterRecover, beforeRecover, compareTo, completionCleanup, deserializeTypeInfo, doAcquireLock, doExecute, doReleaseLock, doRollback, elapsedTime, getChildrenLatch, getException, getLastUpdate, getParentProcId, getProcId, getProcName, getResult, getRootProcedureId, getRootProcId, getStackIndexes, getState, getSubmittedTime, getTimeout, getTimeoutTimestamp, hasChildren, hasException, hasLock, hasParent, hasTimeout, haveSameParent, holdLock, incChildrenLatch, isFailed, isFinished, isInitializing, isLockedWhenLoading, isRunnable, isSuccess, isWaiting, isYieldAfterExecution, needPersistance, newInstance, releaseLock, removeStackIndex, resetPersistance, restoreLock, serialize, setAbortFailure, setChildrenLatch, setFailure, setFailure, setLastUpdate, setParentProcId, setProcId, setProcRunnable, setResult, setRootProcedureId, setRootProcId, setStackIndexes, setState, setSubmittedTime, setTimeout, setTimeoutFailure, skipPersistance, toString, toStringClass, toStringClassDetails, toStringDetails, toStringSimpleSB, toStringState, updateTimestamp, waitInitialized, wasExecuted
-
-
-
-
方法详细资料
-
periodicExecute
protected abstract void periodicExecute(Env env)
-
execute
protected Procedure<Env>[] execute(Env env) throws ProcedureYieldException, ProcedureSuspendedException, java.lang.InterruptedException
从类复制的说明: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.- 指定者:
execute在类中Procedure<Env>- 参数:
env- the environment passed to the ProcedureExecutor- 返回:
- a set of sub-procedures to run or ourselves if there is more work to do or null if the procedure is done.
- 抛出:
ProcedureYieldException- the procedure will be added back to the queue and retried later.ProcedureSuspendedException- Signal to the executor that Procedure has suspended itself and has set itself up waiting for an external event to wake it back up again.java.lang.InterruptedException- the procedure will be added back to the queue and retried later.
-
rollback
protected void rollback(Env env) throws java.io.IOException, java.lang.InterruptedException
从类复制的说明: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.
-
abort
protected boolean abort(Env env)
从类复制的说明:ProcedureThe abort() call is asynchronous and each procedure must decide how to deal with it, if they want to be abortable. The simplest implementation is to have an AtomicBoolean set in the abort() method and then the execute() will check if the abort flag is set or not. abort() may be called multiple times from the client, so the implementation must be idempotent.NOTE: abort() is not like Thread.interrupt(). It is just a notification that allows the procedure implementor abort.
-
deserialize
public void deserialize(java.nio.ByteBuffer byteBuffer)
- 覆盖:
deserialize在类中Procedure<Env>
-
-