@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()
Returns true if there are procedures available to process, otherwise false.
|
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 |
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(long timeout, TimeUnit unit)
timeout
- 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–2020 The Apache Software Foundation. All rights reserved.