blob: bbf1da7345c9175c86506618982dc59c43f113d2 [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>
<!-- Generated by javadoc (1.8.0_312) on Mon Jul 11 16:23:57 UTC 2022 -->
<title>TaskContext (Spark 3.2.2 JavaDoc)</title>
<meta name="date" content="2022-07-11">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TaskContext (Spark 3.2.2 JavaDoc)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":6,"i2":10,"i3":6,"i4":6,"i5":9,"i6":6,"i7":6,"i8":9,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete 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="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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/spark/TaskCommitDenied.html" title="class in org.apache.spark"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/spark/TaskEndReason.html" title="interface in org.apache.spark"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/spark/TaskContext.html" target="_top">Frames</a></li>
<li><a href="TaskContext.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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.spark</div>
<h2 title="Class TaskContext" class="title">Class TaskContext</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>Object</li>
<li>
<ul class="inheritance">
<li>org.apache.spark.TaskContext</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../org/apache/spark/BarrierTaskContext.html" title="class in org.apache.spark">BarrierTaskContext</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">TaskContext</span>
extends Object
implements java.io.Serializable</pre>
<div class="block">Contextual information about a task which can be read or mutated during
execution. To access the TaskContext for a running task, use:
<pre><code>
org.apache.spark.TaskContext.get()
</code></pre></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../serialized-form.html#org.apache.spark.TaskContext">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#TaskContext--">TaskContext</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== 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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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;U&gt;&nbsp;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#addTaskCompletionListener-scala.Function1-">addTaskCompletionListener</a></span>(scala.Function1&lt;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>,U&gt;&nbsp;f)</code>
<div class="block">Adds a listener in the form of a Scala closure to be executed on task completion.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#addTaskCompletionListener-org.apache.spark.util.TaskCompletionListener-">addTaskCompletionListener</a></span>(<a href="../../../org/apache/spark/util/TaskCompletionListener.html" title="interface in org.apache.spark.util">TaskCompletionListener</a>&nbsp;listener)</code>
<div class="block">Adds a (Java friendly) listener to be executed on task completion.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#addTaskFailureListener-scala.Function2-">addTaskFailureListener</a></span>(scala.Function2&lt;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>,Throwable,scala.runtime.BoxedUnit&gt;&nbsp;f)</code>
<div class="block">Adds a listener to be executed on task failure.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#addTaskFailureListener-org.apache.spark.util.TaskFailureListener-">addTaskFailureListener</a></span>(<a href="../../../org/apache/spark/util/TaskFailureListener.html" title="interface in org.apache.spark.util">TaskFailureListener</a>&nbsp;listener)</code>
<div class="block">Adds a listener to be executed on task failure.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#attemptNumber--">attemptNumber</a></span>()</code>
<div class="block">How many times this task has been attempted.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#get--">get</a></span>()</code>
<div class="block">Return the currently active TaskContext.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>abstract String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#getLocalProperty-java.lang.String-">getLocalProperty</a></span>(String&nbsp;key)</code>
<div class="block">Get a local property set upstream in the driver, or null if it is missing.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract scala.collection.Seq&lt;<a href="../../../org/apache/spark/metrics/source/Source.html" title="interface in org.apache.spark.metrics.source">Source</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#getMetricsSources-java.lang.String-">getMetricsSources</a></span>(String&nbsp;sourceName)</code>
<div class="block">::DeveloperApi::
Returns all metrics sources with the given name which are associated with the instance
which runs the task.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#getPartitionId--">getPartitionId</a></span>()</code>
<div class="block">Returns the partition id of currently active TaskContext.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#isCompleted--">isCompleted</a></span>()</code>
<div class="block">Returns true if the task has completed.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#isInterrupted--">isInterrupted</a></span>()</code>
<div class="block">Returns true if the task has been killed.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#partitionId--">partitionId</a></span>()</code>
<div class="block">The ID of the RDD partition that is computed by this task.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>abstract scala.collection.immutable.Map&lt;String,<a href="../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource">ResourceInformation</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#resources--">resources</a></span>()</code>
<div class="block">Resources allocated to the task.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>abstract java.util.Map&lt;String,<a href="../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource">ResourceInformation</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#resourcesJMap--">resourcesJMap</a></span>()</code>
<div class="block">(java-specific) Resources allocated to the task.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#stageAttemptNumber--">stageAttemptNumber</a></span>()</code>
<div class="block">How many times the stage that this task belongs to has been attempted.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#stageId--">stageId</a></span>()</code>
<div class="block">The ID of the stage that this task belong to.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>abstract long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#taskAttemptId--">taskAttemptId</a></span>()</code>
<div class="block">An ID that is unique to this task attempt (within the same SparkContext, no two task attempts
will share the same attempt ID).</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>abstract org.apache.spark.executor.TaskMetrics</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/spark/TaskContext.html#taskMetrics--">taskMetrics</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="TaskContext--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TaskContext</h4>
<pre>public&nbsp;TaskContext()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="get--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public static&nbsp;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>&nbsp;get()</pre>
<div class="block">Return the currently active TaskContext. This can be called inside of
user functions to access contextual information about running tasks.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="getPartitionId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartitionId</h4>
<pre>public static&nbsp;int&nbsp;getPartitionId()</pre>
<div class="block">Returns the partition id of currently active TaskContext. It will return 0
if there is no active TaskContext for cases like local execution.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="isCompleted--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCompleted</h4>
<pre>public abstract&nbsp;boolean&nbsp;isCompleted()</pre>
<div class="block">Returns true if the task has completed.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="isInterrupted--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInterrupted</h4>
<pre>public abstract&nbsp;boolean&nbsp;isInterrupted()</pre>
<div class="block">Returns true if the task has been killed.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="addTaskCompletionListener-org.apache.spark.util.TaskCompletionListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addTaskCompletionListener</h4>
<pre>public abstract&nbsp;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>&nbsp;addTaskCompletionListener(<a href="../../../org/apache/spark/util/TaskCompletionListener.html" title="interface in org.apache.spark.util">TaskCompletionListener</a>&nbsp;listener)</pre>
<div class="block">Adds a (Java friendly) listener to be executed on task completion.
This will be called in all situations - success, failure, or cancellation. Adding a listener
to an already completed task will result in that listener being called immediately.
<p>
Two listeners registered in the same thread will be invoked in reverse order of registration if
the task completes after both are registered. There are no ordering guarantees for listeners
registered in different threads, or for listeners registered after the task completes.
Listeners are guaranteed to execute sequentially.
<p>
An example use is for HadoopRDD to register a callback to close the input stream.
<p>
Exceptions thrown by the listener will result in failure of the task.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - (undocumented)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="addTaskCompletionListener-scala.Function1-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addTaskCompletionListener</h4>
<pre>public&nbsp;&lt;U&gt;&nbsp;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>&nbsp;addTaskCompletionListener(scala.Function1&lt;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>,U&gt;&nbsp;f)</pre>
<div class="block">Adds a listener in the form of a Scala closure to be executed on task completion.
This will be called in all situations - success, failure, or cancellation. Adding a listener
to an already completed task will result in that listener being called immediately.
<p>
An example use is for HadoopRDD to register a callback to close the input stream.
<p>
Exceptions thrown by the listener will result in failure of the task.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - (undocumented)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="addTaskFailureListener-org.apache.spark.util.TaskFailureListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addTaskFailureListener</h4>
<pre>public abstract&nbsp;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>&nbsp;addTaskFailureListener(<a href="../../../org/apache/spark/util/TaskFailureListener.html" title="interface in org.apache.spark.util">TaskFailureListener</a>&nbsp;listener)</pre>
<div class="block">Adds a listener to be executed on task failure. Adding a listener to an already failed task
will result in that listener being called immediately.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - (undocumented)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="addTaskFailureListener-scala.Function2-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addTaskFailureListener</h4>
<pre>public&nbsp;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>&nbsp;addTaskFailureListener(scala.Function2&lt;<a href="../../../org/apache/spark/TaskContext.html" title="class in org.apache.spark">TaskContext</a>,Throwable,scala.runtime.BoxedUnit&gt;&nbsp;f)</pre>
<div class="block">Adds a listener to be executed on task failure. Adding a listener to an already failed task
will result in that listener being called immediately.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - (undocumented)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="stageId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stageId</h4>
<pre>public abstract&nbsp;int&nbsp;stageId()</pre>
<div class="block">The ID of the stage that this task belong to.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="stageAttemptNumber--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stageAttemptNumber</h4>
<pre>public abstract&nbsp;int&nbsp;stageAttemptNumber()</pre>
<div class="block">How many times the stage that this task belongs to has been attempted. The first stage attempt
will be assigned stageAttemptNumber = 0, and subsequent attempts will have increasing attempt
numbers.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="partitionId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>partitionId</h4>
<pre>public abstract&nbsp;int&nbsp;partitionId()</pre>
<div class="block">The ID of the RDD partition that is computed by this task.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="attemptNumber--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>attemptNumber</h4>
<pre>public abstract&nbsp;int&nbsp;attemptNumber()</pre>
<div class="block">How many times this task has been attempted. The first task attempt will be assigned
attemptNumber = 0, and subsequent attempts will have increasing attempt numbers.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="taskAttemptId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>taskAttemptId</h4>
<pre>public abstract&nbsp;long&nbsp;taskAttemptId()</pre>
<div class="block">An ID that is unique to this task attempt (within the same SparkContext, no two task attempts
will share the same attempt ID). This is roughly equivalent to Hadoop's TaskAttemptID.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="getLocalProperty-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocalProperty</h4>
<pre>public abstract&nbsp;String&nbsp;getLocalProperty(String&nbsp;key)</pre>
<div class="block">Get a local property set upstream in the driver, or null if it is missing. See also
<code>org.apache.spark.SparkContext.setLocalProperty</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - (undocumented)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="resources--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resources</h4>
<pre>public abstract&nbsp;scala.collection.immutable.Map&lt;String,<a href="../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource">ResourceInformation</a>&gt;&nbsp;resources()</pre>
<div class="block">Resources allocated to the task. The key is the resource name and the value is information
about the resource. Please refer to <a href="../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource"><code>ResourceInformation</code></a> for
specifics.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="resourcesJMap--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resourcesJMap</h4>
<pre>public abstract&nbsp;java.util.Map&lt;String,<a href="../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource">ResourceInformation</a>&gt;&nbsp;resourcesJMap()</pre>
<div class="block">(java-specific) Resources allocated to the task. The key is the resource name and the value
is information about the resource. Please refer to
<a href="../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource"><code>ResourceInformation</code></a> for specifics.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</dd>
</dl>
</li>
</ul>
<a name="taskMetrics--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>taskMetrics</h4>
<pre>public abstract&nbsp;org.apache.spark.executor.TaskMetrics&nbsp;taskMetrics()</pre>
</li>
</ul>
<a name="getMetricsSources-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getMetricsSources</h4>
<pre>public abstract&nbsp;scala.collection.Seq&lt;<a href="../../../org/apache/spark/metrics/source/Source.html" title="interface in org.apache.spark.metrics.source">Source</a>&gt;&nbsp;getMetricsSources(String&nbsp;sourceName)</pre>
<div class="block">::DeveloperApi::
Returns all metrics sources with the given name which are associated with the instance
which runs the task. For more information see <code>org.apache.spark.metrics.MetricsSystem</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sourceName</code> - (undocumented)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>(undocumented)</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="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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/spark/TaskCommitDenied.html" title="class in org.apache.spark"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/spark/TaskEndReason.html" title="interface in org.apache.spark"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/spark/TaskContext.html" target="_top">Frames</a></li>
<li><a href="TaskContext.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<script defer="defer" type="text/javascript" src="../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" src="../../../lib/api-javadocs.js"></script></body>
</html>