1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (1.8.0_121) on Fri Apr 21 15:32:50 BST 2017 -->
6 <title>AsyncJobRunner</title>
7 <meta name="date" content="2017-04-21">
8 <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
9 <script type="text/javascript" src="../../../../script.js"></script>
12 <script type="text/javascript"><!--
14 if (location.href.indexOf('is-external=true') == -1) {
15 parent.document.title="AsyncJobRunner";
21 var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
22 var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
23 var altColor = "altColor";
24 var rowColor = "rowColor";
25 var tableTab = "tableTab";
26 var activeTableTab = "activeTableTab";
29 <div>JavaScript is disabled on your browser.</div>
31 <!-- ========= START OF TOP NAVBAR ======= -->
32 <div class="topNav"><a name="navbar.top">
35 <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
36 <a name="navbar.top.firstrow">
39 <ul class="navList" title="Navigation">
40 <li><a href="../../../../overview-summary.html">Overview</a></li>
41 <li><a href="package-summary.html">Package</a></li>
42 <li class="navBarCell1Rev">Class</li>
43 <li><a href="class-use/AsyncJobRunner.html">Use</a></li>
44 <li><a href="package-tree.html">Tree</a></li>
45 <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
46 <li><a href="../../../../index-files/index-1.html">Index</a></li>
47 <li><a href="../../../../help-doc.html">Help</a></li>
52 <li><a href="../../../../compbio/engine/cluster/drmaa/AsyncClusterRunner.html" title="class in compbio.engine.cluster.drmaa"><span class="typeNameLink">Prev Class</span></a></li>
53 <li><a href="../../../../compbio/engine/cluster/drmaa/ClusterEngineUtil.html" title="class in compbio.engine.cluster.drmaa"><span class="typeNameLink">Next Class</span></a></li>
56 <li><a href="../../../../index.html?compbio/engine/cluster/drmaa/AsyncJobRunner.html" target="_top">Frames</a></li>
57 <li><a href="AsyncJobRunner.html" target="_top">No Frames</a></li>
59 <ul class="navList" id="allclasses_navbar_top">
60 <li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
63 <script type="text/javascript"><!--
64 allClassesLink = document.getElementById("allclasses_navbar_top");
66 allClassesLink.style.display = "block";
69 allClassesLink.style.display = "none";
75 <ul class="subNavList">
76 <li>Summary: </li>
77 <li>Nested | </li>
78 <li><a href="#field.summary">Field</a> | </li>
79 <li><a href="#constructor.summary">Constr</a> | </li>
80 <li><a href="#method.summary">Method</a></li>
82 <ul class="subNavList">
83 <li>Detail: </li>
84 <li><a href="#field.detail">Field</a> | </li>
85 <li><a href="#constructor.detail">Constr</a> | </li>
86 <li><a href="#method.detail">Method</a></li>
89 <a name="skip.navbar.top">
92 <!-- ========= END OF TOP NAVBAR ========= -->
93 <!-- ======== START OF CLASS DATA ======== -->
95 <div class="subTitle">compbio.engine.cluster.drmaa</div>
96 <h2 title="Class AsyncJobRunner" class="title">Class AsyncJobRunner</h2>
98 <div class="contentContainer">
99 <ul class="inheritance">
100 <li>java.lang.Object</li>
102 <ul class="inheritance">
103 <li>compbio.engine.cluster.drmaa.AsyncJobRunner</li>
107 <div class="description">
108 <ul class="blockList">
109 <li class="blockList">
111 <dt>All Implemented Interfaces:</dt>
112 <dd><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></dd>
116 <pre>public class <span class="typeNameLabel">AsyncJobRunner</span>
117 extends java.lang.Object
118 implements <a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></pre>
119 <div class="block">Single cluster job runner class</div>
121 <dt><span class="simpleTagLabel">Version:</span></dt>
124 TODO after call to submitJob() no setters really work as the job
125 template gets deleted, this needs to be taken into account in this
127 <dt><span class="simpleTagLabel">Author:</span></dt>
133 <div class="summary">
134 <ul class="blockList">
135 <li class="blockList">
136 <!-- =========== FIELD SUMMARY =========== -->
137 <ul class="blockList">
138 <li class="blockList"><a name="field.summary">
141 <h3>Field Summary</h3>
142 <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
143 <caption><span>Fields</span><span class="tabEnd"> </span></caption>
145 <th class="colFirst" scope="col">Modifier and Type</th>
146 <th class="colLast" scope="col">Field and Description</th>
148 <tr class="altColor">
149 <td class="colFirst"><code>private static org.apache.log4j.Logger</code></td>
150 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#log">log</a></span></code> </td>
155 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
156 <ul class="blockList">
157 <li class="blockList"><a name="constructor.summary">
160 <h3>Constructor Summary</h3>
161 <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
162 <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
164 <th class="colOne" scope="col">Constructor and Description</th>
166 <tr class="altColor">
167 <td class="colOne"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#AsyncJobRunner--">AsyncJobRunner</a></span>()</code> </td>
172 <!-- ========== METHOD SUMMARY =========== -->
173 <ul class="blockList">
174 <li class="blockList"><a name="method.summary">
177 <h3>Method Summary</h3>
178 <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
179 <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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
181 <th class="colFirst" scope="col">Modifier and Type</th>
182 <th class="colLast" scope="col">Method and Description</th>
184 <tr id="i0" class="altColor">
185 <td class="colFirst"><code>boolean</code></td>
186 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#cancelJob-java.lang.String-">cancelJob</a></span>(java.lang.String jobId)</code>
187 <div class="block">Stop running job.</div>
190 <tr id="i1" class="rowColor">
191 <td class="colFirst"><code>boolean</code></td>
192 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#cleanup-java.lang.String-">cleanup</a></span>(java.lang.String jobId)</code>
193 <div class="block">Remove all files and a job directory for a jobid.</div>
196 <tr id="i2" class="altColor">
197 <td class="colFirst"><code><a href="../../../../compbio/metadata/JobStatus.html" title="enum in compbio.metadata">JobStatus</a></code></td>
198 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#getJobStatus-java.lang.String-">getJobStatus</a></span>(java.lang.String jobId)</code>
199 <div class="block">This will never return clust.engine.JobStatus.CANCELLED as for sun grid
200 engine cancelled job is the same as failed.</div>
203 <tr id="i3" class="rowColor">
204 <td class="colFirst"><code><a href="../../../../compbio/engine/client/ConfiguredExecutable.html" title="interface in compbio.engine.client">ConfiguredExecutable</a><?></code></td>
205 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#getResults-java.lang.String-">getResults</a></span>(java.lang.String jobId)</code>
206 <div class="block">Retrieve the results of the job.</div>
209 <tr id="i4" class="altColor">
210 <td class="colFirst"><code>java.lang.String</code></td>
211 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#getWorkDirectory-java.lang.String-">getWorkDirectory</a></span>(java.lang.String jobId)</code> </td>
213 <tr id="i5" class="rowColor">
214 <td class="colFirst"><code>java.lang.String</code></td>
215 <td class="colLast"><code><span class="memberNameLink"><a href="../../../../compbio/engine/cluster/drmaa/AsyncJobRunner.html#submitJob-compbio.engine.client.ConfiguredExecutable-">submitJob</a></span>(<a href="../../../../compbio/engine/client/ConfiguredExecutable.html" title="interface in compbio.engine.client">ConfiguredExecutable</a><?> executable)</code>
216 <div class="block">Submits job for the execution
217 Immediate execution is not guaranteed, this method puts the job in the queue.</div>
221 <ul class="blockList">
222 <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
225 <h3>Methods inherited from class java.lang.Object</h3>
226 <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
233 <div class="details">
234 <ul class="blockList">
235 <li class="blockList">
236 <!-- ============ FIELD DETAIL =========== -->
237 <ul class="blockList">
238 <li class="blockList"><a name="field.detail">
241 <h3>Field Detail</h3>
245 <ul class="blockListLast">
246 <li class="blockList">
248 <pre>private static org.apache.log4j.Logger log</pre>
253 <!-- ========= CONSTRUCTOR DETAIL ======== -->
254 <ul class="blockList">
255 <li class="blockList"><a name="constructor.detail">
258 <h3>Constructor Detail</h3>
259 <a name="AsyncJobRunner--">
262 <ul class="blockListLast">
263 <li class="blockList">
264 <h4>AsyncJobRunner</h4>
265 <pre>public AsyncJobRunner()</pre>
270 <!-- ============ METHOD DETAIL ========== -->
271 <ul class="blockList">
272 <li class="blockList"><a name="method.detail">
275 <h3>Method Detail</h3>
276 <a name="submitJob-compbio.engine.client.ConfiguredExecutable-">
279 <ul class="blockList">
280 <li class="blockList">
282 <pre>public java.lang.String submitJob(<a href="../../../../compbio/engine/client/ConfiguredExecutable.html" title="interface in compbio.engine.client">ConfiguredExecutable</a><?> executable)
283 throws <a href="../../../../compbio/metadata/JobSubmissionException.html" title="class in compbio.metadata">JobSubmissionException</a></pre>
284 <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../compbio/engine/AsyncExecutor.html#submitJob-compbio.engine.client.ConfiguredExecutable-">AsyncExecutor</a></code></span></div>
285 <div class="block">Submits job for the execution
286 Immediate execution is not guaranteed, this method puts the job in the queue.
287 All it guarantees that the job will be eventually executed.
288 The start of execution will depend on the number of jobs in the queue.</div>
290 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
291 <dd><code><a href="../../../../compbio/engine/AsyncExecutor.html#submitJob-compbio.engine.client.ConfiguredExecutable-">submitJob</a></code> in interface <code><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></code></dd>
292 <dt><span class="returnLabel">Returns:</span></dt>
293 <dd>unique job identifier</dd>
294 <dt><span class="throwsLabel">Throws:</span></dt>
295 <dd><code><a href="../../../../compbio/metadata/JobSubmissionException.html" title="class in compbio.metadata">JobSubmissionException</a></code> - if submission fails. This usually happens due to the problem on a server side.</dd>
299 <a name="cancelJob-java.lang.String-">
302 <ul class="blockList">
303 <li class="blockList">
305 <pre>public boolean cancelJob(java.lang.String jobId)</pre>
306 <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../compbio/engine/AsyncExecutor.html#cancelJob-java.lang.String-">AsyncExecutor</a></code></span></div>
307 <div class="block">Stop running job. Please not that this method does not guarantee to remove the job directory and files in it.</div>
309 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
310 <dd><code><a href="../../../../compbio/engine/AsyncExecutor.html#cancelJob-java.lang.String-">cancelJob</a></code> in interface <code><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></code></dd>
311 <dt><span class="returnLabel">Returns:</span></dt>
312 <dd>true if job was cancelled successfully, false otherwise</dd>
316 <a name="getJobStatus-java.lang.String-">
319 <ul class="blockList">
320 <li class="blockList">
321 <h4>getJobStatus</h4>
322 <pre>public <a href="../../../../compbio/metadata/JobStatus.html" title="enum in compbio.metadata">JobStatus</a> getJobStatus(java.lang.String jobId)</pre>
323 <div class="block">This will never return clust.engine.JobStatus.CANCELLED as for sun grid
324 engine cancelled job is the same as failed. Cancelled jobs needs to be
325 tracked manually!</div>
327 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
328 <dd><code><a href="../../../../compbio/engine/AsyncExecutor.html#getJobStatus-java.lang.String-">getJobStatus</a></code> in interface <code><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></code></dd>
329 <dt><span class="returnLabel">Returns:</span></dt>
330 <dd>The JobStatus object representing the status of the job</dd>
331 <dt><span class="seeLabel">See Also:</span></dt>
332 <dd><a href="../../../../compbio/metadata/JobStatus.html" title="enum in compbio.metadata"><code>JobStatus</code></a></dd>
336 <a name="cleanup-java.lang.String-">
339 <ul class="blockList">
340 <li class="blockList">
342 <pre>public boolean cleanup(java.lang.String jobId)</pre>
343 <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../compbio/engine/AsyncExecutor.html#cleanup-java.lang.String-">AsyncExecutor</a></code></span></div>
344 <div class="block">Remove all files and a job directory for a jobid.</div>
346 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
347 <dd><code><a href="../../../../compbio/engine/AsyncExecutor.html#cleanup-java.lang.String-">cleanup</a></code> in interface <code><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></code></dd>
348 <dt><span class="returnLabel">Returns:</span></dt>
349 <dd>true if job directory was successfully removed, false otherwise.</dd>
353 <a name="getResults-java.lang.String-">
356 <ul class="blockList">
357 <li class="blockList">
359 <pre>public <a href="../../../../compbio/engine/client/ConfiguredExecutable.html" title="interface in compbio.engine.client">ConfiguredExecutable</a><?> getResults(java.lang.String jobId)
360 throws <a href="../../../../compbio/metadata/ResultNotAvailableException.html" title="class in compbio.metadata">ResultNotAvailableException</a></pre>
361 <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../compbio/engine/AsyncExecutor.html#getResults-java.lang.String-">AsyncExecutor</a></code></span></div>
362 <div class="block">Retrieve the results of the job. Please not that current implementations of this method
363 blocks if the task is running until the end of the calculation.</div>
365 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
366 <dd><code><a href="../../../../compbio/engine/AsyncExecutor.html#getResults-java.lang.String-">getResults</a></code> in interface <code><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></code></dd>
367 <dt><span class="paramLabel">Parameters:</span></dt>
368 <dd><code>jobId</code> - job identifier obtained at the job submission</dd>
369 <dt><span class="returnLabel">Returns:</span></dt>
370 <dd>ConfiguredExecutable object from which result can be obtained</dd>
371 <dt><span class="throwsLabel">Throws:</span></dt>
372 <dd><code><a href="../../../../compbio/metadata/ResultNotAvailableException.html" title="class in compbio.metadata">ResultNotAvailableException</a></code> - if the result is not available for whatever reason.
373 Could be due to execution failure, or due to the results being removed from the server at
374 the time of request.</dd>
378 <a name="getWorkDirectory-java.lang.String-">
381 <ul class="blockListLast">
382 <li class="blockList">
383 <h4>getWorkDirectory</h4>
384 <pre>public java.lang.String getWorkDirectory(java.lang.String jobId)</pre>
386 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
387 <dd><code><a href="../../../../compbio/engine/AsyncExecutor.html#getWorkDirectory-java.lang.String-">getWorkDirectory</a></code> in interface <code><a href="../../../../compbio/engine/AsyncExecutor.html" title="interface in compbio.engine">AsyncExecutor</a></code></dd>
388 <dt><span class="paramLabel">Parameters:</span></dt>
389 <dd><code>jobId</code> - unique job identifier</dd>
390 <dt><span class="returnLabel">Returns:</span></dt>
391 <dd>task working directory</dd>
401 <!-- ========= END OF CLASS DATA ========= -->
402 <!-- ======= START OF BOTTOM NAVBAR ====== -->
403 <div class="bottomNav"><a name="navbar.bottom">
406 <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
407 <a name="navbar.bottom.firstrow">
410 <ul class="navList" title="Navigation">
411 <li><a href="../../../../overview-summary.html">Overview</a></li>
412 <li><a href="package-summary.html">Package</a></li>
413 <li class="navBarCell1Rev">Class</li>
414 <li><a href="class-use/AsyncJobRunner.html">Use</a></li>
415 <li><a href="package-tree.html">Tree</a></li>
416 <li><a href="../../../../deprecated-list.html">Deprecated</a></li>
417 <li><a href="../../../../index-files/index-1.html">Index</a></li>
418 <li><a href="../../../../help-doc.html">Help</a></li>
423 <li><a href="../../../../compbio/engine/cluster/drmaa/AsyncClusterRunner.html" title="class in compbio.engine.cluster.drmaa"><span class="typeNameLink">Prev Class</span></a></li>
424 <li><a href="../../../../compbio/engine/cluster/drmaa/ClusterEngineUtil.html" title="class in compbio.engine.cluster.drmaa"><span class="typeNameLink">Next Class</span></a></li>
427 <li><a href="../../../../index.html?compbio/engine/cluster/drmaa/AsyncJobRunner.html" target="_top">Frames</a></li>
428 <li><a href="AsyncJobRunner.html" target="_top">No Frames</a></li>
430 <ul class="navList" id="allclasses_navbar_bottom">
431 <li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
434 <script type="text/javascript"><!--
435 allClassesLink = document.getElementById("allclasses_navbar_bottom");
437 allClassesLink.style.display = "block";
440 allClassesLink.style.display = "none";
446 <ul class="subNavList">
447 <li>Summary: </li>
448 <li>Nested | </li>
449 <li><a href="#field.summary">Field</a> | </li>
450 <li><a href="#constructor.summary">Constr</a> | </li>
451 <li><a href="#method.summary">Method</a></li>
453 <ul class="subNavList">
454 <li>Detail: </li>
455 <li><a href="#field.detail">Field</a> | </li>
456 <li><a href="#constructor.detail">Constr</a> | </li>
457 <li><a href="#method.detail">Method</a></li>
460 <a name="skip.navbar.bottom">
463 <!-- ======== END OF BOTTOM NAVBAR ======= -->