Package org.apache.flink.core.testutils
Class ScheduledTask<T>
- java.lang.Object
-
- org.apache.flink.core.testutils.ScheduledTask<T>
-
- Type Parameters:
T- type of the result
- All Implemented Interfaces:
Comparable<Delayed>,Delayed,Future<T>,ScheduledFuture<T>
public final class ScheduledTask<T> extends Object implements ScheduledFuture<T>
ScheduledTask represents a task which is executed at a later point in time.
-
-
Constructor Summary
Constructors Constructor Description ScheduledTask(Callable<T> callable, long delay)ScheduledTask(Callable<T> callable, long delay, long period)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)intcompareTo(Delayed o)voidexecute()Tget()Tget(long timeout, TimeUnit unit)Callable<T>getCallable()longgetDelay(TimeUnit unit)longgetPeriod()booleanisCancelled()booleanisDone()booleanisPeriodic()
-
-
-
Method Detail
-
isPeriodic
public boolean isPeriodic()
-
getPeriod
public long getPeriod()
-
execute
public void execute()
-
compareTo
public int compareTo(Delayed o)
- Specified by:
compareToin interfaceComparable<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfaceFuture<T>
-
get
public T get() throws InterruptedException, ExecutionException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, @Nonnull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
getin interfaceFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-