@InterfaceAudience.Private @InterfaceStability.Evolving public class SimpleProcedureScheduler extends AbstractProcedureScheduler
Modifier and Type | Field and Description |
---|---|
private ProcedureDeque |
runnables |
Constructor and Description |
---|
SimpleProcedureScheduler() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear current state of scheduler such that it is equivalent to newly created scheduler.
|
void |
completionCleanup(Procedure proc)
The procedure in execution completed.
|
protected Procedure |
dequeue()
Fetch one Procedure from the queue NOTE: this method is called with the sched lock held.
|
protected void |
enqueue(Procedure procedure,
boolean addFront)
Add the procedure to the queue.
|
LockedResource |
getLockResource(LockedResourceType resourceType,
String resourceName) |
List<LockedResource> |
getLocks()
List lock queues.
|
boolean |
queueHasRunnables()
Returns true if there are procedures available to process.
|
int |
queueSize()
Returns the number of elements in this queue.
|
void |
yield(Procedure proc)
The procedure can't run at the moment.
|
addBack, addBack, addFront, addFront, addFront, getNullPollCalls, getPollCalls, hasRunnables, poll, poll, poll, push, schedLock, schedUnlock, signalAll, size, start, stop, waitProcedure, wakeEvents, wakePollIfNeeded, wakeProcedure, wakeWaitingProcedures
private final ProcedureDeque runnables
public SimpleProcedureScheduler()
protected void enqueue(Procedure procedure, boolean addFront)
AbstractProcedureScheduler
enqueue
in class AbstractProcedureScheduler
procedure
- the Procedure to addaddFront
- true if the item should be added to the front of the queueprotected Procedure dequeue()
AbstractProcedureScheduler
dequeue
in class AbstractProcedureScheduler
public void clear()
ProcedureScheduler
ProcedureExecutor
resets its own state and calls clear() on scheduler.public void yield(Procedure proc)
ProcedureScheduler
proc
- the Procedure to add back to the listpublic boolean queueHasRunnables()
AbstractProcedureScheduler
queueHasRunnables
in class AbstractProcedureScheduler
public int queueSize()
AbstractProcedureScheduler
queueSize
in class AbstractProcedureScheduler
public void completionCleanup(Procedure proc)
ProcedureScheduler
proc
- the Procedure that completed the execution.public List<LockedResource> getLocks()
ProcedureScheduler
public LockedResource getLockResource(LockedResourceType resourceType, String resourceName)
LockedResource
for resource of specified type & name. null if resource is not
locked.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.