Class NumaNodeResource
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.numa.NumaNodeResource
NumaNodeResource class holds the NUMA node topology with the total and used
resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintassignAvailableCpus(int cpusreq, org.apache.hadoop.yarn.api.records.ContainerId containerId) Assigns available cpu's and returns the remaining needed cpu's.longassignAvailableMemory(long memreq, org.apache.hadoop.yarn.api.records.ContainerId containerId) Assigns available memory and returns the remaining needed memory.voidassignResources(org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.ContainerId containerId) Assigns the requested resources for Container.booleaninthashCode()booleanisResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource) Checks whether the specified resources available or not.voidrecoverCpus(org.apache.hadoop.yarn.api.records.ContainerId containerId, int cpus) Recovers the cpu's resources for Container.voidrecoverMemory(org.apache.hadoop.yarn.api.records.ContainerId containerId, long memory) Recovers the memory resources for Container.voidreleaseResources(org.apache.hadoop.yarn.api.records.ContainerId containerId) Releases the assigned resources for Container.toString()
-
Constructor Details
-
NumaNodeResource
-
-
Method Details
-
isResourcesAvailable
public boolean isResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource) Checks whether the specified resources available or not.- Parameters:
resource- resource- Returns:
- whether the specified resources available or not
-
assignAvailableMemory
public long assignAvailableMemory(long memreq, org.apache.hadoop.yarn.api.records.ContainerId containerId) Assigns available memory and returns the remaining needed memory.- Parameters:
memreq- required memorycontainerId- which container memory to assign- Returns:
- remaining needed memory
-
assignAvailableCpus
public int assignAvailableCpus(int cpusreq, org.apache.hadoop.yarn.api.records.ContainerId containerId) Assigns available cpu's and returns the remaining needed cpu's.- Parameters:
cpusreq- required cpu'scontainerId- which container cpu's to assign- Returns:
- remaining needed cpu's
-
assignResources
public void assignResources(org.apache.hadoop.yarn.api.records.Resource resource, org.apache.hadoop.yarn.api.records.ContainerId containerId) Assigns the requested resources for Container.- Parameters:
resource- resource to assigncontainerId- to which container the resources to assign
-
releaseResources
public void releaseResources(org.apache.hadoop.yarn.api.records.ContainerId containerId) Releases the assigned resources for Container.- Parameters:
containerId- to which container the assigned resources to release
-
recoverMemory
public void recoverMemory(org.apache.hadoop.yarn.api.records.ContainerId containerId, long memory) Recovers the memory resources for Container.- Parameters:
containerId- recover the memory resources for the Containermemory- memory to recover
-
recoverCpus
public void recoverCpus(org.apache.hadoop.yarn.api.records.ContainerId containerId, int cpus) Recovers the cpu's resources for Container.- Parameters:
containerId- recover the cpu's resources for the Containercpus- cpu's to recover
-
toString
-
hashCode
public int hashCode() -
equals
-
getNodeId
-