Class BatchedLambdaGovernor
java.lang.Object
com.illumon.iris.db.plot.util.governor.BatchedLambdaGovernor
- All Implemented Interfaces:
LambdaGovernor
Executes all scheduled tasks at the fixed update interval.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.plot.util.governor.LambdaGovernor
LambdaGovernor.ErrorListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener to handle errors from events within a scheduled job.Get the callbacks for a given task.voidpause()Pauses this governor's execution schedule.voidRemove an error listener.voidSchedules when thetaskwill run.voidschedule(Object key, Runnable task, RunnableFuture callback) Schedules when thetaskwill run.voidshutDown()Shuts down this governor.voidstart()Starts this governor's execution schedule.
-
Constructor Details
-
BatchedLambdaGovernor
public BatchedLambdaGovernor(long updateIntervalMillis)
-
-
Method Details
-
addErrorListener
Description copied from interface:LambdaGovernorAdd a listener to handle errors from events within a scheduled job.- Specified by:
addErrorListenerin interfaceLambdaGovernor- Parameters:
l- the listener to add
-
removeErrorListener
Description copied from interface:LambdaGovernorRemove an error listener.- Specified by:
removeErrorListenerin interfaceLambdaGovernor- Parameters:
l- the listener to remove
-
start
public void start()Description copied from interface:LambdaGovernorStarts this governor's execution schedule.- Specified by:
startin interfaceLambdaGovernor
-
pause
public void pause()Description copied from interface:LambdaGovernorPauses this governor's execution schedule. Tasks can still be added to the work queue.- Specified by:
pausein interfaceLambdaGovernor
-
shutDown
public void shutDown()Description copied from interface:LambdaGovernorShuts down this governor. Tasks can no longer be added to the work queue. The currently running task will be allowed to execute until completion. This LambdaGovernor can not be restarted once shutDown is called.- Specified by:
shutDownin interfaceLambdaGovernor
-
schedule
Description copied from interface:LambdaGovernorSchedules when thetaskwill run.- Specified by:
schedulein interfaceLambdaGovernor- Parameters:
key-taskidentifiertask-Runnabletask
-
schedule
Description copied from interface:LambdaGovernorSchedules when thetaskwill run. Adds thecallbackfor the given key- Specified by:
schedulein interfaceLambdaGovernor- Parameters:
key-taskidentifiertask-Runnabletaskcallback-Runnablerun once task is complete.
-
getAndClearCallbacks
Description copied from interface:LambdaGovernorGet the callbacks for a given task. Allows all callbacks to run after governor choking.- Specified by:
getAndClearCallbacksin interfaceLambdaGovernor- Parameters:
key- task identifier- Returns:
- callbacks for the given key.
-