blob: c4a28c19889721eb879a60a8464769511b27c4e5 [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_292) on Tue Jun 15 06:01:39 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Service (Apache Hadoop Common 3.3.1 API)</title>
<meta name="date" content="2021-06-15">
<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="Service (Apache Hadoop Common 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":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="class-use/Service.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/hadoop/service/LoggingStateChangeListener.html" title="class in org.apache.hadoop.service"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/service/Service.html" target="_top">Frames</a></li>
<li><a href="Service.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><a href="#nested.class.summary">Nested</a>&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.hadoop.service</div>
<h2 title="Interface Service" class="title">Interface Service</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></dd>
</dl>
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../org/apache/hadoop/service/launcher/LaunchableService.html" title="interface in org.apache.hadoop.service.launcher">LaunchableService</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/hadoop/service/launcher/AbstractLaunchableService.html" title="class in org.apache.hadoop.service.launcher">AbstractLaunchableService</a>, <a href="../../../../org/apache/hadoop/service/AbstractService.html" title="class in org.apache.hadoop.service">AbstractService</a>, <a href="../../../../org/apache/hadoop/service/CompositeService.html" title="class in org.apache.hadoop.service">CompositeService</a></dd>
</dl>
<hr>
<br>
<pre>@InterfaceAudience.Public
@InterfaceStability.Evolving
public interface <span class="typeNameLabel">Service</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></pre>
<div class="block">Service LifeCycle.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a></span></code>
<div class="block">Service states</div>
</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="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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#close--">close</a></span>()</code>
<div class="block">A version of stop() that is designed to be usable in Java7 closure
clauses.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getBlockers--">getBlockers</a></span>()</code>
<div class="block">Get the blockers on a service -remote dependencies
that are stopping the service from being <i>live</i>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getConfig--">getConfig</a></span>()</code>
<div class="block">Get the configuration of this service.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getFailureCause--">getFailureCause</a></span>()</code>
<div class="block">Get the first exception raised during the service failure.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getFailureState--">getFailureState</a></span>()</code>
<div class="block">Get the state in which the failure in <a href="../../../../org/apache/hadoop/service/Service.html#getFailureCause--"><code>getFailureCause()</code></a> occurred.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/hadoop/service/LifecycleEvent.html" title="class in org.apache.hadoop.service">LifecycleEvent</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getLifecycleHistory--">getLifecycleHistory</a></span>()</code>
<div class="block">Get a snapshot of the lifecycle history; it is a static list</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getName--">getName</a></span>()</code>
<div class="block">Get the name of this service.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getServiceState--">getServiceState</a></span>()</code>
<div class="block">Get the current service state</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#getStartTime--">getStartTime</a></span>()</code>
<div class="block">Get the service start time</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#init-org.apache.hadoop.conf.Configuration-">init</a></span>(<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;config)</code>
<div class="block">Initialize the service.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#isInState-org.apache.hadoop.service.Service.STATE-">isInState</a></span>(<a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a>&nbsp;state)</code>
<div class="block">Query to see if the service is in a specific state.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#registerServiceListener-org.apache.hadoop.service.ServiceStateChangeListener-">registerServiceListener</a></span>(<a href="../../../../org/apache/hadoop/service/ServiceStateChangeListener.html" title="interface in org.apache.hadoop.service">ServiceStateChangeListener</a>&nbsp;listener)</code>
<div class="block">Register a listener to the service state change events.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#start--">start</a></span>()</code>
<div class="block">Start the service.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#stop--">stop</a></span>()</code>
<div class="block">Stop the service.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#unregisterServiceListener-org.apache.hadoop.service.ServiceStateChangeListener-">unregisterServiceListener</a></span>(<a href="../../../../org/apache/hadoop/service/ServiceStateChangeListener.html" title="interface in org.apache.hadoop.service">ServiceStateChangeListener</a>&nbsp;listener)</code>
<div class="block">Unregister a previously registered listener of the service state
change events.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/service/Service.html#waitForServiceToStop-long-">waitForServiceToStop</a></span>(long&nbsp;timeout)</code>
<div class="block">Block waiting for the service to stop; uses the termination notification
object to do so.</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="init-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>void&nbsp;init(<a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;config)</pre>
<div class="block">Initialize the service.
The transition MUST be from <a href="../../../../org/apache/hadoop/service/Service.STATE.html#NOTINITED"><code>Service.STATE.NOTINITED</code></a> to <a href="../../../../org/apache/hadoop/service/Service.STATE.html#INITED"><code>Service.STATE.INITED</code></a>
unless the operation failed and an exception was raised, in which case
<a href="../../../../org/apache/hadoop/service/Service.html#stop--"><code>stop()</code></a> MUST be invoked and the service enter the state
<a href="../../../../org/apache/hadoop/service/Service.STATE.html#STOPPED"><code>Service.STATE.STOPPED</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>config</code> - the configuration of the service</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - on any failure during the operation</dd>
</dl>
</li>
</ul>
<a name="start--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>void&nbsp;start()</pre>
<div class="block">Start the service.
The transition MUST be from <a href="../../../../org/apache/hadoop/service/Service.STATE.html#INITED"><code>Service.STATE.INITED</code></a> to <a href="../../../../org/apache/hadoop/service/Service.STATE.html#STARTED"><code>Service.STATE.STARTED</code></a>
unless the operation failed and an exception was raised, in which case
<a href="../../../../org/apache/hadoop/service/Service.html#stop--"><code>stop()</code></a> MUST be invoked and the service enter the state
<a href="../../../../org/apache/hadoop/service/Service.STATE.html#STOPPED"><code>Service.STATE.STOPPED</code></a>.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - on any failure during the operation</dd>
</dl>
</li>
</ul>
<a name="stop--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stop</h4>
<pre>void&nbsp;stop()</pre>
<div class="block">Stop the service. This MUST be a no-op if the service is already
in the <a href="../../../../org/apache/hadoop/service/Service.STATE.html#STOPPED"><code>Service.STATE.STOPPED</code></a> state. It SHOULD be a best-effort attempt
to stop all parts of the service.
The implementation must be designed to complete regardless of the service
state, including the initialized/uninitialized state of all its internal
fields.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - on any failure during the stop operation</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>void&nbsp;close()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">A version of stop() that is designed to be usable in Java7 closure
clauses.
Implementation classes MUST relay this directly to <a href="../../../../org/apache/hadoop/service/Service.html#stop--"><code>stop()</code></a></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true#close--" title="class or interface in java.lang">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a></code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true#close--" title="class or interface in java.io">close</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - never</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/RuntimeException.html?is-external=true" title="class or interface in java.lang">RuntimeException</a></code> - on any failure during the stop operation</dd>
</dl>
</li>
</ul>
<a name="registerServiceListener-org.apache.hadoop.service.ServiceStateChangeListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerServiceListener</h4>
<pre>void&nbsp;registerServiceListener(<a href="../../../../org/apache/hadoop/service/ServiceStateChangeListener.html" title="interface in org.apache.hadoop.service">ServiceStateChangeListener</a>&nbsp;listener)</pre>
<div class="block">Register a listener to the service state change events.
If the supplied listener is already listening to this service,
this method is a no-op.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - a new listener</dd>
</dl>
</li>
</ul>
<a name="unregisterServiceListener-org.apache.hadoop.service.ServiceStateChangeListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unregisterServiceListener</h4>
<pre>void&nbsp;unregisterServiceListener(<a href="../../../../org/apache/hadoop/service/ServiceStateChangeListener.html" title="interface in org.apache.hadoop.service">ServiceStateChangeListener</a>&nbsp;listener)</pre>
<div class="block">Unregister a previously registered listener of the service state
change events. No-op if the listener is already unregistered.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>listener</code> - the listener to unregister.</dd>
</dl>
</li>
</ul>
<a name="getName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getName()</pre>
<div class="block">Get the name of this service.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the service name</dd>
</dl>
</li>
</ul>
<a name="getConfig--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getConfig</h4>
<pre><a href="../../../../org/apache/hadoop/conf/Configuration.html" title="class in org.apache.hadoop.conf">Configuration</a>&nbsp;getConfig()</pre>
<div class="block">Get the configuration of this service.
This is normally not a clone and may be manipulated, though there are no
guarantees as to what the consequences of such actions may be</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current configuration, unless a specific implentation chooses
otherwise.</dd>
</dl>
</li>
</ul>
<a name="getServiceState--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getServiceState</h4>
<pre><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a>&nbsp;getServiceState()</pre>
<div class="block">Get the current service state</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the state of the service</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">Get the service start time</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the start time of the service. This will be zero if the service
has not yet been started.</dd>
</dl>
</li>
</ul>
<a name="isInState-org.apache.hadoop.service.Service.STATE-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInState</h4>
<pre>boolean&nbsp;isInState(<a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a>&nbsp;state)</pre>
<div class="block">Query to see if the service is in a specific state.
In a multi-threaded system, the state may not hold for very long.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>state</code> - the expected state</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if, at the time of invocation, the service was in that state.</dd>
</dl>
</li>
</ul>
<a name="getFailureCause--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFailureCause</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true" title="class or interface in java.lang">Throwable</a>&nbsp;getFailureCause()</pre>
<div class="block">Get the first exception raised during the service failure. If null,
no exception was logged</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the failure logged during a transition to the stopped state</dd>
</dl>
</li>
</ul>
<a name="getFailureState--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFailureState</h4>
<pre><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service">Service.STATE</a>&nbsp;getFailureState()</pre>
<div class="block">Get the state in which the failure in <a href="../../../../org/apache/hadoop/service/Service.html#getFailureCause--"><code>getFailureCause()</code></a> occurred.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the state or null if there was no failure</dd>
</dl>
</li>
</ul>
<a name="waitForServiceToStop-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>waitForServiceToStop</h4>
<pre>boolean&nbsp;waitForServiceToStop(long&nbsp;timeout)</pre>
<div class="block">Block waiting for the service to stop; uses the termination notification
object to do so.
This method will only return after all the service stop actions
have been executed (to success or failure), or the timeout elapsed
This method can be called before the service is inited or started; this is
to eliminate any race condition with the service stopping before
this event occurs.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>timeout</code> - timeout in milliseconds. A value of zero means "forever"</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff the service stopped in the time period</dd>
</dl>
</li>
</ul>
<a name="getLifecycleHistory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLifecycleHistory</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/hadoop/service/LifecycleEvent.html" title="class in org.apache.hadoop.service">LifecycleEvent</a>&gt;&nbsp;getLifecycleHistory()</pre>
<div class="block">Get a snapshot of the lifecycle history; it is a static list</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a possibly empty but never null list of lifecycle events.</dd>
</dl>
</li>
</ul>
<a name="getBlockers--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getBlockers</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;getBlockers()</pre>
<div class="block">Get the blockers on a service -remote dependencies
that are stopping the service from being <i>live</i>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a (snapshotted) map of blocker name-&gt;description values</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="class-use/Service.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/hadoop/service/LoggingStateChangeListener.html" title="class in org.apache.hadoop.service"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/hadoop/service/Service.STATE.html" title="enum in org.apache.hadoop.service"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/service/Service.html" target="_top">Frames</a></li>
<li><a href="Service.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><a href="#nested.class.summary">Nested</a>&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; 2008&#x2013;2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>