Package org.apache.ignite.internal
Class IgniteSchedulerImpl
- java.lang.Object
-
- org.apache.ignite.internal.IgniteSchedulerImpl
-
- All Implemented Interfaces:
Externalizable
,Serializable
,IgniteScheduler
public class IgniteSchedulerImpl extends Object implements IgniteScheduler, Externalizable
IgniteScheduler
implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IgniteSchedulerImpl()
Required byExternalizable
.IgniteSchedulerImpl(GridKernalContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> IgniteFuture<R>
callLocal(@NotNull Callable<R> c)
Executes given callable on internal system thread pool asynchronously.void
readExternal(ObjectInput in)
IgniteFuture<?>
runLocal(@NotNull Runnable r)
Executes given closure on internal system thread pool asynchronously.Closeable
runLocal(@NotNull Runnable r, long delay, TimeUnit timeUnit)
Executes given closure after the delay.SchedulerFuture<?>
scheduleLocal(@NotNull Runnable job, String ptrn)
Schedules job for execution using local cron-based scheduling.<R> SchedulerFuture<R>
scheduleLocal(@NotNull Callable<R> job, String ptrn)
Schedules job for execution using local cron-based scheduling.void
writeExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
IgniteSchedulerImpl
public IgniteSchedulerImpl()
Required byExternalizable
.
-
IgniteSchedulerImpl
public IgniteSchedulerImpl(GridKernalContext ctx)
- Parameters:
ctx
- Kernal context.
-
-
Method Detail
-
runLocal
public IgniteFuture<?> runLocal(@NotNull @NotNull Runnable r)
Executes given closure on internal system thread pool asynchronously.Note that class
IgniteRunnable
implementsRunnable
and classIgniteOutClosure
implementsCallable
interface.- Specified by:
runLocal
in interfaceIgniteScheduler
- Parameters:
r
- Not null runnable to execute.- Returns:
- Future for this execution.
- See Also:
IgniteScheduler.callLocal(Callable)
,IgniteClosure
-
runLocal
public Closeable runLocal(@NotNull @NotNull Runnable r, long delay, TimeUnit timeUnit)
Executes given closure after the delay.Note that class
IgniteRunnable
implementsRunnable
- Specified by:
runLocal
in interfaceIgniteScheduler
- Parameters:
r
- Not null runnable to execute.delay
- Initial delay.timeUnit
- Time granularity.- Returns:
- java.io.Closeable which can be used to cancel execution.
-
callLocal
public <R> IgniteFuture<R> callLocal(@NotNull @NotNull Callable<R> c)
Executes given callable on internal system thread pool asynchronously.Note that class
IgniteRunnable
implementsRunnable
and classIgniteOutClosure
implementsCallable
interface.- Specified by:
callLocal
in interfaceIgniteScheduler
- Type Parameters:
R
- Type of the return value for the closure.- Parameters:
c
- Not null callable to execute.- Returns:
- Future for this execution.
- See Also:
IgniteScheduler.runLocal(Runnable)
,IgniteOutClosure
-
scheduleLocal
public SchedulerFuture<?> scheduleLocal(@NotNull @NotNull Runnable job, String ptrn)
Schedules job for execution using local cron-based scheduling.- Specified by:
scheduleLocal
in interfaceIgniteScheduler
- Parameters:
job
- Not null job to schedule to run as a background cron-based job.ptrn
- Scheduling pattern in UNIX cron format with optional prefix {n1, n2} wheren1
is delay of scheduling in seconds andn2
is the number of execution. Both parameters are optional.- Returns:
- Scheduled execution future.
-
scheduleLocal
public <R> SchedulerFuture<R> scheduleLocal(@NotNull @NotNull Callable<R> job, String ptrn)
Schedules job for execution using local cron-based scheduling.- Specified by:
scheduleLocal
in interfaceIgniteScheduler
- Type Parameters:
R
- Type of the job result.- Parameters:
job
- Not null job to schedule to run as a background cron-based job.ptrn
- Scheduling pattern in UNIX cron format with optional prefix {n1, n2} wheren1
is delay of scheduling in seconds andn2
is the number of execution. Both parameters are optional.- Returns:
- Scheduled execution future.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
-