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 TypeMethodDescriptionvoid
Add a listener to handle errors from events within a scheduled job.Get the callbacks for a given task.void
pause()
Pauses this governor's execution schedule.void
Remove an error listener.void
Schedules when thetask
will run.void
schedule
(Object key, Runnable task, RunnableFuture callback) Schedules when thetask
will run.void
shutDown()
Shuts down this governor.void
start()
Starts this governor's execution schedule.
-
Constructor Details
-
BatchedLambdaGovernor
public BatchedLambdaGovernor(long updateIntervalMillis)
-
-
Method Details
-
addErrorListener
Description copied from interface:LambdaGovernor
Add a listener to handle errors from events within a scheduled job.- Specified by:
addErrorListener
in interfaceLambdaGovernor
- Parameters:
l
- the listener to add
-
removeErrorListener
Description copied from interface:LambdaGovernor
Remove an error listener.- Specified by:
removeErrorListener
in interfaceLambdaGovernor
- Parameters:
l
- the listener to remove
-
start
public void start()Description copied from interface:LambdaGovernor
Starts this governor's execution schedule.- Specified by:
start
in interfaceLambdaGovernor
-
pause
public void pause()Description copied from interface:LambdaGovernor
Pauses this governor's execution schedule. Tasks can still be added to the work queue.- Specified by:
pause
in interfaceLambdaGovernor
-
shutDown
public void shutDown()Description copied from interface:LambdaGovernor
Shuts 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:
shutDown
in interfaceLambdaGovernor
-
schedule
Description copied from interface:LambdaGovernor
Schedules when thetask
will run.- Specified by:
schedule
in interfaceLambdaGovernor
- Parameters:
key
-task
identifiertask
-Runnable
task
-
schedule
Description copied from interface:LambdaGovernor
Schedules when thetask
will run. Adds thecallback
for the given key- Specified by:
schedule
in interfaceLambdaGovernor
- Parameters:
key
-task
identifiertask
-Runnable
taskcallback
-Runnable
run once task is complete.
-
getAndClearCallbacks
Description copied from interface:LambdaGovernor
Get the callbacks for a given task. Allows all callbacks to run after governor choking.- Specified by:
getAndClearCallbacks
in interfaceLambdaGovernor
- Parameters:
key
- task identifier- Returns:
- callbacks for the given key.
-