public interface IgniteScheduler
GridScheduler
is obtained from grid as follows:
IgniteScheduler s = Ignition.ignite().scheduler();
Scheduler supports standard UNIX cron
format with optional prefix of
{n1, n2}, where n1
is delay of scheduling in seconds and
n2
is the number of execution. Both parameters are optional.
Here's an example of scheduling a closure that broadcasts a message
to all nodes five times, once every minute, with initial delay of two seconds:
SchedulerFuture<?> s = Ignition.ignite().scheduler().scheduleLocal( new Callable<Object>() { @Override public Object call() throws IgniteCheckedException { g.broadcast(new IgniteCallable() {...}).get(); } }, "{2, 5} * * * * *" // 2 seconds delay with 5 executions only. );
Modifier and Type | Method and Description |
---|---|
<R> IgniteFuture<R> |
callLocal(Callable<R> c)
Executes given callable on internal system thread pool asynchronously.
|
IgniteFuture<?> |
runLocal(Runnable r)
Executes given closure on internal system thread pool asynchronously.
|
Closeable |
runLocal(Runnable r,
long delay,
TimeUnit timeUnit)
Executes given closure after the delay.
|
<R> SchedulerFuture<R> |
scheduleLocal(Callable<R> job,
String ptrn)
Schedules job for execution using local cron-based scheduling.
|
SchedulerFuture<?> |
scheduleLocal(Runnable job,
String ptrn)
Schedules job for execution using local cron-based scheduling.
|
IgniteFuture<?> runLocal(Runnable r)
Note that class IgniteRunnable
implements Runnable
and class IgniteOutClosure
implements Callable
interface.
r
- Not null
runnable to execute.NullPointerException
- if r
is null
.callLocal(Callable)
,
IgniteClosure
Closeable runLocal(Runnable r, long delay, TimeUnit timeUnit)
Note that class IgniteRunnable
implements Runnable
r
- Not null
runnable to execute.delay
- Initial delay.timeUnit
- Time granularity.NullPointerException
- if r
is null
.<R> IgniteFuture<R> callLocal(Callable<R> c)
Note that class IgniteRunnable
implements Runnable
and class IgniteOutClosure
implements Callable
interface.
R
- Type of the return value for the closure.c
- Not null
callable to execute.NullPointerException
- if r
is null
.runLocal(Runnable)
,
IgniteOutClosure
SchedulerFuture<?> scheduleLocal(Runnable job, String ptrn)
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}
where n1
is delay of scheduling in seconds and n2
is the number of execution. Both
parameters are optional.NullPointerException
- if job
is null
.<R> SchedulerFuture<R> scheduleLocal(Callable<R> job, String ptrn)
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}
where n1
is delay of scheduling in seconds and n2
is the number of execution. Both
parameters are optional.NullPointerException
- if job
is null
.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024