Package org.apache.ignite.scheduler
Interface SchedulerFuture<R>
-
- All Superinterfaces:
IgniteFuture<R>
public interface SchedulerFuture<R> extends IgniteFuture<R>
Future for cron-based scheduled execution. This future is returned when callingIgniteScheduler.scheduleLocal(Callable, String)orIgniteScheduler.scheduleLocal(Runnable, String)methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doubleaverageExecutionTime()Gets average execution time in milliseconds since future was created.doubleaverageIdleTime()Gets average idle time for this scheduled task.intcount()Gets total count of executions this task has already completed.longcreateTime()Gets time in milliseconds at which this future was created.Rget()Waits for the completion of the next scheduled execution and returns its result.Rget(long timeout, TimeUnit unit)Waits for the completion of the next scheduled execution for specified amount of time and returns its result.Stringid()Gets scheduled task ID.booleanisRunning()Returnstrueif scheduled task is currently running.Rlast()Gets result of the last execution of scheduled task, ornullif task has not been executed, or has not produced a result yet.longlastFinishTime()Gets finish time of last execution (0if first execution has not finished).longlastIdleTime()Gets last interval between scheduled executions.longlastStartTime()Gets start time of last execution (0if never started).longnextExecutionTime()Gets next execution time of scheduled task.long[]nextExecutionTimes(int cnt, long start)Gets an array of the next execution times after passedstarttimestamp.Stringpattern()Gets scheduling pattern.-
Methods inherited from interface org.apache.ignite.lang.IgniteFuture
cancel, chain, chainAsync, get, isCancelled, isDone, listen, listenAsync
-
-
-
-
Method Detail
-
id
String id()
Gets scheduled task ID.- Returns:
- ID of scheduled task.
-
pattern
String pattern()
Gets scheduling pattern.- Returns:
- Scheduling pattern.
-
createTime
long createTime()
Gets time in milliseconds at which this future was created.- Returns:
- Time in milliseconds at which this future was created.
-
lastStartTime
long lastStartTime()
Gets start time of last execution (0if never started).- Returns:
- Start time of last execution.
-
lastFinishTime
long lastFinishTime()
Gets finish time of last execution (0if first execution has not finished).- Returns:
- Finish time of last execution (
0if first execution has not finished).
-
averageExecutionTime
double averageExecutionTime()
Gets average execution time in milliseconds since future was created.- Returns:
- Average execution time in milliseconds since future was created.
-
lastIdleTime
long lastIdleTime()
Gets last interval between scheduled executions. If first execution has not yet happened, then returns time passed since creation of this future.- Returns:
- Last interval between scheduled executions.
-
averageIdleTime
double averageIdleTime()
Gets average idle time for this scheduled task.- Returns:
- Average idle time for this scheduled task.
-
nextExecutionTimes
long[] nextExecutionTimes(int cnt, long start) throws IgniteExceptionGets an array of the next execution times after passedstarttimestamp.- Parameters:
cnt- Array length.start- Start timestamp.- Returns:
- Array of the next execution times in milliseconds or an empty array if there is no next execution time scheduled.
- Throws:
IgniteException- Thrown in case of any errors.
-
count
int count()
Gets total count of executions this task has already completed.- Returns:
- Total count of executions this task has already completed.
-
isRunning
boolean isRunning()
Returnstrueif scheduled task is currently running.- Returns:
Trueif scheduled task is currently running.
-
nextExecutionTime
long nextExecutionTime() throws IgniteExceptionGets next execution time of scheduled task.- Returns:
- Next execution time in milliseconds or
0if there is no next execution time. - Throws:
IgniteException- Thrown in case of any errors.
-
last
R last() throws IgniteException
Gets result of the last execution of scheduled task, ornullif task has not been executed, or has not produced a result yet.- Returns:
- Result of the last execution, or
nullif there isn't one yet. - Throws:
IgniteException- If last execution resulted in exception.
-
get
R get()
Waits for the completion of the next scheduled execution and returns its result.- Specified by:
getin interfaceIgniteFuture<R>- Returns:
- Result of the next execution.
- Throws:
CancellationExceptionIgniteInterruptedException- Subclass ofIgniteExceptionthrown if the wait was interrupted.IgniteException- If computation failed.
-
get
R get(long timeout, TimeUnit unit)
Waits for the completion of the next scheduled execution for specified amount of time and returns its result.- Specified by:
getin interfaceIgniteFuture<R>- Parameters:
timeout- The maximum time to wait.unit- The time unit of thetimeoutargument.- Returns:
- The computed result of the next execution.
- Throws:
CancellationExceptionIgniteInterruptedException- Subclass ofIgniteExceptionthrown if the wait was interrupted.IgniteFutureTimeoutException- Subclass ofIgniteExceptionthrown if the wait was timed out.IgniteException- If computation failed.
-
-