blob: 2fbc0d5ef9c44550c94189170ce46fdfa69e5c99 [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>LightWeightResource (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="LightWeightResource (Apache Hadoop YARN API 3.3.1 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/LightWeightResource.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>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html" target="_top">Frames</a></li>
<li><a href="LightWeightResource.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="#fields.inherited.from.class.org.apache.hadoop.yarn.api.records.Resource">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>Field&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.impl</div>
<h2 title="Class LightWeightResource" class="title">Class LightWeightResource</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/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">org.apache.hadoop.yarn.api.records.Resource</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.yarn.api.records.impl.LightWeightResource</li>
</ul>
</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>
<hr>
<br>
<pre>@InterfaceAudience.Private
@InterfaceStability.Unstable
public class <span class="typeNameLabel">LightWeightResource</span>
extends <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></pre>
<div class="block"><p>
<code>LightWeightResource</code> extends Resource to handle base resources such
as memory and CPU.
TODO: We have a long term plan to use AbstractResource when additional
resource types are to be handled as well.
This will be used to speed up internal calculation to avoid creating
costly PB-backed Resource object: <code>ResourcePBImpl</code>
</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></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records"><code>Resource</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>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.hadoop.yarn.api.records.Resource">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.hadoop.yarn.api.records.<a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></h3>
<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#MEMORY_INDEX">MEMORY_INDEX</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#resources">resources</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#VCORES_INDEX">VCORES_INDEX</a></code></li>
</ul>
</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/impl/LightWeightResource.html#LightWeightResource-long-int-">LightWeightResource</a></span>(long&nbsp;memory,
int&nbsp;vcores)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html#LightWeightResource-long-int-org.apache.hadoop.yarn.api.records.ResourceInformation:A-">LightWeightResource</a></span>(long&nbsp;memory,
int&nbsp;vcores,
<a href="../../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[]&nbsp;source)</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>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.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="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.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="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html#getMemory--">getMemory</a></span>()</code>
<div class="block">This method is DEPRECATED:
Use <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemorySize--"><code>Resource.getMemorySize()</code></a> instead
Get <em>memory</em> of the resource.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html#getMemorySize--">getMemorySize</a></span>()</code>
<div class="block">Get <em>memory</em> of the resource.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.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="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html#hashCode--">hashCode</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/hadoop/yarn/api/records/impl/LightWeightResource.html#setMemory-int-">setMemory</a></span>(int&nbsp;memory)</code>
<div class="block">Set <em>memory</em> of the resource.</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/hadoop/yarn/api/records/impl/LightWeightResource.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="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/api/records/impl/LightWeightResource.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>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.yarn.api.records.Resource">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.hadoop.yarn.api.records.<a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></h3>
<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#castToIntSafely-long-">castToIntSafely</a>, <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>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getAllResourcesListCopy--">getAllResourcesListCopy</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getFormattedString--">getFormattedString</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResourceInformation-int-">getResourceInformation</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResourceInformation-java.lang.String-">getResourceInformation</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResources--">getResources</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getResourceValue-java.lang.String-">getResourceValue</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newDefaultInformation-java.lang.String-java.lang.String-long-">newDefaultInformation</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-int-int-">newInstance</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-long-int-">newInstance</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-long-int-java.util.Map-">newInstance</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#newInstance-org.apache.hadoop.yarn.api.records.Resource-">newInstance</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceInformation-int-org.apache.hadoop.yarn.api.records.ResourceInformation-">setResourceInformation</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceInformation-java.lang.String-org.apache.hadoop.yarn.api.records.ResourceInformation-">setResourceInformation</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceValue-int-long-">setResourceValue</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setResourceValue-java.lang.String-long-">setResourceValue</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#throwExceptionWhenArrayOutOfBound-int-">throwExceptionWhenArrayOutOfBound</a>, <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#toString--">toString</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#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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="LightWeightResource-long-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LightWeightResource</h4>
<pre>public&nbsp;LightWeightResource(long&nbsp;memory,
int&nbsp;vcores)</pre>
</li>
</ul>
<a name="LightWeightResource-long-int-org.apache.hadoop.yarn.api.records.ResourceInformation:A-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LightWeightResource</h4>
<pre>public&nbsp;LightWeightResource(long&nbsp;memory,
int&nbsp;vcores,
<a href="../../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[]&nbsp;source)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMemory</h4>
<pre>public&nbsp;int&nbsp;getMemory()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemory--">Resource</a></code></span></div>
<div class="block">This method is DEPRECATED:
Use <a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemorySize--"><code>Resource.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="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemory--">getMemory</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><em>memory</em>(in MB) of the resource</dd>
</dl>
</li>
</ul>
<a name="setMemory-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMemory</h4>
<pre>public&nbsp;void&nbsp;setMemory(int&nbsp;memory)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setMemory-int-">Resource</a></code></span></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="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setMemory-int-">setMemory</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
<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="getMemorySize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMemorySize</h4>
<pre>public&nbsp;long&nbsp;getMemorySize()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemorySize--">Resource</a></code></span></div>
<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="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getMemorySize--">getMemorySize</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><em>memory</em> of the resource</dd>
</dl>
</li>
</ul>
<a name="setMemorySize-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMemorySize</h4>
<pre>public&nbsp;void&nbsp;setMemorySize(long&nbsp;memory)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setMemorySize-long-">Resource</a></code></span></div>
<div class="block">Set <em>memory</em> of the resource.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setMemorySize-long-">setMemorySize</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
<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>public&nbsp;int&nbsp;getVirtualCores()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getVirtualCores--">Resource</a></code></span></div>
<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="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#getVirtualCores--">getVirtualCores</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
<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>public&nbsp;void&nbsp;setVirtualCores(int&nbsp;vcores)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setVirtualCores-int-">Resource</a></code></span></div>
<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="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#setVirtualCores-int-">setVirtualCores</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
<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="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="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#equals-java.lang.Object-">equals</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</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>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#compareTo-org.apache.hadoop.yarn.api.records.Resource-">compareTo</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></dd>
</dl>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockListLast">
<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="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html#hashCode--">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a></code></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/LightWeightResource.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>Prev&nbsp;Class</li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/hadoop/yarn/api/records/impl/LightWeightResource.html" target="_top">Frames</a></li>
<li><a href="LightWeightResource.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="#fields.inherited.from.class.org.apache.hadoop.yarn.api.records.Resource">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>Field&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>