blob: fbc4548ea3b6102ccb401d40198db6fbfdd69e17 [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:09:34 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Resource (Apache Hadoop YARN API 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="Resource (Apache Hadoop YARN API 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":9,"i3":10,"i4":10,"i5":10,"i6":38,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":6,"i13":10,"i14":9,"i15":9,"i16":9,"i17":9,"i18":9,"i19":38,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":6,"i26":10,"i27":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/Resource.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/api/records/ReservationRequests.html" title="class in org.apache.hadoop.yarn.api.records"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceAllocationRequest.html" title="class in org.apache.hadoop.yarn.api.records"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/yarn/api/records/Resource.html" target="_top">Frames</a></li>
<li><a href="Resource.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><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.api.records</div>
<h2 title="Class Resource" class="title">Class Resource</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.hadoop.yarn.api.records.Resource</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&gt;</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html" title="class in org.apache.hadoop.yarn.api.records.impl">LightWeightResource</a></dd>
</dl>
<hr>
<br>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class <span class="typeNameLabel">Resource</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="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&gt;</pre>
<div class="block"><p><code>Resource</code> models a set of computer resources in the
cluster.</p>
<p>Currently it models both <em>memory</em> and <em>CPU</em>.</p>
<p>The unit for memory is megabytes. CPU is modeled with virtual cores
(vcores), a unit for expressing parallelism. A node's capacity should
be configured with virtual cores equal to its number of physical cores. A
container should be requested with the number of cores it can saturate, i.e.
the average number of threads it expects to have runnable at a time.</p>
<p>Virtual cores take integer values and thus currently CPU-scheduling is
very coarse. A complementary axis for CPU requests that represents
processing power will likely be added in the future to enable finer-grained
resource configuration.</p>
<p>Typically, applications request <code>Resource</code> of suitable
capability to run their component tasks.</p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceRequest.html" title="class in org.apache.hadoop.yarn.api.records"><code>ResourceRequest</code></a>,
<a href="../../../../../../org/apache/hadoop/yarn/api/ApplicationMasterProtocol.html#allocate-org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest-"><code>ApplicationMasterProtocol.allocate(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest)</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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 int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#MEMORY_INDEX">MEMORY_INDEX</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#resources">resources</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/hadoop/yarn/api/records/Resource.html#VCORES_INDEX">VCORES_INDEX</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/api/records/Resource.html#Resource--">Resource</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated 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 static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#castToIntSafely-long-">castToIntSafely</a></span>(long&nbsp;value)</code>
<div class="block">Convert long to int for a resource value safely.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#compareTo-org.apache.hadoop.yarn.api.records.Resource-">compareTo</a></span>(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;other)</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#copy-org.apache.hadoop.yarn.api.records.Resource-org.apache.hadoop.yarn.api.records.Resource-">copy</a></span>(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;source,
<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;dest)</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#equals-java.lang.Object-">equals</a></span>(<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>&nbsp;obj)</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<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/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getAllResourcesListCopy--">getAllResourcesListCopy</a></span>()</code>
<div class="block">Get list of resource information, this will be used by JAXB.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<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/yarn/api/records/Resource.html#getFormattedString--">getFormattedString</a></span>()</code>
<div class="block">This method is to get memory in terms of KB|MB|GB.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemory--">getMemory</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemorySize--">getMemorySize</a></span>()</code>
<div class="block">Get <em>memory</em> of the resource.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResourceInformation-int-">getResourceInformation</a></span>(int&nbsp;index)</code>
<div class="block">Get ResourceInformation for a specified resource from a given index.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResourceInformation-java.lang.String-">getResourceInformation</a></span>(<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;resource)</code>
<div class="block">Get ResourceInformation for a specified resource.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResources--">getResources</a></span>()</code>
<div class="block">Get ResourceInformation for all resources.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResourceValue-java.lang.String-">getResourceValue</a></span>(<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;resource)</code>
<div class="block">Get the value for a specified resource.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getVirtualCores--">getVirtualCores</a></span>()</code>
<div class="block">Get <em>number of virtual cpu cores</em> of the resource.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#hashCode--">hashCode</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>protected static <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newDefaultInformation-java.lang.String-java.lang.String-long-">newDefaultInformation</a></span>(<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;name,
<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;unit,
long&nbsp;value)</code>
<div class="block">Create ResourceInformation with basic fields.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-int-int-">newInstance</a></span>(int&nbsp;memory,
int&nbsp;vCores)</code>&nbsp;</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-long-int-">newInstance</a></span>(long&nbsp;memory,
int&nbsp;vCores)</code>&nbsp;</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-long-int-java.util.Map-">newInstance</a></span>(long&nbsp;memory,
int&nbsp;vCores,
<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/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;others)</code>
<div class="block">Create a new <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records"><code>Resource</code></a> instance with the given CPU and memory
values and additional resource values as set in the <code>others</code>
parameter.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-org.apache.hadoop.yarn.api.records.Resource-">newInstance</a></span>(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;resource)</code>&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setMemory-int-">setMemory</a></span>(int&nbsp;memory)</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setMemorySize-long-">setMemorySize</a></span>(long&nbsp;memory)</code>
<div class="block">Set <em>memory</em> of the resource.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceInformation-int-org.apache.hadoop.yarn.api.records.ResourceInformation-">setResourceInformation</a></span>(int&nbsp;index,
<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;resourceInformation)</code>
<div class="block">Set the ResourceInformation object for a particular resource.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceInformation-java.lang.String-org.apache.hadoop.yarn.api.records.ResourceInformation-">setResourceInformation</a></span>(<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;resource,
<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;resourceInformation)</code>
<div class="block">Set the ResourceInformation object for a particular resource.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceValue-int-long-">setResourceValue</a></span>(int&nbsp;index,
long&nbsp;value)</code>
<div class="block">Set the value of a resource in the ResourceInformation object.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceValue-java.lang.String-long-">setResourceValue</a></span>(<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;resource,
long&nbsp;value)</code>
<div class="block">Set the value of a resource in the ResourceInformation object.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setVirtualCores-int-">setVirtualCores</a></span>(int&nbsp;vCores)</code>
<div class="block">Set <em>number of virtual cpu cores</em> of the resource.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#throwExceptionWhenArrayOutOfBound-int-">throwExceptionWhenArrayOutOfBound</a></span>(int&nbsp;index)</code>&nbsp;</td>
</tr>
<tr id="i27" class="rowColor">
<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/yarn/api/records/Resource.html#toString--">toString</a></span>()</code>&nbsp;</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#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#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#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="resources">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resources</h4>
<pre>protected&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[] resources</pre>
</li>
</ul>
<a name="MEMORY_INDEX">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MEMORY_INDEX</h4>
<pre>@InterfaceAudience.Private
public static final&nbsp;int MEMORY_INDEX</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.yarn.api.records.Resource.MEMORY_INDEX">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="VCORES_INDEX">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>VCORES_INDEX</h4>
<pre>@InterfaceAudience.Private
public static final&nbsp;int VCORES_INDEX</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.hadoop.yarn.api.records.Resource.VCORES_INDEX">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="Resource--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Resource</h4>
<pre>public&nbsp;Resource()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="newInstance-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newInstance</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public static&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;newInstance(int&nbsp;memory,
int&nbsp;vCores)</pre>
</li>
</ul>
<a name="newInstance-long-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newInstance</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public static&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;newInstance(long&nbsp;memory,
int&nbsp;vCores)</pre>
</li>
</ul>
<a name="newInstance-long-int-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newInstance</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public static&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;newInstance(long&nbsp;memory,
int&nbsp;vCores,
<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/Long.html?is-external=true" title="class or interface in java.lang">Long</a>&gt;&nbsp;others)</pre>
<div class="block">Create a new <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records"><code>Resource</code></a> instance with the given CPU and memory
values and additional resource values as set in the <code>others</code>
parameter. Note that the CPU and memory settings in the <code>others</code>
parameter will be ignored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>memory</code> - the memory value</dd>
<dd><code>vCores</code> - the CPU value</dd>
<dd><code>others</code> - a map of other resource values indexed by resource name</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records"><code>Resource</code></a> instance with the given resource values</dd>
</dl>
</li>
</ul>
<a name="newInstance-org.apache.hadoop.yarn.api.records.Resource-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newInstance</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public static&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;newInstance(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;resource)</pre>
</li>
</ul>
<a name="copy-org.apache.hadoop.yarn.api.records.Resource-org.apache.hadoop.yarn.api.records.Resource-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public static&nbsp;void&nbsp;copy(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;source,
<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;dest)</pre>
</li>
</ul>
<a name="getMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMemory</h4>
<pre>@InterfaceAudience.Public
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public abstract&nbsp;int&nbsp;getMemory()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">This method is DEPRECATED:
Use <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemorySize--"><code>getMemorySize()</code></a> instead
Get <em>memory</em> of the resource. Note - while memory has
never had a unit specified, all YARN configurations have specified memory
in MB. The assumption has been that the daemons and applications are always
using the same units. With the introduction of the ResourceInformation
class we have support for units - so this function will continue to return
memory but in the units of MB</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><em>memory</em>(in MB) of the resource</dd>
</dl>
</li>
</ul>
<a name="getMemorySize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMemorySize</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public&nbsp;long&nbsp;getMemorySize()</pre>
<div class="block">Get <em>memory</em> of the resource. Note - while memory has
never had a unit specified, all YARN configurations have specified memory
in MB. The assumption has been that the daemons and applications are always
using the same units. With the introduction of the ResourceInformation
class we have support for units - so this function will continue to return
memory but in the units of MB</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><em>memory</em> of the resource</dd>
</dl>
</li>
</ul>
<a name="setMemory-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMemory</h4>
<pre>@InterfaceAudience.Public
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public abstract&nbsp;void&nbsp;setMemory(int&nbsp;memory)</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;</div>
<div class="block">Set <em>memory</em> of the resource. Note - while memory has
never had a unit specified, all YARN configurations have specified memory
in MB. The assumption has been that the daemons and applications are always
using the same units. With the introduction of the ResourceInformation
class we have support for units - so this function will continue to set
memory but the assumption is that the value passed is in units of MB.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>memory</code> - <em>memory</em>(in MB) of the resource</dd>
</dl>
</li>
</ul>
<a name="setMemorySize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMemorySize</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Stable
public&nbsp;void&nbsp;setMemorySize(long&nbsp;memory)</pre>
<div class="block">Set <em>memory</em> of the resource.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>memory</code> - <em>memory</em> of the resource</dd>
</dl>
</li>
</ul>
<a name="getVirtualCores--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVirtualCores</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract&nbsp;int&nbsp;getVirtualCores()</pre>
<div class="block">Get <em>number of virtual cpu cores</em> of the resource.
Virtual cores are a unit for expressing CPU parallelism. A node's capacity
should be configured with virtual cores equal to its number of physical
cores. A container should be requested with the number of cores it can
saturate, i.e. the average number of threads it expects to have runnable
at a time.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><em>num of virtual cpu cores</em> of the resource</dd>
</dl>
</li>
</ul>
<a name="setVirtualCores-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVirtualCores</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Evolving
public abstract&nbsp;void&nbsp;setVirtualCores(int&nbsp;vCores)</pre>
<div class="block">Set <em>number of virtual cpu cores</em> of the resource.
Virtual cores are a unit for expressing CPU parallelism. A node's capacity
should be configured with virtual cores equal to its number of physical
cores. A container should be requested with the number of cores it can
saturate, i.e. the average number of threads it expects to have runnable
at a time.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vCores</code> - <em>number of virtual cpu cores</em> of the resource</dd>
</dl>
</li>
</ul>
<a name="getResources--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResources</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[]&nbsp;getResources()</pre>
<div class="block">Get ResourceInformation for all resources.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Map of resource name to ResourceInformation</dd>
</dl>
</li>
</ul>
<a name="getAllResourcesListCopy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAllResourcesListCopy</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
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="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&gt;&nbsp;getAllResourcesListCopy()</pre>
<div class="block">Get list of resource information, this will be used by JAXB.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>list of resources copy.</dd>
</dl>
</li>
</ul>
<a name="getResourceInformation-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResourceInformation</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Unstable
public&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;getResourceInformation(<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;resource)</pre>
<div class="block">Get ResourceInformation for a specified resource.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>resource</code> - name of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the ResourceInformation object for the resource</dd>
</dl>
</li>
</ul>
<a name="getResourceInformation-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResourceInformation</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;getResourceInformation(int&nbsp;index)
throws <a href="../../../../../../org/apache/hadoop/yarn/exceptions/ResourceNotFoundException.html" title="class in org.apache.hadoop.yarn.exceptions">ResourceNotFoundException</a></pre>
<div class="block">Get ResourceInformation for a specified resource from a given index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the ResourceInformation object for the resource</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/yarn/exceptions/ResourceNotFoundException.html" title="class in org.apache.hadoop.yarn.exceptions">ResourceNotFoundException</a></code> - if the resource can't be found</dd>
</dl>
</li>
</ul>
<a name="getResourceValue-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResourceValue</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Unstable
public&nbsp;long&nbsp;getResourceValue(<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;resource)</pre>
<div class="block">Get the value for a specified resource. No information about the units is
returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>resource</code> - name of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value for the resource</dd>
</dl>
</li>
</ul>
<a name="setResourceInformation-java.lang.String-org.apache.hadoop.yarn.api.records.ResourceInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setResourceInformation</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Unstable
public&nbsp;void&nbsp;setResourceInformation(<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;resource,
<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;resourceInformation)</pre>
<div class="block">Set the ResourceInformation object for a particular resource.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>resource</code> - the resource for which the ResourceInformation is provided</dd>
<dd><code>resourceInformation</code> - ResourceInformation object</dd>
</dl>
</li>
</ul>
<a name="setResourceInformation-int-org.apache.hadoop.yarn.api.records.ResourceInformation-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setResourceInformation</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public&nbsp;void&nbsp;setResourceInformation(int&nbsp;index,
<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;resourceInformation)
throws <a href="../../../../../../org/apache/hadoop/yarn/exceptions/ResourceNotFoundException.html" title="class in org.apache.hadoop.yarn.exceptions">ResourceNotFoundException</a></pre>
<div class="block">Set the ResourceInformation object for a particular resource.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - the resource index for which the ResourceInformation is provided</dd>
<dd><code>resourceInformation</code> - ResourceInformation object</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/yarn/exceptions/ResourceNotFoundException.html" title="class in org.apache.hadoop.yarn.exceptions">ResourceNotFoundException</a></code> - if the resource is not found</dd>
</dl>
</li>
</ul>
<a name="setResourceValue-java.lang.String-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setResourceValue</h4>
<pre>@InterfaceAudience.Public
@InterfaceStability.Unstable
public&nbsp;void&nbsp;setResourceValue(<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;resource,
long&nbsp;value)</pre>
<div class="block">Set the value of a resource in the ResourceInformation object. The unit of
the value is assumed to be the one in the ResourceInformation object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>resource</code> - the resource for which the value is provided.</dd>
<dd><code>value</code> - the value to set</dd>
</dl>
</li>
</ul>
<a name="setResourceValue-int-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setResourceValue</h4>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public&nbsp;void&nbsp;setResourceValue(int&nbsp;index,
long&nbsp;value)
throws <a href="../../../../../../org/apache/hadoop/yarn/exceptions/ResourceNotFoundException.html" title="class in org.apache.hadoop.yarn.exceptions">ResourceNotFoundException</a></pre>
<div class="block">Set the value of a resource in the ResourceInformation object. The unit of
the value is assumed to be the one in the ResourceInformation object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - the resource index for which the value is provided.</dd>
<dd><code>value</code> - the value to set</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/hadoop/yarn/exceptions/ResourceNotFoundException.html" title="class in org.apache.hadoop.yarn.exceptions">ResourceNotFoundException</a></code> - if the resource is not found</dd>
</dl>
</li>
</ul>
<a name="throwExceptionWhenArrayOutOfBound-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>throwExceptionWhenArrayOutOfBound</h4>
<pre>protected&nbsp;void&nbsp;throwExceptionWhenArrayOutOfBound(int&nbsp;index)</pre>
</li>
</ul>
<a name="equals-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;equals(<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>&nbsp;obj)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><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></code>&nbsp;in class&nbsp;<code><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></code></dd>
</dl>
</li>
</ul>
<a name="compareTo-org.apache.hadoop.yarn.api.records.Resource-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compareTo</h4>
<pre>public&nbsp;int&nbsp;compareTo(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&nbsp;other)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true#compareTo-T-" title="class or interface in java.lang">compareTo</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&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>&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><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></code>&nbsp;in class&nbsp;<code><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></code></dd>
</dl>
</li>
</ul>
<a name="getFormattedString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFormattedString</h4>
<pre>public&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>&nbsp;getFormattedString()</pre>
<div class="block">This method is to get memory in terms of KB|MB|GB.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>string containing all resources</dd>
</dl>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><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></code>&nbsp;in class&nbsp;<code><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></code></dd>
</dl>
</li>
</ul>
<a name="castToIntSafely-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>castToIntSafely</h4>
<pre>protected static&nbsp;int&nbsp;castToIntSafely(long&nbsp;value)</pre>
<div class="block">Convert long to int for a resource value safely. This method assumes
resource value is positive.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - long resource value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>int resource value</dd>
</dl>
</li>
</ul>
<a name="newDefaultInformation-java.lang.String-java.lang.String-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>newDefaultInformation</h4>
<pre>protected static&nbsp;<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>&nbsp;newDefaultInformation(<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;name,
<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;unit,
long&nbsp;value)</pre>
<div class="block">Create ResourceInformation with basic fields.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - Resource Type Name</dd>
<dd><code>unit</code> - Default unit of provided resource type</dd>
<dd><code>value</code> - Value associated with giveb resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>ResourceInformation object</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/Resource.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/api/records/ReservationRequests.html" title="class in org.apache.hadoop.yarn.api.records"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceAllocationRequest.html" title="class in org.apache.hadoop.yarn.api.records"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/hadoop/yarn/api/records/Resource.html" target="_top">Frames</a></li>
<li><a href="Resource.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><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>