类 AbstractProcedureScheduler
- java.lang.Object
-
- org.apache.iotdb.confignode.procedure.scheduler.AbstractProcedureScheduler
-
- 所有已实现的接口:
ProcedureScheduler
- 直接已知子类:
SimpleProcedureScheduler
public abstract class AbstractProcedureScheduler extends java.lang.Object implements ProcedureScheduler
-
-
构造器概要
构造器 构造器 说明 AbstractProcedureScheduler()
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 voidaddBack(Procedure procedure)Inserts the specified element at the end of this queue.voidaddBack(Procedure procedure, boolean notify)Inserts the specified element at the end of this queue.voidaddFront(Procedure procedure)Inserts the specified element at the front of this queue.voidaddFront(Procedure procedure, boolean notify)Inserts the specified element at the front of this queue.protected abstract Proceduredequeue()Fetch one Procedure from the queue NOTE: this method is called with the sched lock held.protected abstract voidenqueue(Procedure procedure, boolean addFront)Add the procedure to the queue.booleanhasRunnables()Procedurepoll()Fetch one Procedure from the queueProcedurepoll(long nanos)Procedurepoll(long timeout, java.util.concurrent.TimeUnit unit)Fetch one Procedure from the queueprotected voidpush(Procedure procedure, boolean addFront, boolean notify)protected abstract booleanqueueHasRunnables()Returns true if there are procedures available to process.protected abstract intqueueSize()Returns the number of elements in this queue.protected voidschedLock()protected voidschedUnlock()voidsignalAll()In case the class is blocking on poll() waiting for items to be added, this method should awake poll() and poll() should return.intsize()Returns the number of elements in this queue.voidstart()Start the schedulervoidstop()Stop the scheduler-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.apache.iotdb.confignode.procedure.scheduler.ProcedureScheduler
clear, yield
-
-
-
-
方法详细资料
-
start
public void start()
从接口复制的说明:ProcedureSchedulerStart the scheduler- 指定者:
start在接口中ProcedureScheduler
-
stop
public void stop()
从接口复制的说明:ProcedureSchedulerStop the scheduler- 指定者:
stop在接口中ProcedureScheduler
-
signalAll
public void signalAll()
从接口复制的说明:ProcedureSchedulerIn case the class is blocking on poll() waiting for items to be added, this method should awake poll() and poll() should return.- 指定者:
signalAll在接口中ProcedureScheduler
-
enqueue
protected abstract void enqueue(Procedure procedure, boolean addFront)
Add the procedure to the queue. NOTE: this method is called with the sched lock held.- 参数:
procedure- the Procedure to addaddFront- true if the item should be added to the front of the queue
-
addFront
public void addFront(Procedure procedure)
从接口复制的说明:ProcedureSchedulerInserts the specified element at the front of this queue.- 指定者:
addFront在接口中ProcedureScheduler- 参数:
procedure- the Procedure to add
-
addFront
public void addFront(Procedure procedure, boolean notify)
从接口复制的说明:ProcedureSchedulerInserts the specified element at the front of this queue.- 指定者:
addFront在接口中ProcedureScheduler- 参数:
procedure- the Procedure to addnotify- whether need to notify worker
-
addBack
public void addBack(Procedure procedure)
从接口复制的说明:ProcedureSchedulerInserts the specified element at the end of this queue.- 指定者:
addBack在接口中ProcedureScheduler- 参数:
procedure- the Procedure to add
-
addBack
public void addBack(Procedure procedure, boolean notify)
从接口复制的说明:ProcedureSchedulerInserts the specified element at the end of this queue.- 指定者:
addBack在接口中ProcedureScheduler- 参数:
procedure- the Procedure to addnotify- whether need to notify worker
-
push
protected void push(Procedure procedure, boolean addFront, boolean notify)
-
dequeue
protected abstract Procedure dequeue()
Fetch one Procedure from the queue NOTE: this method is called with the sched lock held.- 返回:
- the Procedure to execute, or null if nothing is available.
-
poll
public Procedure poll()
从接口复制的说明:ProcedureSchedulerFetch one Procedure from the queue- 指定者:
poll在接口中ProcedureScheduler- 返回:
- the Procedure to execute, or null if nothing present.
-
poll
public Procedure poll(long timeout, java.util.concurrent.TimeUnit unit)
从接口复制的说明:ProcedureSchedulerFetch one Procedure from the queue- 指定者:
poll在接口中ProcedureScheduler- 参数:
timeout- how long to wait before giving up, in units of unitunit- a TimeUnit determining how to interpret the timeout parameter- 返回:
- the Procedure to execute, or null if nothing present.
-
poll
public Procedure poll(long nanos)
-
queueSize
protected abstract int queueSize()
Returns the number of elements in this queue. NOTE: this method is called with the sched lock held.- 返回:
- the number of elements in this queue.
-
queueHasRunnables
protected abstract boolean queueHasRunnables()
Returns true if there are procedures available to process. NOTE: this method is called with the sched lock held.- 返回:
- true if there are procedures available to process, otherwise false.
-
size
public int size()
从接口复制的说明:ProcedureSchedulerReturns the number of elements in this queue.- 指定者:
size在接口中ProcedureScheduler- 返回:
- the number of elements in this queue.
-
hasRunnables
public boolean hasRunnables()
- 指定者:
hasRunnables在接口中ProcedureScheduler- 返回:
- true if there are procedures available to process, otherwise false.
-
schedLock
protected void schedLock()
-
schedUnlock
protected void schedUnlock()
-
-