| <!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:51 UTC 2022 --> |
| <title>PluginContext (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="PluginContext (Spark 3.2.2 JavaDoc)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":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="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/api/plugin/ExecutorPlugin.html" title="interface in org.apache.spark.api.plugin"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/spark/api/plugin/SparkPlugin.html" title="interface in org.apache.spark.api.plugin"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/spark/api/plugin/PluginContext.html" target="_top">Frames</a></li> |
| <li><a href="PluginContext.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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.api.plugin</div> |
| <h2 title="Interface PluginContext" class="title">Interface PluginContext</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>@DeveloperApi |
| public interface <span class="typeNameLabel">PluginContext</span></pre> |
| <div class="block">:: DeveloperApi :: |
| Context information and operations for plugins loaded by Spark. |
| <p> |
| An instance of this class is provided to plugins in their initialization method. It is safe |
| for plugins to keep a reference to the instance for later use (for example, to send messages |
| to the plugin's driver component). |
| <p> |
| Context instances are plugin-specific, so metrics and messages are tied each plugin. It is |
| not possible for a plugin to directly interact with other plugins.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>3.0.0</dd> |
| </dl> |
| </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"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </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>Object</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#ask-java.lang.Object-">ask</a></span>(Object message)</code> |
| <div class="block">Send an RPC to the plugin's driver-side component.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/spark/SparkConf.html" title="class in org.apache.spark">SparkConf</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#conf--">conf</a></span>()</code> |
| <div class="block">Configuration of the Spark application.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#executorID--">executorID</a></span>()</code> |
| <div class="block">Executor ID of the process.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>String</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#hostname--">hostname</a></span>()</code> |
| <div class="block">The host name which is being used by the Spark process for communication.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>com.codahale.metrics.MetricRegistry</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#metricRegistry--">metricRegistry</a></span>()</code> |
| <div class="block">Registry where to register metrics published by the plugin associated with this context.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>java.util.Map<String,<a href="../../../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource">ResourceInformation</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#resources--">resources</a></span>()</code> |
| <div class="block">The custom resources (GPUs, FPGAs, etc) allocated to driver or executor.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/spark/api/plugin/PluginContext.html#send-java.lang.Object-">send</a></span>(Object message)</code> |
| <div class="block">Send a message to the plugin's driver-side component.</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="metricRegistry--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>metricRegistry</h4> |
| <pre>com.codahale.metrics.MetricRegistry metricRegistry()</pre> |
| <div class="block">Registry where to register metrics published by the plugin associated with this context.</div> |
| </li> |
| </ul> |
| <a name="conf--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>conf</h4> |
| <pre><a href="../../../../../org/apache/spark/SparkConf.html" title="class in org.apache.spark">SparkConf</a> conf()</pre> |
| <div class="block">Configuration of the Spark application.</div> |
| </li> |
| </ul> |
| <a name="executorID--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>executorID</h4> |
| <pre>String executorID()</pre> |
| <div class="block">Executor ID of the process. On the driver, this will identify the driver.</div> |
| </li> |
| </ul> |
| <a name="hostname--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hostname</h4> |
| <pre>String hostname()</pre> |
| <div class="block">The host name which is being used by the Spark process for communication.</div> |
| </li> |
| </ul> |
| <a name="resources--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>resources</h4> |
| <pre>java.util.Map<String,<a href="../../../../../org/apache/spark/resource/ResourceInformation.html" title="class in org.apache.spark.resource">ResourceInformation</a>> resources()</pre> |
| <div class="block">The custom resources (GPUs, FPGAs, etc) allocated to driver or executor.</div> |
| </li> |
| </ul> |
| <a name="send-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>send</h4> |
| <pre>void send(Object message) |
| throws java.io.IOException</pre> |
| <div class="block">Send a message to the plugin's driver-side component. |
| <p> |
| This method sends a message to the driver-side component of the plugin, without expecting |
| a reply. It returns as soon as the message is enqueued for sending. |
| <p> |
| The message must be serializable.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>message</code> - Message to be sent.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="ask-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ask</h4> |
| <pre>Object ask(Object message) |
| throws Exception</pre> |
| <div class="block">Send an RPC to the plugin's driver-side component. |
| <p> |
| This method sends a message to the driver-side component of the plugin, and blocks until a |
| reply arrives, or the configured RPC ask timeout (<code>spark.rpc.askTimeout</code>) elapses. |
| <p> |
| If the driver replies with an error, an exception with the corresponding error will be thrown. |
| <p> |
| The message must be serializable.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>message</code> - Message to be sent.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The reply from the driver-side component.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>Exception</code></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/api/plugin/ExecutorPlugin.html" title="interface in org.apache.spark.api.plugin"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/spark/api/plugin/SparkPlugin.html" title="interface in org.apache.spark.api.plugin"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/spark/api/plugin/PluginContext.html" target="_top">Frames</a></li> |
| <li><a href="PluginContext.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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> |