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.NoOpNested classes/interfaces inherited from interface com.google.gerrit.server.git.WorkQueue.TaskParker
WorkQueue.TaskParker.NoOp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReadyToStart(WorkQueue.Task<?> task) Determine whether aWorkQueue.Taskis ready to run or whether it should get parked.voidonNotReadyToStart(WorkQueue.Task<?> task) This method will be called after thisWorkQueue.TaskParkerreturnstruefromWorkQueue.TaskParker.isReadyToStart(Task)and anotherWorkQueue.TaskParkerreturnsfalse, thus preventing the start.Methods inherited from class com.google.gerrit.server.git.WorkQueue.TaskListener.NoOp
onStart, onStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.TaskParkerDetermine whether aWorkQueue.Taskis 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.TaskParkers returntruefrom 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.TaskParkers holding resources.- Specified by:
isReadyToStartin interfaceWorkQueue.TaskParker- Parameters:
task- theWorkQueue.Taskbeing considered for starting/parking- Returns:
- a boolean indicating if the given
WorkQueue.Taskis ready to run (true) or should be parked (false)
-
onNotReadyToStart
Description copied from interface:WorkQueue.TaskParkerThis method will be called after thisWorkQueue.TaskParkerreturnstruefromWorkQueue.TaskParker.isReadyToStart(Task)and anotherWorkQueue.TaskParkerreturnsfalse, 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:
onNotReadyToStartin interfaceWorkQueue.TaskParker- Parameters:
task- theWorkQueue.Taskthat was prevented from starting by anotherWorkQueue.TaskParker
-