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 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>