Class WorkQueue.TaskParker.NoOp
- All Implemented Interfaces:
WorkQueue.TaskListener
,WorkQueue.TaskParker
- Enclosing interface:
WorkQueue.TaskParker
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.gerrit.server.git.WorkQueue.TaskListener
WorkQueue.TaskListener.NoOp
Nested classes/interfaces inherited from interface com.google.gerrit.server.git.WorkQueue.TaskParker
WorkQueue.TaskParker.NoOp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isReadyToStart
(WorkQueue.Task<?> task) Determine whether aWorkQueue.Task
is ready to run or whether it should get parked.void
onNotReadyToStart
(WorkQueue.Task<?> task) This method will be called after thisWorkQueue.TaskParker
returnstrue
fromWorkQueue.TaskParker.isReadyToStart(Task)
and anotherWorkQueue.TaskParker
returnsfalse
, thus preventing the start.Methods inherited from class com.google.gerrit.server.git.WorkQueue.TaskListener.NoOp
onStart, onStop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.gerrit.server.git.WorkQueue.TaskListener
onStart, onStop
-
Constructor Details
-
NoOp
public NoOp()
-
-
Method Details
-
isReadyToStart
Description copied from interface:WorkQueue.TaskParker
Determine whether aWorkQueue.Task
is ready to run or whether it should get parked.Tasks that are not ready to run will get parked and will not run until all
WorkQueue.TaskParker
s returntrue
from this method for theWorkQueue.Task
. This method may be called more than once, but will always be followed by a call toWorkQueue.TaskParker.onNotReadyToStart(Task)
before being called again.Resources should be acquired in this method via non-blocking means to avoid delaying the executor from calling
WorkQueue.TaskParker.onNotReadyToStart(Task)
on otherWorkQueue.TaskParker
s holding resources.- Specified by:
isReadyToStart
in interfaceWorkQueue.TaskParker
- Parameters:
task
- theWorkQueue.Task
being considered for starting/parking- Returns:
- a boolean indicating if the given
WorkQueue.Task
is ready to run (true
) or should be parked (false
)
-
onNotReadyToStart
Description copied from interface:WorkQueue.TaskParker
This method will be called after thisWorkQueue.TaskParker
returnstrue
fromWorkQueue.TaskParker.isReadyToStart(Task)
and anotherWorkQueue.TaskParker
returnsfalse
, thus preventing the start.Implementors should use this method to free any resources acquired in
WorkQueue.TaskParker.isReadyToStart(Task)
based on the expectation that the task would start. Those resources can be re-acquired whenWorkQueue.TaskParker.isReadyToStart(Task)
is called again later.- Specified by:
onNotReadyToStart
in interfaceWorkQueue.TaskParker
- Parameters:
task
- theWorkQueue.Task
that was prevented from starting by anotherWorkQueue.TaskParker
-