blob: f62411509eeafe74cb69f3744113ab62bb20e6db [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<link rel="canonical" href="https://ignite.apache.org/releases/2.6.0/javadoc/org/apache/ignite/IgniteScheduler.html" />
<META NAME="ROBOTS" CONTENT="NOINDEX">
<!-- Generated by javadoc (1.8.0_77) on Tue Jul 10 11:04:40 UTC 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IgniteScheduler (Ignite 2.6.0)</title>
<meta name="date" content="2018-07-10">
<link rel="stylesheet" type="text/css" href="../../../javadoc.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IgniteScheduler (Ignite 2.6.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IgniteScheduler.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Ignite - In-Memory Data Fabric</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/ignite/IgniteQueue.html" title="interface in org.apache.ignite"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/ignite/IgniteSemaphore.html" title="interface in org.apache.ignite"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/ignite/IgniteScheduler.html" target="_top">Frames</a></li>
<li><a href="IgniteScheduler.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.ignite</div>
<h2 title="Interface IgniteScheduler" class="title">Interface IgniteScheduler</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">IgniteScheduler</span></pre>
<div class="block">Provides functionality for scheduling jobs locally using UNIX cron-based syntax.
Instance of <code>GridScheduler</code> is obtained from grid as follows:
<pre name="code" class="java">
GridScheduler s = Ignition.ignite().scheduler();
</pre>
<p>
Scheduler supports standard UNIX <code>cron</code> format with optional prefix of
<tt>{n1, n2}</tt>, where <code>n1</code> is delay of scheduling in seconds and
<code>n2</code> 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:
<pre name="code" class="java">
Ignition.ignite().scheduler().scheduleLocal(
GridSchedulerFuture&lt;?&gt; = Ignition.ignite().scheduler().scheduleLocal(new Callable&lt;Object&gt;() {
&#64;Override public Object call() throws IgniteCheckedException {
g.broadcast(new GridCallable() {...}).get();
}
}, "{2, 5} * * * * *" // 2 seconds delay with 5 executions only.
);
</pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;R&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/ignite/IgniteScheduler.html#callLocal-java.util.concurrent.Callable-">callLocal</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c)</code>
<div class="block">Executes given callable on internal system thread pool asynchronously.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/ignite/IgniteScheduler.html#runLocal-java.lang.Runnable-">runLocal</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;r)</code>
<div class="block">Executes given closure on internal system thread pool asynchronously.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/ignite/IgniteScheduler.html#runLocal-java.lang.Runnable-long-java.util.concurrent.TimeUnit-">runLocal</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;r,
long&nbsp;delay,
<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a>&nbsp;timeUnit)</code>
<div class="block">Executes given closure after the delay.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;R&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/ignite/IgniteScheduler.html#scheduleLocal-java.util.concurrent.Callable-java.lang.String-">scheduleLocal</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</code>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/ignite/IgniteScheduler.html#scheduleLocal-java.lang.Runnable-java.lang.String-">scheduleLocal</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;job,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</code>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="runLocal-java.lang.Runnable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runLocal</h4>
<pre><a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;?&gt;&nbsp;runLocal(@Nullable
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;r)</pre>
<div class="block">Executes given closure on internal system thread pool asynchronously.
<p>
Note that class <a href="../../../org/apache/ignite/lang/IgniteRunnable.html" title="interface in org.apache.ignite.lang"><code>IgniteRunnable</code></a> implements <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang"><code>Runnable</code></a> and class <a href="../../../org/apache/ignite/lang/IgniteOutClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteOutClosure</code></a>
implements <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent"><code>Callable</code></a> interface.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>r</code> - Runnable to execute. If <code>null</code> - this method is no-op.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Future for this execution.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../org/apache/ignite/IgniteScheduler.html#callLocal-java.util.concurrent.Callable-"><code>callLocal(Callable)</code></a>,
<a href="../../../org/apache/ignite/lang/IgniteClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteClosure</code></a></dd>
</dl>
</li>
</ul>
<a name="runLocal-java.lang.Runnable-long-java.util.concurrent.TimeUnit-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>runLocal</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>&nbsp;runLocal(@Nullable
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;r,
long&nbsp;delay,
<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a>&nbsp;timeUnit)</pre>
<div class="block">Executes given closure after the delay.
<p>
Note that class <a href="../../../org/apache/ignite/lang/IgniteRunnable.html" title="interface in org.apache.ignite.lang"><code>IgniteRunnable</code></a> implements <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang"><code>Runnable</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>r</code> - Runnable to execute.</dd>
<dd><code>delay</code> - Initial delay.</dd>
<dd><code>timeUnit</code> - Time granularity.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>java.io.Closeable which can be used to cancel execution.</dd>
</dl>
</li>
</ul>
<a name="callLocal-java.util.concurrent.Callable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>callLocal</h4>
<pre>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;R&gt;&nbsp;callLocal(@Nullable
<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c)</pre>
<div class="block">Executes given callable on internal system thread pool asynchronously.
<p>
Note that class <a href="../../../org/apache/ignite/lang/IgniteRunnable.html" title="interface in org.apache.ignite.lang"><code>IgniteRunnable</code></a> implements <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang"><code>Runnable</code></a> and class <a href="../../../org/apache/ignite/lang/IgniteOutClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteOutClosure</code></a>
implements <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent"><code>Callable</code></a> interface.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>R</code> - Type of the return value for the closure.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>c</code> - Callable to execute. If <code>null</code> - this method is no-op.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Future for this execution.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../org/apache/ignite/IgniteScheduler.html#runLocal-java.lang.Runnable-"><code>runLocal(Runnable)</code></a>,
<a href="../../../org/apache/ignite/lang/IgniteOutClosure.html" title="interface in org.apache.ignite.lang"><code>IgniteOutClosure</code></a></dd>
</dl>
</li>
</ul>
<a name="scheduleLocal-java.lang.Runnable-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scheduleLocal</h4>
<pre><a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;?&gt;&nbsp;scheduleLocal(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;job,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</pre>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - Job to schedule to run as a background cron-based job.
If <code>null</code> - this method is no-op.</dd>
<dd><code>ptrn</code> - Scheduling pattern in UNIX cron format with optional prefix <tt>{n1, n2}</tt>
where <code>n1</code> is delay of scheduling in seconds and <code>n2</code> is the number of execution. Both
parameters are optional.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Scheduled execution future.</dd>
</dl>
</li>
</ul>
<a name="scheduleLocal-java.util.concurrent.Callable-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>scheduleLocal</h4>
<pre>&lt;R&gt;&nbsp;<a href="../../../org/apache/ignite/scheduler/SchedulerFuture.html" title="interface in org.apache.ignite.scheduler">SchedulerFuture</a>&lt;R&gt;&nbsp;scheduleLocal(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a>&lt;R&gt;&nbsp;c,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;ptrn)</pre>
<div class="block">Schedules job for execution using local <b>cron-based</b> scheduling.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>c</code> - Job to schedule to run as a background cron-based job.</dd>
<dd><code>ptrn</code> - Scheduling pattern in UNIX cron format with optional prefix <tt>{n1, n2}</tt>
where <code>n1</code> is delay of scheduling in seconds and <code>n2</code> is the number of execution. Both
parameters are optional.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Scheduled execution future.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/IgniteScheduler.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Ignite - In-Memory Data Fabric</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/ignite/IgniteQueue.html" title="interface in org.apache.ignite"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/ignite/IgniteSemaphore.html" title="interface in org.apache.ignite"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/ignite/IgniteScheduler.html" target="_top">Frames</a></li>
<li><a href="IgniteScheduler.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><table width="100%" border="0" cellspacing=0 cellpadding=0 style="padding: 5px"> <tr> <td> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <a target=_blank href="https://ignite.apache.org"><nobr>2018 Copyright &#169; Apache Software Foundation</nobr></a> </td> </tr> </tbody> </table> </td> <td width="100%" align="right" valign="center"> <a href="https://twitter.com/ApacheIgnite" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @ApacheIgnite</a> </td> </tr> <tr> <td colspan="2" valign="top" align="left"> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <b>Ignite Fabric</b> </td> <td>:&nbsp;&nbsp; ver. <strong>2.6.0</strong> </td> </tr> <tr style="padding: 0; margin: 0"> <td> <b>Release Date</b> </td> <td>:&nbsp;&nbsp; July 10 2018 </td> </tr> </tbody> </table> </td> </tr> </table></small></p>
</body>
</html>