blob: aaf9ebb5215edc9d909522b02eaff060e9e5208a [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>
<META NAME="ROBOTS" CONTENT="NOINDEX">
<link rel="canonical" href="https://ignite.apache.org/releases/1.6.0/javadoc/org/apache/ignite/compute/ComputeTaskSession.html" />
<!-- Generated by javadoc (version 1.7.0_80) on Wed May 18 17:03:58 MSK 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ComputeTaskSession (Ignite 1.6.0)</title>
<meta name="date" content="2016-05-18">
<link rel="stylesheet" type="text/css" href="../../../../javadoc.css" title="Style">
<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"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ComputeTaskSession (Ignite 1.6.0)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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/ComputeTaskSession.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"><em>Ignite - In-Memory Data Fabric</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/ignite/compute/ComputeTaskNoResultCache.html" title="annotation in org.apache.ignite.compute"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/ignite/compute/ComputeTaskSession.html" target="_top">Frames</a></li>
<li><a href="ComputeTaskSession.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All 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.compute</div>
<h2 title="Interface ComputeTaskSession" class="title">Interface ComputeTaskSession</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="strong">ComputeTaskSession</span></pre>
<div class="block">Defines a distributed session for particular task execution.
<h1 class="header">Description</h1>
This interface defines a distributed session that exists for particular task
execution. Task session is distributed across the parent task and all grid
jobs spawned by it, so attributes set on a task or on a job can be viewed on
other jobs. Correspondingly attributes set on any of the jobs can also be
viewed on a task.
<p>
Session has 2 main features: <code>attribute</code> and <code>checkpoint</code>
management. Both attributes and checkpoints can be used from task itself and
from the jobs belonging to this task. Session attributes and checkpoints can
be set from any task or job methods. Session attribute and checkpoint consistency
is fault tolerant and is preserved whenever a job gets failed over to
another node for execution. Whenever task execution ends, all checkpoints
saved within session with <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#SESSION_SCOPE"><code>ComputeTaskSessionScope.SESSION_SCOPE</code></a> scope
will be removed from checkpoint storage. Checkpoints saved with
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#GLOBAL_SCOPE"><code>ComputeTaskSessionScope.GLOBAL_SCOPE</code></a> will outlive the session and
can be viewed by other tasks.
<p>
The sequence in which session attributes are set is consistent across
the task and all job siblings within it. There will never be a
case when one job sees attribute A before attribute B, and another job sees
attribute B before A. Attribute order is identical across all session
participants. Attribute order is also fault tolerant and is preserved
whenever a job gets failed over to another node.
<p>
<h1 class="header">Connected Tasks</h1>
Note that apart from setting and getting session attributes, tasks or
jobs can choose to wait for a certain attribute to be set using any of
the <code>waitForAttribute(...)</code> methods. Tasks and jobs can also
receive asynchronous notifications about a certain attribute being set
through <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute"><code>ComputeTaskSessionAttributeListener</code></a> listener. Such feature
allows grid jobs and tasks remain <u><i>connected</i></u> in order
to synchronize their execution with each other and opens a solution for a
whole new range of problems.
<p>
Imagine for example that you need to compress a very large file (let's say
terabytes in size). To do that in grid environment you would split such
file into multiple sections and assign every section to a remote job for
execution. Every job would have to scan its section to look for repetition
patterns. Once this scan is done by all jobs in parallel, jobs would need to
synchronize their results with their siblings so compression would happen
consistently across the whole file. This can be achieved by setting
repetition patterns discovered by every job into the session. Once all
patterns are synchronized, all jobs can proceed with compressing their
designated file sections in parallel, taking into account repetition patterns
found by all the jobs in the split. Grid task would then reduce (aggregate)
all compressed sections into one compressed file. Without session attribute
synchronization step this problem would be much harder to solve.
<p>
<h1 class="header">Session Injection</h1>
Session can be injected into a task or a job using IoC (dependency
injection) by attaching <a href="../../../../org/apache/ignite/resources/TaskSessionResource.html" title="annotation in org.apache.ignite.resources"><code>@TaskSessionResource</code></a>
annotation to a field or a setter method inside of <a href="../../../../org/apache/ignite/compute/ComputeTask.html" title="interface in org.apache.ignite.compute"><code>ComputeTask</code></a> or
<a href="../../../../org/apache/ignite/compute/ComputeJob.html" title="interface in org.apache.ignite.compute"><code>ComputeJob</code></a> implementations as follows:
<pre name="code" class="java">
...
// This field will be injected with distributed task session.
&#64TaskSessionResource
private ComputeTaskSession ses;
...
</pre>
or from a setter method:
<pre name="code" class="java">
// This setter method will be automatically called by the system
// to set grid task session.
&#64TaskSessionResource
void setSession(ComputeTaskSession ses) {
this.ses = ses;
}
</pre>
<h1 class="header">Example</h1></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="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#addAttributeListener(org.apache.ignite.compute.ComputeTaskSessionAttributeListener,%20boolean)">addAttributeListener</a></strong>(<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute">ComputeTaskSessionAttributeListener</a>&nbsp;lsnr,
boolean&nbsp;rewind)</code>
<div class="block">Add listener for the session attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&lt;K,V&gt;&nbsp;V</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getAttribute(K)">getAttribute</a></strong>(K&nbsp;key)</code>
<div class="block">Gets an attribute set by <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttribute(java.lang.Object,%20java.lang.Object)"><code>setAttribute(Object, Object)</code></a> or <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttributes(java.util.Map)"><code>setAttributes(Map)</code></a>
method.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getAttributes()">getAttributes</a></strong>()</code>
<div class="block">Gets all attributes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getClassLoader()">getClassLoader</a></strong>()</code>
<div class="block">Gets class loader responsible for loading all classes within task.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getEndTime()">getEndTime</a></strong>()</code>
<div class="block">Gets end of computation time for the task.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/lang/IgniteUuid.html" title="class in org.apache.ignite.lang">IgniteUuid</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getId()">getId</a></strong>()</code>
<div class="block">Gets session ID of the task being executed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/ignite/compute/ComputeJobSibling.html" title="interface in org.apache.ignite.compute">ComputeJobSibling</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getJobSibling(org.apache.ignite.lang.IgniteUuid)">getJobSibling</a></strong>(<a href="../../../../org/apache/ignite/lang/IgniteUuid.html" title="class in org.apache.ignite.lang">IgniteUuid</a>&nbsp;jobId)</code>
<div class="block">Gets job sibling for a given ID.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/ignite/compute/ComputeJobSibling.html" title="interface in org.apache.ignite.compute">ComputeJobSibling</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getJobSiblings()">getJobSiblings</a></strong>()</code>
<div class="block">Gets a collection of all grid job siblings.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getStartTime()">getStartTime</a></strong>()</code>
<div class="block">Gets start of computation time for the task.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getTaskName()">getTaskName</a></strong>()</code>
<div class="block">Gets task name of the task this session belongs to.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getTaskNodeId()">getTaskNodeId</a></strong>()</code>
<div class="block">Gets ID of the node on which task execution originated.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#getTopology()">getTopology</a></strong>()</code>
<div class="block">Gets a collection of grid nodes IDs.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)">loadCheckpoint</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key)</code>
<div class="block">Loads job's state previously saved via <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#saveCheckpoint(java.lang.String,%20java.lang.Object,%20org.apache.ignite.compute.ComputeTaskSessionScope,%20long)"><code>saveCheckpoint(String, Object, ComputeTaskSessionScope, long)</code></a>
method from an underlying storage for a given <code>key</code>.</div>
</td>
</tr>
<tr 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><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#mapFuture()">mapFuture</a></strong>()</code>
<div class="block">Gets future that will be completed when task "<tt>map</tt>" step has completed
(which means that <a href="../../../../org/apache/ignite/compute/ComputeTask.html#map(java.util.List,%20T)"><code>ComputeTask.map(List, Object)</code></a> method has finished).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/ignite/compute/ComputeJobSibling.html" title="interface in org.apache.ignite.compute">ComputeJobSibling</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#refreshJobSiblings()">refreshJobSiblings</a></strong>()</code>
<div class="block">Refreshes collection of job siblings.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeAttributeListener(org.apache.ignite.compute.ComputeTaskSessionAttributeListener)">removeAttributeListener</a></strong>(<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute">ComputeTaskSessionAttributeListener</a>&nbsp;lsnr)</code>
<div class="block">Removes given listener.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)">removeCheckpoint</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key)</code>
<div class="block">Removes previously saved job's state for a given <code>key</code> from an underlying storage.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#saveCheckpoint(java.lang.String,%20java.lang.Object)">saveCheckpoint</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;state)</code>
<div class="block">Saves intermediate state of a job or task to a storage.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#saveCheckpoint(java.lang.String,%20java.lang.Object,%20org.apache.ignite.compute.ComputeTaskSessionScope,%20long)">saveCheckpoint</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;state,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html" title="enum in org.apache.ignite.compute">ComputeTaskSessionScope</a>&nbsp;scope,
long&nbsp;timeout)</code>
<div class="block">Saves intermediate state of a job to a storage.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#saveCheckpoint(java.lang.String,%20java.lang.Object,%20org.apache.ignite.compute.ComputeTaskSessionScope,%20long,%20boolean)">saveCheckpoint</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;state,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html" title="enum in org.apache.ignite.compute">ComputeTaskSessionScope</a>&nbsp;scope,
long&nbsp;timeout,
boolean&nbsp;overwrite)</code>
<div class="block">Saves intermediate state of a job or task to a storage.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttribute(java.lang.Object,%20java.lang.Object)">setAttribute</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;val)</code>
<div class="block">Sets session attributed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttributes(java.util.Map)">setAttributes</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;attrs)</code>
<div class="block">Sets task attributes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&lt;K,V&gt;&nbsp;V</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#waitForAttribute(K,%20long)">waitForAttribute</a></strong>(K&nbsp;key,
long&nbsp;timeout)</code>
<div class="block">Waits for the specified attribute to be set.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&lt;K,V&gt;&nbsp;boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#waitForAttribute(K,%20V,%20long)">waitForAttribute</a></strong>(K&nbsp;key,
V&nbsp;val,
long&nbsp;timeout)</code>
<div class="block">Waits for the specified attribute to be set or updated with given value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#waitForAttributes(java.util.Collection,%20long)">waitForAttributes</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;keys,
long&nbsp;timeout)</code>
<div class="block">Waits for the specified attributes to be set.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#waitForAttributes(java.util.Map,%20long)">waitForAttributes</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;attrs,
long&nbsp;timeout)</code>
<div class="block">Waits for the specified attributes to be set or updated with given values.</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="getTaskName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTaskName</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getTaskName()</pre>
<div class="block">Gets task name of the task this session belongs to.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Task name of the task this session belongs to.</dd></dl>
</li>
</ul>
<a name="getTaskNodeId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTaskNodeId</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a>&nbsp;getTaskNodeId()</pre>
<div class="block">Gets ID of the node on which task execution originated.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>ID of the node on which task execution originated.</dd></dl>
</li>
</ul>
<a name="getStartTime()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStartTime</h4>
<pre>long&nbsp;getStartTime()</pre>
<div class="block">Gets start of computation time for the task.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Start of computation time for the task.</dd></dl>
</li>
</ul>
<a name="getEndTime()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEndTime</h4>
<pre>long&nbsp;getEndTime()</pre>
<div class="block">Gets end of computation time for the task. No job within the task
will be allowed to execute passed this time.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>End of computation time for the task.</dd></dl>
</li>
</ul>
<a name="getId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteUuid.html" title="class in org.apache.ignite.lang">IgniteUuid</a>&nbsp;getId()</pre>
<div class="block">Gets session ID of the task being executed.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Session ID of the task being executed.</dd></dl>
</li>
</ul>
<a name="getClassLoader()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getClassLoader</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang">ClassLoader</a>&nbsp;getClassLoader()</pre>
<div class="block">Gets class loader responsible for loading all classes within task.
<p>
Note that for classes that were loaded remotely from other nodes methods
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true#getResource(java.lang.String)" title="class or interface in java.lang"><code>Class.getResource(String)</code></a> or <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html?is-external=true#getResource(java.lang.String)" title="class or interface in java.lang"><code>ClassLoader.getResource(String)</code></a>
will always return <code>null</code>. Use
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true#getResourceAsStream(java.lang.String)" title="class or interface in java.lang"><code>Class.getResourceAsStream(String)</code></a> or <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html?is-external=true#getResourceAsStream(java.lang.String)" title="class or interface in java.lang"><code>ClassLoader.getResourceAsStream(String)</code></a>
instead.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Class loader responsible for loading all classes within task.</dd></dl>
</li>
</ul>
<a name="getJobSiblings()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJobSiblings</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/ignite/compute/ComputeJobSibling.html" title="interface in org.apache.ignite.compute">ComputeJobSibling</a>&gt;&nbsp;getJobSiblings()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Gets a collection of all grid job siblings. Job siblings are grid jobs
that are executing within the same task.
<p>
If task uses continuous mapper (i.e. it injected into task class) then
job siblings will be requested from task node for each apply.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Collection of grid job siblings executing within this task.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If job siblings can not be received from task node.</dd></dl>
</li>
</ul>
<a name="refreshJobSiblings()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>refreshJobSiblings</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/ignite/compute/ComputeJobSibling.html" title="interface in org.apache.ignite.compute">ComputeJobSibling</a>&gt;&nbsp;refreshJobSiblings()
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Refreshes collection of job siblings. This method has no effect when invoked
on originating node, as the list of siblings is always most recent. However,
when using <tt>continuous mapping</tt> (see <a href="../../../../org/apache/ignite/compute/ComputeTaskContinuousMapper.html" title="interface in org.apache.ignite.compute"><code>ComputeTaskContinuousMapper</code></a>),
list of siblings on remote node may not be fresh. In that case, this method
will re-request list of siblings from originating node.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Refreshed collection of job siblings.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If refresh failed.</dd></dl>
</li>
</ul>
<a name="getJobSibling(org.apache.ignite.lang.IgniteUuid)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJobSibling</h4>
<pre>@Nullable
<a href="../../../../org/apache/ignite/compute/ComputeJobSibling.html" title="interface in org.apache.ignite.compute">ComputeJobSibling</a>&nbsp;getJobSibling(<a href="../../../../org/apache/ignite/lang/IgniteUuid.html" title="class in org.apache.ignite.lang">IgniteUuid</a>&nbsp;jobId)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Gets job sibling for a given ID.
<p>
If task uses continuous mapper (i.e. it injected into task class) then
job sibling will be requested from task node for each apply.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jobId</code> - Job ID to get the sibling for.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Grid job sibling for a given ID.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If job sibling can not be received from task node.</dd></dl>
</li>
</ul>
<a name="setAttribute(java.lang.Object, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAttribute</h4>
<pre>void&nbsp;setAttribute(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;key,
@Nullable
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;val)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Sets session attributed. Note that task session is distributed and
this attribute will be propagated to all other jobs within this task and task
itself - i.e., to all accessors of this session.
Other jobs then will be notified by <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute"><code>ComputeTaskSessionAttributeListener</code></a>
callback than an attribute has changed.
<p>
This method is no-op if the session has finished.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Attribute key.</dd><dd><code>val</code> - Attribute value. Can be <code>null</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If sending of attribute message failed.</dd></dl>
</li>
</ul>
<a name="getAttribute(java.lang.Object)">
<!-- -->
</a><a name="getAttribute(K)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttribute</h4>
<pre>@Nullable
&lt;K,V&gt;&nbsp;V&nbsp;getAttribute(K&nbsp;key)</pre>
<div class="block">Gets an attribute set by <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttribute(java.lang.Object,%20java.lang.Object)"><code>setAttribute(Object, Object)</code></a> or <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttributes(java.util.Map)"><code>setAttributes(Map)</code></a>
method. Note that this attribute could have been set by another job on
another node.
<p>
This method is no-op if the session has finished.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - Attribute key type.</dd><dd><code>V</code> - Attribute value type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Attribute key.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Gets task attribute for given name.</dd></dl>
</li>
</ul>
<a name="setAttributes(java.util.Map)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAttributes</h4>
<pre>void&nbsp;setAttributes(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;attrs)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Sets task attributes. This method exists so one distributed replication
operation will take place for the whole group of attributes passed in.
Use it for performance reasons, rather than <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#setAttribute(java.lang.Object,%20java.lang.Object)"><code>setAttribute(Object, Object)</code></a>
method, whenever you need to set multiple attributes.
<p>
This method is no-op if the session has finished.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>attrs</code> - Attributes to set.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If sending of attribute message failed.</dd></dl>
</li>
</ul>
<a name="getAttributes()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttributes</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;getAttributes()</pre>
<div class="block">Gets all attributes.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>All session attributes.</dd></dl>
</li>
</ul>
<a name="addAttributeListener(org.apache.ignite.compute.ComputeTaskSessionAttributeListener, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addAttributeListener</h4>
<pre>void&nbsp;addAttributeListener(<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute">ComputeTaskSessionAttributeListener</a>&nbsp;lsnr,
boolean&nbsp;rewind)</pre>
<div class="block">Add listener for the session attributes.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>lsnr</code> - Listener to add.</dd><dd><code>rewind</code> - <code>true</code> value will result in calling given listener for all
already received attributes, while <code>false</code> value will result only
in new attribute notification. Settings <code>rewind</code> to <code>true</code>
allows for a simple mechanism that prevents the loss of notifications for
the attributes that were previously received or received while this method
was executing.</dd></dl>
</li>
</ul>
<a name="removeAttributeListener(org.apache.ignite.compute.ComputeTaskSessionAttributeListener)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAttributeListener</h4>
<pre>boolean&nbsp;removeAttributeListener(<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute">ComputeTaskSessionAttributeListener</a>&nbsp;lsnr)</pre>
<div class="block">Removes given listener.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>lsnr</code> - Listener to remove.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if listener was removed, <code>false</code> otherwise.</dd></dl>
</li>
</ul>
<a name="waitForAttribute(java.lang.Object,long)">
<!-- -->
</a><a name="waitForAttribute(K, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForAttribute</h4>
<pre>&lt;K,V&gt;&nbsp;V&nbsp;waitForAttribute(K&nbsp;key,
long&nbsp;timeout)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Waits for the specified attribute to be set. If this attribute is already in session
this method will return immediately.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - Attribute key type.</dd><dd><code>V</code> - Attribute value type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Attribute key to wait for.</dd><dd><code>timeout</code> - Timeout in milliseconds to wait for. <code>0</code> means indefinite wait.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Value of newly set attribute.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - Thrown if wait was interrupted.</dd></dl>
</li>
</ul>
<a name="waitForAttribute(java.lang.Object,java.lang.Object,long)">
<!-- -->
</a><a name="waitForAttribute(K, V, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForAttribute</h4>
<pre>&lt;K,V&gt;&nbsp;boolean&nbsp;waitForAttribute(K&nbsp;key,
@Nullable
V&nbsp;val,
long&nbsp;timeout)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Waits for the specified attribute to be set or updated with given value. Note that
this method will block even if attribute is set for as long as its value is not equal
to the specified.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>K</code> - Attribute key type.</dd><dd><code>V</code> - Attribute value type.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Attribute key to wait for.</dd><dd><code>val</code> - Attribute value to wait for. Can be <code>null</code>.</dd><dd><code>timeout</code> - Timeout in milliseconds to wait for. <code>0</code> means indefinite wait.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Whether or not specified key/value pair has been set.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - Thrown if wait was interrupted.</dd></dl>
</li>
</ul>
<a name="waitForAttributes(java.util.Collection, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForAttributes</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;waitForAttributes(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;keys,
long&nbsp;timeout)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Waits for the specified attributes to be set. If these attributes are already in session
this method will return immediately.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>keys</code> - Attribute keys to wait for.</dd><dd><code>timeout</code> - Timeout in milliseconds to wait for. <code>0</code> means indefinite wait.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Attribute values mapped by their keys.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - Thrown if wait was interrupted.</dd></dl>
</li>
</ul>
<a name="waitForAttributes(java.util.Map, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForAttributes</h4>
<pre>boolean&nbsp;waitForAttributes(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;attrs,
long&nbsp;timeout)
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></pre>
<div class="block">Waits for the specified attributes to be set or updated with given values. Note that
this method will block even if attributes are set for as long as their values are not equal
to the specified.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>attrs</code> - Key/value pairs to wait for.</dd><dd><code>timeout</code> - Timeout in milliseconds to wait for. <code>0</code> means indefinite wait.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Whether or not key/value pair has been set.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - Thrown if wait was interrupted.</dd></dl>
</li>
</ul>
<a name="saveCheckpoint(java.lang.String, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>saveCheckpoint</h4>
<pre>void&nbsp;saveCheckpoint(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;state)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Saves intermediate state of a job or task to a storage. The storage implementation is defined
by <a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a> implementation used.
<p>
Long running jobs may decide to store intermediate state to protect themselves from failures.
This way whenever a job fails over to another node, it can load its previously saved state via
<a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a> method and continue with execution.
<p>
This method defaults checkpoint scope to <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#SESSION_SCOPE"><code>ComputeTaskSessionScope.SESSION_SCOPE</code></a> and
implementation will automatically remove the checkpoint at the end of the session. It is
analogous to calling <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#saveCheckpoint(java.lang.String,%20java.lang.Object,%20org.apache.ignite.compute.ComputeTaskSessionScope,%20long)"><code>saveCheckpoint(String, Serializable, GridCheckpointScope.SESSION_SCOPE, 0</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key to be used to load this checkpoint in future.</dd><dd><code>state</code> - Intermediate job state to save.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If failed to save intermediate job state.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)"><code>removeCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a></dd></dl>
</li>
</ul>
<a name="saveCheckpoint(java.lang.String, java.lang.Object, org.apache.ignite.compute.ComputeTaskSessionScope, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>saveCheckpoint</h4>
<pre>void&nbsp;saveCheckpoint(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;state,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html" title="enum in org.apache.ignite.compute">ComputeTaskSessionScope</a>&nbsp;scope,
long&nbsp;timeout)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Saves intermediate state of a job to a storage. The storage implementation is defined
by <a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a> implementation used.
<p>
Long running jobs may decide to store intermediate state to protect themselves from failures.
This way whenever a job fails over to another node, it can load its previously saved state via
<a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a> method and continue with execution.
<p>
The life time of the checkpoint is determined by its timeout and scope.
If <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#GLOBAL_SCOPE"><code>ComputeTaskSessionScope.GLOBAL_SCOPE</code></a> is used, the checkpoint will outlive
its session, and can only be removed by calling <a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html#removeCheckpoint(java.lang.String)"><code>CheckpointSpi.removeCheckpoint(String)</code></a>
from <a href="../../../../org/apache/ignite/Ignite.html" title="interface in org.apache.ignite"><code>Ignite</code></a> or another task or job.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key to be used to load this checkpoint in future.</dd><dd><code>state</code> - Intermediate job state to save.</dd><dd><code>scope</code> - Checkpoint scope. If equal to <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#SESSION_SCOPE"><code>ComputeTaskSessionScope.SESSION_SCOPE</code></a>, then
state will automatically be removed at the end of task execution. Otherwise, if scope is
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#GLOBAL_SCOPE"><code>ComputeTaskSessionScope.GLOBAL_SCOPE</code></a> then state will outlive its session and can be
removed by calling <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)"><code>removeCheckpoint(String)</code></a> from another task or whenever
timeout expires.</dd><dd><code>timeout</code> - Maximum time this state should be kept by the underlying storage. Value <code>0</code> means that
timeout will never expire.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If failed to save intermediate job state.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)"><code>removeCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a></dd></dl>
</li>
</ul>
<a name="saveCheckpoint(java.lang.String, java.lang.Object, org.apache.ignite.compute.ComputeTaskSessionScope, long, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>saveCheckpoint</h4>
<pre>void&nbsp;saveCheckpoint(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;state,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html" title="enum in org.apache.ignite.compute">ComputeTaskSessionScope</a>&nbsp;scope,
long&nbsp;timeout,
boolean&nbsp;overwrite)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Saves intermediate state of a job or task to a storage. The storage implementation is defined
by <a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a> implementation used.
<p>
Long running jobs may decide to store intermediate state to protect themselves from failures.
This way whenever a job fails over to another node, it can load its previously saved state via
<a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a> method and continue with execution.
<p>
The life time of the checkpoint is determined by its timeout and scope.
If <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#GLOBAL_SCOPE"><code>ComputeTaskSessionScope.GLOBAL_SCOPE</code></a> is used, the checkpoint will outlive
its session, and can only be removed by calling <a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html#removeCheckpoint(java.lang.String)"><code>CheckpointSpi.removeCheckpoint(String)</code></a>
from <a href="../../../../org/apache/ignite/Ignite.html" title="interface in org.apache.ignite"><code>Ignite</code></a> or another task or job.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key to be used to load this checkpoint in future.</dd><dd><code>state</code> - Intermediate job state to save.</dd><dd><code>scope</code> - Checkpoint scope. If equal to <a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#SESSION_SCOPE"><code>ComputeTaskSessionScope.SESSION_SCOPE</code></a>, then
state will automatically be removed at the end of task execution. Otherwise, if scope is
<a href="../../../../org/apache/ignite/compute/ComputeTaskSessionScope.html#GLOBAL_SCOPE"><code>ComputeTaskSessionScope.GLOBAL_SCOPE</code></a> then state will outlive its session and can be
removed by calling <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)"><code>removeCheckpoint(String)</code></a> from another task or whenever
timeout expires.</dd><dd><code>timeout</code> - Maximum time this state should be kept by the underlying storage. Value <tt>0</tt> means that
timeout will never expire.</dd><dd><code>overwrite</code> - Whether or not overwrite checkpoint if it already exists.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If failed to save intermediate job state.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)"><code>removeCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a></dd></dl>
</li>
</ul>
<a name="loadCheckpoint(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>loadCheckpoint</h4>
<pre>@Nullable
&lt;T&gt;&nbsp;T&nbsp;loadCheckpoint(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Loads job's state previously saved via <a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#saveCheckpoint(java.lang.String,%20java.lang.Object,%20org.apache.ignite.compute.ComputeTaskSessionScope,%20long)"><code>saveCheckpoint(String, Object, ComputeTaskSessionScope, long)</code></a>
method from an underlying storage for a given <code>key</code>. If state was not previously
saved, then <code>null</code> will be returned. The storage implementation is defined by
<a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a> implementation used.
<p>
Long running jobs may decide to store intermediate state to protect themselves from failures.
This way whenever a job starts, it can load its previously saved state and continue
with execution.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - Type of the checkpoint state.</dd><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key for intermediate job state to load.</dd>
<dt><span class="strong">Returns:</span></dt><dd>Previously saved state or <code>null</code> if no state was found for a given <code>key</code>.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If failed to load job state.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#removeCheckpoint(java.lang.String)"><code>removeCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a></dd></dl>
</li>
</ul>
<a name="removeCheckpoint(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeCheckpoint</h4>
<pre>boolean&nbsp;removeCheckpoint(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key)
throws <a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></pre>
<div class="block">Removes previously saved job's state for a given <code>key</code> from an underlying storage.
The storage implementation is defined by <a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a> implementation used.
<p>
Long running jobs may decide to store intermediate state to protect themselves from failures.
This way whenever a job starts, it can load its previously saved state and continue
with execution.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>key</code> - Key for intermediate job state to load.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if job state was removed, <code>false</code> if state was not found.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/ignite/IgniteException.html" title="class in org.apache.ignite">IgniteException</a></code> - If failed to remove job state.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/ignite/compute/ComputeTaskSession.html#loadCheckpoint(java.lang.String)"><code>loadCheckpoint(String)</code></a>,
<a href="../../../../org/apache/ignite/spi/checkpoint/CheckpointSpi.html" title="interface in org.apache.ignite.spi.checkpoint"><code>CheckpointSpi</code></a></dd></dl>
</li>
</ul>
<a name="getTopology()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTopology</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a>&gt;&nbsp;getTopology()</pre>
<div class="block">Gets a collection of grid nodes IDs.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Collection of grid nodes IDs for the task's split.</dd></dl>
</li>
</ul>
<a name="mapFuture()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>mapFuture</h4>
<pre><a href="../../../../org/apache/ignite/lang/IgniteFuture.html" title="interface in org.apache.ignite.lang">IgniteFuture</a>&lt;?&gt;&nbsp;mapFuture()</pre>
<div class="block">Gets future that will be completed when task "<tt>map</tt>" step has completed
(which means that <a href="../../../../org/apache/ignite/compute/ComputeTask.html#map(java.util.List,%20T)"><code>ComputeTask.map(List, Object)</code></a> method has finished).</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Future that will be completed when task "<tt>map</tt>" step has completed.</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><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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/ComputeTaskSession.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"><em>Ignite - In-Memory Data Fabric</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/ignite/compute/ComputeTaskNoResultCache.html" title="annotation in org.apache.ignite.compute"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/ignite/compute/ComputeTaskSessionAttributeListener.html" title="interface in org.apache.ignite.compute"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/ignite/compute/ComputeTaskSession.html" target="_top">Frames</a></li>
<li><a href="ComputeTaskSession.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All 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>2015 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> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> </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>1.6.0</strong> </td> </tr> <tr style="padding: 0; margin: 0"> <td> <b>Release Date</b> </td> <td>:&nbsp;&nbsp; May 18 2016 </td> </tr> </tbody> </table> </td> </tr> </table></small></p>
</body>
</html>