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
IgniteSchedulerimplementation.- 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.voidreadExternal(ObjectInput in)IgniteFuture<?>runLocal(@NotNull Runnable r)Executes given closure on internal system thread pool asynchronously.CloseablerunLocal(@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.voidwriteExternal(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
IgniteRunnableimplementsRunnableand classIgniteOutClosureimplementsCallableinterface.- Specified by:
runLocalin 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
IgniteRunnableimplementsRunnable- Specified by:
runLocalin 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
IgniteRunnableimplementsRunnableand classIgniteOutClosureimplementsCallableinterface.- Specified by:
callLocalin 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:
scheduleLocalin 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} wheren1is delay of scheduling in seconds andn2is 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:
scheduleLocalin 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} wheren1is delay of scheduling in seconds andn2is the number of execution. Both parameters are optional.- Returns:
- Scheduled execution future.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-