blob: 59642b5ffc0f8b6c24fb41f4ea5197eb255324ea [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 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ZKRegistry (Drill : 1.20.3 API)</title>
<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="ZKRegistry (Drill : 1.20.3 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance 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="class-use/ZKRegistry.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/drill/yarn/zk/ZKConfigException.html" title="class in org.apache.drill.yarn.zk"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.AckEvent.html" title="class in org.apache.drill.yarn.zk"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/drill/yarn/zk/ZKRegistry.html" target="_top">Frames</a></li>
<li><a href="ZKRegistry.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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.drill.yarn.zk</div>
<h2 title="Class ZKRegistry" class="title">Class ZKRegistry</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.drill.yarn.zk.ZKRegistry</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/drill/exec/work/foreman/DrillbitStatusListener.html" title="interface in org.apache.drill.exec.work.foreman">DrillbitStatusListener</a>, <a href="../../../../../org/apache/drill/yarn/appMaster/Pollable.html" title="interface in org.apache.drill.yarn.appMaster">Pollable</a>, <a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.html" title="interface in org.apache.drill.yarn.appMaster">TaskLifecycleListener</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">ZKRegistry</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.html" title="interface in org.apache.drill.yarn.appMaster">TaskLifecycleListener</a>, <a href="../../../../../org/apache/drill/exec/work/foreman/DrillbitStatusListener.html" title="interface in org.apache.drill.exec.work.foreman">DrillbitStatusListener</a>, <a href="../../../../../org/apache/drill/yarn/appMaster/Pollable.html" title="interface in org.apache.drill.yarn.appMaster">Pollable</a></pre>
<div class="block">AM-specific implementation of a Drillbit registry backed by ZooKeeper.
Listens to ZK events for registering a Drillbit and deregistering. Alerts the
Cluster Controller of these events.
<p>
Locking strategy: Receives events from both ZK and the cluster controller,
both of which must be synchronized. To prevent deadlocks, this class NEVER
calls into the cluster controller while holding a lock. This prevents the
following:
<p>
ClusterController --> ZKRegistry (OK) <br>
ZK --> ZKRegistry (OK) <br>
ZK --> ZKRegistry --> Cluster Controller (bad)
<p>
In the case of registration, ZK calls the registry which must alert the
cluster controller. Cluster controller alerting is handled outside the ZK
update critical section.
<p>
Because ZK events are occur relatively infrequently, any deadlock will occur
once in a blue moon, which will make it very hard to reproduce. So, extreme
caution is needed at design time to prevent the problem.</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">Class 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/drill/yarn/zk/ZKRegistry.AckEvent.html" title="class in org.apache.drill.yarn.zk">ZKRegistry.AckEvent</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.DrillbitTracker.html" title="class in org.apache.drill.yarn.zk">ZKRegistry.DrillbitTracker</a></span></code>
<div class="block">State of each Drillbit that we've discovered through ZK or launched via the
AM.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.drill.yarn.appMaster.TaskLifecycleListener">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;org.apache.drill.yarn.appMaster.<a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.html" title="interface in org.apache.drill.yarn.appMaster">TaskLifecycleListener</a></h3>
<code><a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.Event.html" title="enum in org.apache.drill.yarn.appMaster">TaskLifecycleListener.Event</a></code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <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/drill/yarn/zk/ZKRegistry.html#CONTROLLER_PROPERTY">CONTROLLER_PROPERTY</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <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/drill/yarn/zk/ZKRegistry.html#ENDPOINT_PROPERTY">ENDPOINT_PROPERTY</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#UPDATE_PERIOD_MS">UPDATE_PERIOD_MS</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== 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/drill/yarn/zk/ZKRegistry.html#ZKRegistry-org.apache.drill.yarn.zk.ZKClusterCoordinatorDriver-">ZKRegistry</a></span>(<a href="../../../../../org/apache/drill/yarn/zk/ZKClusterCoordinatorDriver.html" title="class in org.apache.drill.yarn.zk">ZKClusterCoordinatorDriver</a>&nbsp;zkDriver)</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="t2" class="tableTab"><span><a href="javascript:show(2);">Instance 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#drillbitRegistered-java.util.Set-">drillbitRegistered</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../../org/apache/drill/exec/proto/CoordinationProtos.DrillbitEndpoint.html" title="class in org.apache.drill.exec.proto">CoordinationProtos.DrillbitEndpoint</a>&gt;&nbsp;registeredDrillbits)</code>
<div class="block">Callback from ZK to indicate that one or more drillbits have become
registered.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#drillbitUnregistered-java.util.Set-">drillbitUnregistered</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../../org/apache/drill/exec/proto/CoordinationProtos.DrillbitEndpoint.html" title="class in org.apache.drill.exec.proto">CoordinationProtos.DrillbitEndpoint</a>&gt;&nbsp;unregisteredDrillbits)</code>
<div class="block">Callback from ZK to indicate that one or more drillbits have become
deregistered from ZK.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#finish-org.apache.drill.yarn.appMaster.RegistryHandler-">finish</a></span>(<a href="../../../../../org/apache/drill/yarn/appMaster/RegistryHandler.html" title="interface in org.apache.drill.yarn.appMaster">RegistryHandler</a>&nbsp;handler)</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected <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="../../../../../org/apache/drill/yarn/zk/ZKRegistry.DrillbitTracker.html" title="class in org.apache.drill.yarn.zk">ZKRegistry.DrillbitTracker</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#getRegistryForTesting--">getRegistryForTesting</a></span>()</code>
<div class="block">Get the current registry for testing.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#isRegistered-org.apache.drill.yarn.appMaster.Task-">isRegistered</a></span>(<a href="../../../../../org/apache/drill/yarn/appMaster/Task.html" title="class in org.apache.drill.yarn.appMaster">Task</a>&nbsp;task)</code>
<div class="block">Report whether the given task is still registered in ZK.</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="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/drill/yarn/zk/ZKRegistry.html#listUnmanagedDrillits--">listUnmanagedDrillits</a></span>()</code>&nbsp;</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/drill/yarn/zk/ZKRegistry.html#start-org.apache.drill.yarn.appMaster.RegistryHandler-">start</a></span>(<a href="../../../../../org/apache/drill/yarn/appMaster/RegistryHandler.html" title="interface in org.apache.drill.yarn.appMaster">RegistryHandler</a>&nbsp;controller)</code>
<div class="block">Called during AM startup to initialize ZK.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#stateChange-org.apache.drill.yarn.appMaster.TaskLifecycleListener.Event-org.apache.drill.yarn.appMaster.EventContext-">stateChange</a></span>(<a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.Event.html" title="enum in org.apache.drill.yarn.appMaster">TaskLifecycleListener.Event</a>&nbsp;event,
<a href="../../../../../org/apache/drill/yarn/appMaster/EventContext.html" title="class in org.apache.drill.yarn.appMaster">EventContext</a>&nbsp;context)</code>
<div class="block">Listen for selected YARN task state changes.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.html#tick-long-">tick</a></span>(long&nbsp;curTime)</code>
<div class="block">Periodically check ZK status.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="CONTROLLER_PROPERTY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CONTROLLER_PROPERTY</h4>
<pre>public static final&nbsp;<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> CONTROLLER_PROPERTY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.drill.yarn.zk.ZKRegistry.CONTROLLER_PROPERTY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="UPDATE_PERIOD_MS">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>UPDATE_PERIOD_MS</h4>
<pre>public static final&nbsp;int UPDATE_PERIOD_MS</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.drill.yarn.zk.ZKRegistry.UPDATE_PERIOD_MS">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="ENDPOINT_PROPERTY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ENDPOINT_PROPERTY</h4>
<pre>public static final&nbsp;<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> ENDPOINT_PROPERTY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.drill.yarn.zk.ZKRegistry.ENDPOINT_PROPERTY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="ZKRegistry-org.apache.drill.yarn.zk.ZKClusterCoordinatorDriver-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ZKRegistry</h4>
<pre>public&nbsp;ZKRegistry(<a href="../../../../../org/apache/drill/yarn/zk/ZKClusterCoordinatorDriver.html" title="class in org.apache.drill.yarn.zk">ZKClusterCoordinatorDriver</a>&nbsp;zkDriver)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="start-org.apache.drill.yarn.appMaster.RegistryHandler-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>public&nbsp;void&nbsp;start(<a href="../../../../../org/apache/drill/yarn/appMaster/RegistryHandler.html" title="interface in org.apache.drill.yarn.appMaster">RegistryHandler</a>&nbsp;controller)</pre>
<div class="block">Called during AM startup to initialize ZK. Checks if any Drillbits are
already running. These are "unmanaged" because the AM could not have
started them (since they predate the AM.)</div>
</li>
</ul>
<a name="drillbitRegistered-java.util.Set-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>drillbitRegistered</h4>
<pre>public&nbsp;void&nbsp;drillbitRegistered(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../../org/apache/drill/exec/proto/CoordinationProtos.DrillbitEndpoint.html" title="class in org.apache.drill.exec.proto">CoordinationProtos.DrillbitEndpoint</a>&gt;&nbsp;registeredDrillbits)</pre>
<div class="block">Callback from ZK to indicate that one or more drillbits have become
registered. We handle registrations in a critical section, then alert the
cluster controller outside the critical section.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/drill/exec/work/foreman/DrillbitStatusListener.html#drillbitRegistered-java.util.Set-">drillbitRegistered</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/drill/exec/work/foreman/DrillbitStatusListener.html" title="interface in org.apache.drill.exec.work.foreman">DrillbitStatusListener</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>registeredDrillbits</code> - the set of newly registered drillbits. Note: the complete set of currently registered bits could be different.</dd>
</dl>
</li>
</ul>
<a name="drillbitUnregistered-java.util.Set-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>drillbitUnregistered</h4>
<pre>public&nbsp;void&nbsp;drillbitUnregistered(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../../org/apache/drill/exec/proto/CoordinationProtos.DrillbitEndpoint.html" title="class in org.apache.drill.exec.proto">CoordinationProtos.DrillbitEndpoint</a>&gt;&nbsp;unregisteredDrillbits)</pre>
<div class="block">Callback from ZK to indicate that one or more drillbits have become
deregistered from ZK. We handle the deregistrations in a critical section,
but updates to the cluster controller outside of a critical section.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/drill/exec/work/foreman/DrillbitStatusListener.html#drillbitUnregistered-java.util.Set-">drillbitUnregistered</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/drill/exec/work/foreman/DrillbitStatusListener.html" title="interface in org.apache.drill.exec.work.foreman">DrillbitStatusListener</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>unregisteredDrillbits</code> - the set of newly unregistered drillbits.</dd>
</dl>
</li>
</ul>
<a name="stateChange-org.apache.drill.yarn.appMaster.TaskLifecycleListener.Event-org.apache.drill.yarn.appMaster.EventContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>stateChange</h4>
<pre>public&nbsp;void&nbsp;stateChange(<a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.Event.html" title="enum in org.apache.drill.yarn.appMaster">TaskLifecycleListener.Event</a>&nbsp;event,
<a href="../../../../../org/apache/drill/yarn/appMaster/EventContext.html" title="class in org.apache.drill.yarn.appMaster">EventContext</a>&nbsp;context)</pre>
<div class="block">Listen for selected YARN task state changes. Called from within the cluster
controller's critical section.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.html#stateChange-org.apache.drill.yarn.appMaster.TaskLifecycleListener.Event-org.apache.drill.yarn.appMaster.EventContext-">stateChange</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/drill/yarn/appMaster/TaskLifecycleListener.html" title="interface in org.apache.drill.yarn.appMaster">TaskLifecycleListener</a></code></dd>
</dl>
</li>
</ul>
<a name="isRegistered-org.apache.drill.yarn.appMaster.Task-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isRegistered</h4>
<pre>public&nbsp;boolean&nbsp;isRegistered(<a href="../../../../../org/apache/drill/yarn/appMaster/Task.html" title="class in org.apache.drill.yarn.appMaster">Task</a>&nbsp;task)</pre>
<div class="block">Report whether the given task is still registered in ZK. Called while
waiting for a deregistration event to catch possible cases where the
messages is lost. The message should never be lost, but we've seen
cases where tasks hang in this state. This is a potential work-around.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>task</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>True if the given task is regestered. False otherwise.</dd>
</dl>
</li>
</ul>
<a name="tick-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tick</h4>
<pre>public&nbsp;void&nbsp;tick(long&nbsp;curTime)</pre>
<div class="block">Periodically check ZK status. If the ZK connection has timed out, something
is very seriously wrong. Shut the whole Drill cluster down since Drill
cannot operate without ZooKeeper.
<p>
This method should not be synchronized. It checks only the ZK state, not
internal state. Further, if we do reconnect to ZK, then a ZK thread may
attempt to update this registry, which will acquire a synchronization lock.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/drill/yarn/appMaster/Pollable.html#tick-long-">tick</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/drill/yarn/appMaster/Pollable.html" title="interface in org.apache.drill.yarn.appMaster">Pollable</a></code></dd>
</dl>
</li>
</ul>
<a name="finish-org.apache.drill.yarn.appMaster.RegistryHandler-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>finish</h4>
<pre>public&nbsp;void&nbsp;finish(<a href="../../../../../org/apache/drill/yarn/appMaster/RegistryHandler.html" title="interface in org.apache.drill.yarn.appMaster">RegistryHandler</a>&nbsp;handler)</pre>
</li>
</ul>
<a name="listUnmanagedDrillits--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>listUnmanagedDrillits</h4>
<pre>public&nbsp;<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="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;listUnmanagedDrillits()</pre>
</li>
</ul>
<a name="getRegistryForTesting--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getRegistryForTesting</h4>
<pre>protected&nbsp;<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="../../../../../org/apache/drill/yarn/zk/ZKRegistry.DrillbitTracker.html" title="class in org.apache.drill.yarn.zk">ZKRegistry.DrillbitTracker</a>&gt;&nbsp;getRegistryForTesting()</pre>
<div class="block">Get the current registry for testing. Why for testing? Because this is
unsynchronized. In production code, the map may change out from under you.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The current registry.</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/ZKRegistry.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/drill/yarn/zk/ZKConfigException.html" title="class in org.apache.drill.yarn.zk"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/drill/yarn/zk/ZKRegistry.AckEvent.html" title="class in org.apache.drill.yarn.zk"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/drill/yarn/zk/ZKRegistry.html" target="_top">Frames</a></li>
<li><a href="ZKRegistry.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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 ======= -->
<p class="legalCopy"><small>Copyright &#169; 1970 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>