blob: 7aef4d2b26acc98943f9949f0023de9e7976f17b [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:10:59 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LocalityMulticastAMRMProxyPolicy (Apache Hadoop YARN Server 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="LocalityMulticastAMRMProxyPolicy (Apache Hadoop YARN Server Common 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":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/LocalityMulticastAMRMProxyPolicy.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/yarn/server/federation/policies/amrmproxy/HomeAMRMProxyPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html" target="_top">Frames</a></li>
<li><a href="LocalityMulticastAMRMProxyPolicy.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.hadoop.yarn.server.federation.policies.amrmproxy</div>
<h2 title="Class LocalityMulticastAMRMProxyPolicy" class="title">Class LocalityMulticastAMRMProxyPolicy</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><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies">org.apache.hadoop.yarn.server.federation.policies.AbstractConfigurableFederationPolicy</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/AbstractAMRMProxyPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">org.apache.hadoop.yarn.server.federation.policies.amrmproxy.AbstractAMRMProxyPolicy</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.yarn.server.federation.policies.amrmproxy.LocalityMulticastAMRMProxyPolicy</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/FederationAMRMProxyPolicy.html" title="interface in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">FederationAMRMProxyPolicy</a>, <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/ConfigurableFederationPolicy.html" title="interface in org.apache.hadoop.yarn.server.federation.policies">ConfigurableFederationPolicy</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">LocalityMulticastAMRMProxyPolicy</span>
extends <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/AbstractAMRMProxyPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">AbstractAMRMProxyPolicy</a></pre>
<div class="block">An implementation of the <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/FederationAMRMProxyPolicy.html" title="interface in org.apache.hadoop.yarn.server.federation.policies.amrmproxy"><code>FederationAMRMProxyPolicy</code></a> interface that
carefully multicasts the requests with the following behavior:
<p>
Host localized <code>ResourceRequest</code>s are always forwarded to the RM that
owns the corresponding node, based on the feedback of a
<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/resolver/SubClusterResolver.html" title="interface in org.apache.hadoop.yarn.server.federation.resolver"><code>SubClusterResolver</code></a>. If the <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/resolver/SubClusterResolver.html" title="interface in org.apache.hadoop.yarn.server.federation.resolver"><code>SubClusterResolver</code></a> cannot resolve
this node we default to forwarding the <code>ResourceRequest</code> to the home
sub-cluster.
</p>
<p>
Rack localized <code>ResourceRequest</code>s are forwarded to the RMs that owns
the corresponding rack. Note that in some deployments each rack could be
striped across multiple RMs. This policy respects that. If the
<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/resolver/SubClusterResolver.html" title="interface in org.apache.hadoop.yarn.server.federation.resolver"><code>SubClusterResolver</code></a> cannot resolve this rack we default to forwarding
the <code>ResourceRequest</code> to the home sub-cluster.
</p>
<p>
ANY requests corresponding to node/rack local requests are forwarded only to
the set of RMs that owns the corresponding localized requests. The number of
containers listed in each ANY is proportional to the number of localized
container requests (associated to this ANY via the same allocateRequestId).
</p>
<p>
ANY that are not associated to node/rack local requests are split among RMs
based on the "weights" in the <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/dao/WeightedPolicyInfo.html" title="class in org.apache.hadoop.yarn.server.federation.policies.dao"><code>WeightedPolicyInfo</code></a> configuration *and*
headroom information. The <code>headroomAlpha</code> parameter of the policy
configuration indicates how much headroom contributes to the splitting
choice. Value of 1.0f indicates the weights are interpreted only as 0/1
boolean but all splitting is based on the advertised headroom (fallback to
1/N for RMs that we don't have headroom info from). An <code>headroomAlpha</code>
value of 0.0f means headroom is ignored and all splitting decisions are
proportional to the "weights" in the configuration of the policy.
</p>
<p>
ANY of zero size are forwarded to all known subclusters (i.e., subclusters
where we scheduled containers before), as they may represent a user attempt
to cancel a previous request (and we are mostly stateless now, so should
forward to all known RMs).
</p>
<p>
Invariants:
</p>
<p>
The policy always excludes non-active RMs.
</p>
<p>
The policy always excludes RMs that do not appear in the policy configuration
weights, or have a weight of 0 (even if localized resources explicit refer to
it).
</p>
<p>
(Bar rounding to closest ceiling of fractional containers) The sum of
requests made to multiple RMs at the ANY level "adds-up" to the user request.
The maximum possible excess in a given request is a number of containers less
or equal to number of sub-clusters in the federation.
</p></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>protected class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper</a></span></code>
<div class="block">This helper class is used to book-keep the requests made to each
subcluster, and maintain useful statistics to split ANY requests.</div>
</td>
</tr>
</table>
</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 org.slf4j.Logger</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#LOG">LOG</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/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#LocalityMulticastAMRMProxyPolicy--">LocalityMulticastAMRMProxyPolicy</a></span>()</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>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#computeIntegerAssignment-int-java.util.ArrayList-">computeIntegerAssignment</a></span>(int&nbsp;totalNum,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</a>&gt;&nbsp;weightsList)</code>
<div class="block">Split the integer into bins according to the weights.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#getSubClusterForUnResolvedRequest-org.apache.hadoop.yarn.server.federation.policies.amrmproxy.LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper-long-">getSubClusterForUnResolvedRequest</a></span>(<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper</a>&nbsp;bookKeeper,
long&nbsp;allocationId)</code>
<div class="block">For unit test to override.</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/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#notifyOfResponse-org.apache.hadoop.yarn.server.federation.store.records.SubClusterId-org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse-">notifyOfResponse</a></span>(<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>&nbsp;subClusterId,
org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse&nbsp;response)</code>
<div class="block">This method should be invoked to notify the policy about responses being
received.</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/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#reinitialize-org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext-">reinitialize</a></span>(<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/FederationPolicyInitializationContext.html" title="class in org.apache.hadoop.yarn.server.federation.policies">FederationPolicyInitializationContext</a>&nbsp;policyContext)</code>
<div class="block">This method is invoked to initialize of update the configuration of
policies.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<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="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>,<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;org.apache.hadoop.yarn.api.records.ResourceRequest&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html#splitResourceRequests-java.util.List-java.util.Set-">splitResourceRequests</a></span>(<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;org.apache.hadoop.yarn.api.records.ResourceRequest&gt;&nbsp;resourceRequests,
<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/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>&gt;&nbsp;timedOutSubClusters)</code>
<div class="block">Splits the <code>ResourceRequest</code>s from the client across one or more
sub-clusters based on the policy semantics (e.g., broadcast, load-based).</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.yarn.server.federation.policies.amrmproxy.AbstractAMRMProxyPolicy">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.hadoop.yarn.server.federation.policies.amrmproxy.<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/AbstractAMRMProxyPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">AbstractAMRMProxyPolicy</a></h3>
<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/AbstractAMRMProxyPolicy.html#validate-org.apache.hadoop.yarn.server.federation.policies.dao.WeightedPolicyInfo-">validate</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.yarn.server.federation.policies.AbstractConfigurableFederationPolicy">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.hadoop.yarn.server.federation.policies.<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies">AbstractConfigurableFederationPolicy</a></h3>
<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#getActiveSubclusters--">getActiveSubclusters</a>, <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#getIsDirty--">getIsDirty</a>, <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#getPolicyContext--">getPolicyContext</a>, <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#getPolicyInfo--">getPolicyInfo</a>, <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#setPolicyContext-org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext-">setPolicyContext</a>, <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#setPolicyInfo-org.apache.hadoop.yarn.server.federation.policies.dao.WeightedPolicyInfo-">setPolicyInfo</a></code></li>
</ul>
<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="LOG">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LOG</h4>
<pre>public static final&nbsp;org.slf4j.Logger LOG</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="LocalityMulticastAMRMProxyPolicy--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LocalityMulticastAMRMProxyPolicy</h4>
<pre>public&nbsp;LocalityMulticastAMRMProxyPolicy()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="reinitialize-org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reinitialize</h4>
<pre>public&nbsp;void&nbsp;reinitialize(<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/FederationPolicyInitializationContext.html" title="class in org.apache.hadoop.yarn.server.federation.policies">FederationPolicyInitializationContext</a>&nbsp;policyContext)
throws <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/exceptions/FederationPolicyInitializationException.html" title="class in org.apache.hadoop.yarn.server.federation.policies.exceptions">FederationPolicyInitializationException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/ConfigurableFederationPolicy.html#reinitialize-org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext-">ConfigurableFederationPolicy</a></code></span></div>
<div class="block">This method is invoked to initialize of update the configuration of
policies. The implementor should provide try-n-swap semantics, and retain
state if possible.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/ConfigurableFederationPolicy.html#reinitialize-org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext-">reinitialize</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/ConfigurableFederationPolicy.html" title="interface in org.apache.hadoop.yarn.server.federation.policies">ConfigurableFederationPolicy</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html#reinitialize-org.apache.hadoop.yarn.server.federation.policies.FederationPolicyInitializationContext-">reinitialize</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/AbstractConfigurableFederationPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies">AbstractConfigurableFederationPolicy</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>policyContext</code> - the new context to provide to implementor.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/exceptions/FederationPolicyInitializationException.html" title="class in org.apache.hadoop.yarn.server.federation.policies.exceptions">FederationPolicyInitializationException</a></code> - in case the initialization
fails.</dd>
</dl>
</li>
</ul>
<a name="notifyOfResponse-org.apache.hadoop.yarn.server.federation.store.records.SubClusterId-org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>notifyOfResponse</h4>
<pre>public&nbsp;void&nbsp;notifyOfResponse(<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>&nbsp;subClusterId,
org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse&nbsp;response)
throws org.apache.hadoop.yarn.exceptions.YarnException</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/FederationAMRMProxyPolicy.html#notifyOfResponse-org.apache.hadoop.yarn.server.federation.store.records.SubClusterId-org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse-">FederationAMRMProxyPolicy</a></code></span></div>
<div class="block">This method should be invoked to notify the policy about responses being
received. This is useful for stateful policies that make decisions based on
previous responses being received.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/FederationAMRMProxyPolicy.html#notifyOfResponse-org.apache.hadoop.yarn.server.federation.store.records.SubClusterId-org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse-">notifyOfResponse</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/FederationAMRMProxyPolicy.html" title="interface in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">FederationAMRMProxyPolicy</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/AbstractAMRMProxyPolicy.html#notifyOfResponse-org.apache.hadoop.yarn.server.federation.store.records.SubClusterId-org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse-">notifyOfResponse</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/AbstractAMRMProxyPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">AbstractAMRMProxyPolicy</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>subClusterId</code> - the id of the subcluster sending the notification</dd>
<dd><code>response</code> - the response received from one of the RMs</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.apache.hadoop.yarn.exceptions.YarnException</code> - in case the response is not valid</dd>
</dl>
</li>
</ul>
<a name="splitResourceRequests-java.util.List-java.util.Set-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>splitResourceRequests</h4>
<pre>public&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="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>,<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;org.apache.hadoop.yarn.api.records.ResourceRequest&gt;&gt;&nbsp;splitResourceRequests(<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;org.apache.hadoop.yarn.api.records.ResourceRequest&gt;&nbsp;resourceRequests,
<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/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>&gt;&nbsp;timedOutSubClusters)
throws org.apache.hadoop.yarn.exceptions.YarnException</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/FederationAMRMProxyPolicy.html#splitResourceRequests-java.util.List-java.util.Set-">FederationAMRMProxyPolicy</a></code></span></div>
<div class="block">Splits the <code>ResourceRequest</code>s from the client across one or more
sub-clusters based on the policy semantics (e.g., broadcast, load-based).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>resourceRequests</code> - the list of <code>ResourceRequest</code>s from the AM to
be split</dd>
<dd><code>timedOutSubClusters</code> - the set of sub-clusters that haven't had a
successful heart-beat response for a while.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>map of sub-cluster as identified by <a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records"><code>SubClusterId</code></a> to the
list of <code>ResourceRequest</code>s that should be forwarded to it</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.apache.hadoop.yarn.exceptions.YarnException</code> - in case the request is malformed or no viable
sub-clusters can be found.</dd>
</dl>
</li>
</ul>
<a name="getSubClusterForUnResolvedRequest-org.apache.hadoop.yarn.server.federation.policies.amrmproxy.LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSubClusterForUnResolvedRequest</h4>
<pre>protected&nbsp;<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/store/records/SubClusterId.html" title="class in org.apache.hadoop.yarn.server.federation.store.records">SubClusterId</a>&nbsp;getSubClusterForUnResolvedRequest(<a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy">LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper</a>&nbsp;bookKeeper,
long&nbsp;allocationId)</pre>
<div class="block">For unit test to override.</div>
</li>
</ul>
<a name="computeIntegerAssignment-int-java.util.ArrayList-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>computeIntegerAssignment</h4>
<pre>protected&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;computeIntegerAssignment(int&nbsp;totalNum,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html?is-external=true" title="class or interface in java.util">ArrayList</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Float.html?is-external=true" title="class or interface in java.lang">Float</a>&gt;&nbsp;weightsList)
throws org.apache.hadoop.yarn.exceptions.YarnException</pre>
<div class="block">Split the integer into bins according to the weights.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>totalNum</code> - total number of containers to split</dd>
<dd><code>weightsList</code> - the weights for each subcluster</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the container allocation after split</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.apache.hadoop.yarn.exceptions.YarnException</code> - if fails</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/LocalityMulticastAMRMProxyPolicy.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/yarn/server/federation/policies/amrmproxy/HomeAMRMProxyPolicy.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../../../org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.AllocationBookkeeper.html" title="class in org.apache.hadoop.yarn.server.federation.policies.amrmproxy"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/apache/hadoop/yarn/server/federation/policies/amrmproxy/LocalityMulticastAMRMProxyPolicy.html" target="_top">Frames</a></li>
<li><a href="LocalityMulticastAMRMProxyPolicy.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; 2008&#x2013;2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>