Class ResourceTypeInfo
java.lang.Object
org.apache.hadoop.yarn.api.records.ResourceTypeInfo
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ResourceTypeInfo other) static voidcopy(ResourceTypeInfo src, ResourceTypeInfo dst) Copies the content of the source ResourceTypeInfo object to the destination object, overwriting all properties of the destination object.booleanabstract StringGet units for the resource.abstract StringgetName()Get the name for the resource.abstract ResourceTypesGet the resource type.inthashCode()static ResourceTypeInfonewInstance(String name) Create a new instance of ResourceTypeInfo from name.static ResourceTypeInfonewInstance(String name, String units) Create a new instance of ResourceTypeInfo from name, units.static ResourceTypeInfonewInstance(String name, String units, ResourceTypes type) Create a new instance of ResourceTypeInfo from name, units and type.static ResourceTypeInfonewInstance(ResourceTypeInfo other) Create a new instance of ResourceTypeInfo from another object.abstract voidsetDefaultUnit(String rUnits) Set the units for the resource.abstract voidSet the name for the resource.abstract voidsetResourceType(ResourceTypes type) Set the resource type.toString()
-
Constructor Details
-
ResourceTypeInfo
public ResourceTypeInfo()
-
-
Method Details
-
getName
Get the name for the resource.- Returns:
- resource name
-
setName
Set the name for the resource.- Parameters:
rName- name for the resource
-
getDefaultUnit
Get units for the resource.- Returns:
- units for the resource
-
setDefaultUnit
Set the units for the resource.- Parameters:
rUnits- units for the resource
-
getResourceType
Get the resource type.- Returns:
- the resource type
-
setResourceType
Set the resource type.- Parameters:
type- the resource type
-
newInstance
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 typeunits- units of resource typetype- such as countable, etc.- Returns:
- the new ResourceTypeInfo object
-
newInstance
Create a new instance of ResourceTypeInfo from name, units.- Parameters:
name- name of resource typeunits- units of resource type- Returns:
- the new ResourceTypeInfo object
-
newInstance
Create a new instance of ResourceTypeInfo from name.- Parameters:
name- name of resource type- Returns:
- the new ResourceTypeInfo object
-
copy
Copies the content of the source ResourceTypeInfo object to the destination object, overwriting all properties of the destination object.- Parameters:
src- Source ResourceTypeInfo objectdst- Destination ResourceTypeInfo object
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<ResourceTypeInfo>
-