ResourceTypeInfo (Apache Hadoop YARN API 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.api.records, class: ResourceTypeInfo

Package org.apache.hadoop.yarn.api.records

# Class ResourceTypeInfo

java.lang.Object
org.apache.hadoop.yarn.api.records.ResourceTypeInfo

All Implemented Interfaces:
  `Comparable<ResourceTypeInfo>`

public abstract class ResourceTypeInfo extends Object implements Comparable<ResourceTypeInfo>
Class to encapsulate information about a ResourceType - the name of the resource, the units(milli, micro, etc), the type(countable).

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResourceTypeInfo()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(ResourceTypeInfo other)`
  `static void`
  `copy(ResourceTypeInfo src, ResourceTypeInfo dst)`
  Copies the content of the source ResourceTypeInfo object to the destination object, overwriting all properties of the destination object.
  `boolean`
  `equals(Object obj)`
  `abstract String`
  `getDefaultUnit()`
  Get units for the resource.
  `abstract String`
  `getName()`
  Get the name for the resource.
  `abstract ResourceTypes`
  `getResourceType()`
  Get the resource type.
  `int`
  `hashCode()`
  `static ResourceTypeInfo`
  `newInstance(String name)`
  Create a new instance of ResourceTypeInfo from name.
  `static ResourceTypeInfo`
  `newInstance(String name, String units)`
  Create a new instance of ResourceTypeInfo from name, units.
  `static ResourceTypeInfo`
  `newInstance(String name, String units, ResourceTypes type)`
  Create a new instance of ResourceTypeInfo from name, units and type.
  `static ResourceTypeInfo`
  `newInstance(ResourceTypeInfo other)`
  Create a new instance of ResourceTypeInfo from another object.
  `abstract void`
  `setDefaultUnit(String rUnits)`
  Set the units for the resource.
  `abstract void`
  `setName(String rName)`
  Set the name for the resource.
  `abstract void`
  `setResourceType(ResourceTypes type)`
  Set the resource type.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ResourceTypeInfo

    public ResourceTypeInfo()

- ## Method Details

  - ### getName

    public abstract String getName()
    Get the name for the resource.
    Returns:
      resource name

  - ### setName

    public abstract void setName(String rName)
    Set the name for the resource.
    Parameters:
      `rName` - name for the resource

  - ### getDefaultUnit

    public abstract String getDefaultUnit()
    Get units for the resource.
    Returns:
      units for the resource

  - ### setDefaultUnit

    public abstract void setDefaultUnit(String rUnits)
    Set the units for the resource.
    Parameters:
      `rUnits` - units for the resource

  - ### getResourceType

    public abstract ResourceTypes getResourceType()
    Get the resource type.
    Returns:
      the resource type

  - ### setResourceType

    public abstract void setResourceType(ResourceTypes type)
    Set the resource type.
    Parameters:
      `type` - the resource type

  - ### newInstance

    @Public @Unstable public static ResourceTypeInfo newInstance(ResourceTypeInfo other)
    Create a new instance of ResourceTypeInfo from another object.
    Parameters:
      `other` - the object from which the new object should be created
    Returns:
      the new ResourceTypeInfo object

  - ### newInstance

    @Public @Unstable public static ResourceTypeInfo newInstance(String name, String units, ResourceTypes type)
    Create a new instance of ResourceTypeInfo from name, units and type.
    Parameters:
      `name` - name of resource type
      `units` - units of resource type
      `type` - such as countable, etc.
    Returns:
      the new ResourceTypeInfo object

  - ### newInstance

    @Public @Unstable public static ResourceTypeInfo newInstance(String name, String units)
    Create a new instance of ResourceTypeInfo from name, units.
    Parameters:
      `name` - name of resource type
      `units` - units of resource type
    Returns:
      the new ResourceTypeInfo object

  - ### newInstance

    @Public @Unstable public static ResourceTypeInfo newInstance(String name)
    Create a new instance of ResourceTypeInfo from name.
    Parameters:
      `name` - name of resource type
    Returns:
      the new ResourceTypeInfo object

  - ### copy

    public static void copy(ResourceTypeInfo src, ResourceTypeInfo dst)
    Copies the content of the source ResourceTypeInfo object to the destination object, overwriting all properties of the destination object.
    Parameters:
      `src` - Source ResourceTypeInfo object
      `dst` - Destination ResourceTypeInfo object

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### compareTo

    public int compareTo(ResourceTypeInfo other)
    Specified by:
      `compareTo` in interface `Comparable<ResourceTypeInfo>`