blob: 484c4ebbfcff1c614740d6d0b6c8e8bbe8170057 [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_181) on Mon Apr 01 11:52:19 PDT 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LivyClient (Livy 0.6.0-incubating JavaDoc)</title>
<meta name="date" content="2019-04-01">
<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="LivyClient (Livy 0.6.0-incubating 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="../../../org/apache/livy/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/LivyClient.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/livy/JobHandle.State.html" title="enum in org.apache.livy"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/livy/LivyClientBuilder.html" title="class in org.apache.livy"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/livy/LivyClient.html" target="_top">Frames</a></li>
<li><a href="LivyClient.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.livy</div>
<h2 title="Interface LivyClient" class="title">Interface LivyClient</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">LivyClient</span></pre>
<div class="block">A client for submitting Spark-based jobs to a Livy backend.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#addFile-java.net.URI-">addFile</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</a>&nbsp;uri)</code>
<div class="block">Adds a file to the running remote context.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#addJar-java.net.URI-">addJar</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</a>&nbsp;uri)</code>
<div class="block">Adds a jar file to the running remote context.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#run-org.apache.livy.Job-">run</a></span>(<a href="../../../org/apache/livy/Job.html" title="interface in org.apache.livy">Job</a>&lt;T&gt;&nbsp;job)</code>
<div class="block">Asks the remote context to run a job immediately.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#stop-boolean-">stop</a></span>(boolean&nbsp;shutdownContext)</code>
<div class="block">Stops the remote context.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="../../../org/apache/livy/JobHandle.html" title="interface in org.apache.livy">JobHandle</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#submit-org.apache.livy.Job-">submit</a></span>(<a href="../../../org/apache/livy/Job.html" title="interface in org.apache.livy">Job</a>&lt;T&gt;&nbsp;job)</code>
<div class="block">Submits a job for asynchronous execution.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#uploadFile-java.io.File-">uploadFile</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</code>
<div class="block">Upload a file to be passed to the Spark application</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/livy/LivyClient.html#uploadJar-java.io.File-">uploadJar</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;jar)</code>
<div class="block">Upload a jar to be added to the Spark application classpath</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="submit-org.apache.livy.Job-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>submit</h4>
<pre>&lt;T&gt;&nbsp;<a href="../../../org/apache/livy/JobHandle.html" title="interface in org.apache.livy">JobHandle</a>&lt;T&gt;&nbsp;submit(<a href="../../../org/apache/livy/Job.html" title="interface in org.apache.livy">Job</a>&lt;T&gt;&nbsp;job)</pre>
<div class="block">Submits a job for asynchronous execution.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - The return type of the job</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - The job to execute.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A handle that be used to monitor the job.</dd>
</dl>
</li>
</ul>
<a name="run-org.apache.livy.Job-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre>&lt;T&gt;&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;T&gt;&nbsp;run(<a href="../../../org/apache/livy/Job.html" title="interface in org.apache.livy">Job</a>&lt;T&gt;&nbsp;job)</pre>
<div class="block">Asks the remote context to run a job immediately.
<p>
Normally, the remote context will queue jobs and execute them based on how many worker
threads have been configured. This method will run the submitted job in the same thread
processing the RPC message, so that queueing does not apply.
<p>
It's recommended that this method only be used to run code that finishes quickly. This
avoids interfering with the normal operation of the context.
<p></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - The return type of the job</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>job</code> - The job to execute.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A future to monitor the result of the job.</dd>
</dl>
</li>
</ul>
<a name="stop-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stop</h4>
<pre>void&nbsp;stop(boolean&nbsp;shutdownContext)</pre>
<div class="block">Stops the remote context.
Any pending jobs will be cancelled, and the remote context will be torn down.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>shutdownContext</code> - Whether to shutdown the underlying Spark context. If false, the
context will keep running and it's still possible to send commands
to it, if the backend being used supports it.</dd>
</dl>
</li>
</ul>
<a name="uploadJar-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>uploadJar</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;&nbsp;uploadJar(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;jar)</pre>
<div class="block">Upload a jar to be added to the Spark application classpath</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jar</code> - The local file to be uploaded</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A future that can be used to monitor this operation</dd>
</dl>
</li>
</ul>
<a name="addJar-java.net.URI-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addJar</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;&nbsp;addJar(<a href="http://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</a>&nbsp;uri)</pre>
<div class="block">Adds a jar file to the running remote context.
<p>
Note that the URL should be reachable by the Spark driver process. If running the driver
in cluster mode, it may reside on a different host, meaning "file:" URLs have to exist
on that node (and not on the client machine).
<p>
If the provided URI has no scheme, it's considered to be relative to the default file system
configured in the Livy server.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>uri</code> - The location of the jar file.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A future that can be used to monitor the operation.</dd>
</dl>
</li>
</ul>
<a name="uploadFile-java.io.File-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>uploadFile</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;&nbsp;uploadFile(<a href="http://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file)</pre>
<div class="block">Upload a file to be passed to the Spark application</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>file</code> - The local file to be uploaded</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A future that can be used to monitor this operation</dd>
</dl>
</li>
</ul>
<a name="addFile-java.net.URI-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>addFile</h4>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Future.html?is-external=true" title="class or interface in java.util.concurrent">Future</a>&lt;?&gt;&nbsp;addFile(<a href="http://docs.oracle.com/javase/8/docs/api/java/net/URI.html?is-external=true" title="class or interface in java.net">URI</a>&nbsp;uri)</pre>
<div class="block">Adds a file to the running remote context.
<p>
Note that the URL should be reachable by the Spark driver process. If running the driver
in cluster mode, it may reside on a different host, meaning "file:" URLs have to exist
on that node (and not on the client machine).
<p>
If the provided URI has no scheme, it's considered to be relative to the default file system
configured in the Livy server.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>uri</code> - The location of the file.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A future that can be used to monitor the operation.</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="../../../org/apache/livy/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/LivyClient.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/livy/JobHandle.State.html" title="enum in org.apache.livy"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/livy/LivyClientBuilder.html" title="class in org.apache.livy"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/livy/LivyClient.html" target="_top">Frames</a></li>
<li><a href="LivyClient.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>