| <!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 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 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 Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../../allclasses-noframe.html">All 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: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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><<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a>></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><<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>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"> </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> </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> </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> </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"> </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> </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"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </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 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> other)</code> </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> source, |
| <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> dest)</code> </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> obj)</code> </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><<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#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> </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 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> 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> 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> </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> 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> unit, |
| long 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 memory, |
| int vCores)</code> </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 memory, |
| int vCores)</code> </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 memory, |
| int 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><<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>> 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> resource)</code> </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 memory)</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </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 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 index, |
| <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> 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> resource, |
| <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> 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 index, |
| long 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> resource, |
| long 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 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 index)</code> </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> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class 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 <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 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 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 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> newInstance(int memory, |
| int 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> newInstance(long memory, |
| int 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> newInstance(long memory, |
| int 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><<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>> 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> newInstance(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> 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 void copy(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> source, |
| <a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> 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 int getMemory()</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> </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 long 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 void setMemory(int memory)</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</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="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 void setMemorySize(long 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 int 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 void setVirtualCores(int 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>[] 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 <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><<a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a>> 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> 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> 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> getResourceInformation(int 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 long 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> 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 void 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> resource, |
| <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> 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 void setResourceInformation(int index, |
| <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> 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 void 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> resource, |
| long 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 void setResourceValue(int index, |
| long 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 void throwExceptionWhenArrayOutOfBound(int index)</pre> |
| </li> |
| </ul> |
| <a name="equals-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre>public boolean 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> 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> in class <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 int compareTo(<a href="../../../../../../org/apache/hadoop/yarn/api/records/Resource.html" title="class in org.apache.hadoop.yarn.api.records">Resource</a> 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> in interface <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><<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="toString--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public <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> 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> in class <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 <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> 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 int 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> in class <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 int castToIntSafely(long 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 <a href="../../../../../../org/apache/hadoop/yarn/api/records/ResourceInformation.html" title="class in org.apache.hadoop.yarn.api.records">ResourceInformation</a> 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> 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> unit, |
| long 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 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 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 Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../../allclasses-noframe.html">All 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: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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 © 2008–2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |