Class Resource
java.lang.Object
org.apache.hadoop.yarn.service.api.records.BaseResource
org.apache.hadoop.yarn.service.api.records.Resource
- All Implemented Interfaces:
Serializable,Cloneable
Resource determines the amount of resources (vcores, memory, network, etc.)
usable by a container. This field determines the resource to be applied for
all the containers of a component or service. The resource specified at
the service (or global) level can be overriden at the component level. Only one
of profile OR cpu & memory are expected. It raises a validation
exception otherwise.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongclone()Amount of vcores allocated to each container (optional but overrides cpus in profile if specified).booleanMap of resource name to ResourceInformationgetCpus()inthashCode()Amount of memory allocated to each container (optional but overrides memory in profile if specified).Each resource profile has a unique id which is associated with a cluster-level predefined memory, cpus, etc.resourceInformations(Map<String, ResourceInformation> resourceInformations) voidvoidvoidsetProfile(String profile) setResourceInformations(Map<String, ResourceInformation> resourceInformations) toString()Methods inherited from class org.apache.hadoop.yarn.service.api.records.BaseResource
getUri, setUri
-
Constructor Details
-
Resource
public Resource()
-
-
Method Details
-
profile
Each resource profile has a unique id which is associated with a cluster-level predefined memory, cpus, etc. -
getProfile
-
setProfile
-
cpus
Amount of vcores allocated to each container (optional but overrides cpus in profile if specified). -
getCpus
-
setCpus
-
memory
Amount of memory allocated to each container (optional but overrides memory in profile if specified). Currently accepts only an integer value and default unit is in MB. -
getMemory
-
setMemory
-
calcMemoryMB
public long calcMemoryMB() -
setResourceInformations
-
resourceInformations
-
getAdditional
Map of resource name to ResourceInformation- Returns:
- additional
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classBaseResource
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-