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 boolean
cancel(boolean mayInterruptIfRunning)
int
compareTo(Delayed o)
void
execute()
T
get()
T
get(long timeout, TimeUnit unit)
Callable<T>
getCallable()
long
getDelay(TimeUnit unit)
long
getPeriod()
boolean
isCancelled()
boolean
isDone()
boolean
isPeriodic()
-
-
-
Method Detail
-
isPeriodic
public boolean isPeriodic()
-
getPeriod
public long getPeriod()
-
execute
public void execute()
-
compareTo
public int compareTo(Delayed o)
- Specified by:
compareTo
in interfaceComparable<T>
-
cancel
public boolean cancel(boolean mayInterruptIfRunning)
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceFuture<T>
-
get
public T get() throws InterruptedException, ExecutionException
- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
-
get
public T get(long timeout, @Nonnull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
get
in interfaceFuture<T>
- Throws:
InterruptedException
ExecutionException
TimeoutException
-
-