@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 |
addBack(Procedure proc,
boolean notify)
Inserts the specified element at the end of this queue.
|
void |
addFront(Iterator<Procedure> procedureIterator)
Inserts all elements in the iterator at the front of this queue.
|
void |
addFront(Procedure proc)
Inserts the specified element at the front of this queue.
|
void |
addFront(Procedure proc,
boolean notify)
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(boolean onlyUrgent)
Fetch one Procedure from the queue
|
Procedure |
poll(boolean onlyUrgent,
long timeout,
TimeUnit unit)
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 |
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 addFront(Procedure proc, boolean notify)
proc
- the Procedure to addnotify
- whether need to notify workervoid addFront(Iterator<Procedure> procedureIterator)
void addBack(Procedure proc)
proc
- the Procedure to addvoid addBack(Procedure proc, boolean notify)
proc
- the Procedure to addnotify
- whether need to notify workervoid 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(boolean onlyUrgent)
onlyUrgent
- Only poll the urgent procedure to executeProcedure 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 parameterProcedure poll(boolean onlyUrgent, long timeout, TimeUnit unit)
onlyUrgent
- Only poll the urgent procedure to executetimeout
- how long to wait before giving up, in units of unitunit
- a TimeUnit determining how to interpret the timeout parameterList<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–2019 The Apache Software Foundation. All rights reserved.