@InterfaceAudience.Private
public interface ProcedureScheduler
| Modifier and Type | Method and Description |
|---|---|
void |
addBack(Procedure proc)
Inserts the specified element at the end of this queue.
|
void |
addFront(Procedure proc)
Inserts the specified element at the front of this queue.
|
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.
|
LockedResource |
getLockResource(LockedResourceType resourceType,
String resourceName) |
List<LockedResource> |
getLocks()
List lock queues.
|
boolean |
hasRunnables() |
Procedure |
poll()
Fetch one Procedure from the queue
|
Procedure |
poll(long timeout,
TimeUnit unit)
Fetch one Procedure from the queue
|
void |
signalAll()
In case the class is blocking on poll() waiting for items to be added,
this method should awake poll() and poll() should return.
|
int |
size()
Returns the number of elements in this queue.
|
void |
start()
Start the scheduler
|
void |
stop()
Stop the scheduler
|
void |
suspendEvent(ProcedureEvent event)
Mark the event as not ready.
|
boolean |
waitEvent(ProcedureEvent event,
Procedure procedure)
Suspend the procedure if the event is not ready yet.
|
void |
wakeEvent(ProcedureEvent event)
Wake every procedure waiting for the specified event
(By design each event has only one "wake" caller)
|
void |
wakeEvents(int count,
ProcedureEvent... events)
Wake every procedure waiting for the specified events.
|
void |
yield(Procedure proc)
The procedure can't run at the moment.
|
void start()
void stop()
void signalAll()
void addFront(Procedure proc)
proc - the Procedure to addvoid addBack(Procedure proc)
proc - the Procedure to addvoid yield(Procedure proc)
proc - the Procedure to add back to the listvoid completionCleanup(Procedure proc)
proc - the Procedure that completed the execution.boolean hasRunnables()
Procedure poll()
Procedure poll(long timeout, TimeUnit unit)
timeout - how long to wait before giving up, in units of unitunit - a TimeUnit determining how to interpret the timeout parametervoid suspendEvent(ProcedureEvent event)
event - the event to mark as suspended/not readyvoid wakeEvent(ProcedureEvent event)
event - the event to waitvoid wakeEvents(int count,
ProcedureEvent... events)
count - the number of events in the array to wakeevents - the list of events to wakeboolean waitEvent(ProcedureEvent event, Procedure procedure)
event - the event to wait onprocedure - the procedure waiting on the eventList<LockedResource> getLocks()
LockedResource getLockResource(LockedResourceType resourceType, String resourceName)
LockedResource for resource of specified type & name. null if resource is not locked.int size()
void clear()
ProcedureExecutor resets its own state and calls clear() on scheduler.Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.