Class AllocationBasedResourceUtilizationTracker
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.scheduler.AllocationBasedResourceUtilizationTracker
- All Implemented Interfaces:
ResourceUtilizationTracker
public class AllocationBasedResourceUtilizationTracker
extends Object
implements ResourceUtilizationTracker
An implementation of the
ResourceUtilizationTracker that equates
resource utilization with the total resource allocated to the container.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddContainerResources(Container container) Add Container's resources to the accumulated Utilization.org.apache.hadoop.yarn.api.records.ResourceUtilizationGet the accumulation of totally allocated resources to a container.booleanhasResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource) Check if NM has resources available currently to run requested resources.booleanhasResourcesAvailable(Container container) Check if NM has resources available currently to run the container.voidsubtractContainerResource(Container container) Subtract Container's resources to the accumulated Utilization.
-
Method Details
-
getCurrentUtilization
public org.apache.hadoop.yarn.api.records.ResourceUtilization getCurrentUtilization()Get the accumulation of totally allocated resources to a container.- Specified by:
getCurrentUtilizationin interfaceResourceUtilizationTracker- Returns:
- ResourceUtilization Resource Utilization.
-
addContainerResources
Add Container's resources to the accumulated Utilization.- Specified by:
addContainerResourcesin interfaceResourceUtilizationTracker- Parameters:
container- Container.
-
subtractContainerResource
Subtract Container's resources to the accumulated Utilization.- Specified by:
subtractContainerResourcein interfaceResourceUtilizationTracker- Parameters:
container- Container.
-
hasResourcesAvailable
Check if NM has resources available currently to run the container.- Specified by:
hasResourcesAvailablein interfaceResourceUtilizationTracker- Parameters:
container- Container.- Returns:
- True, if NM has resources available currently to run the container.
-
hasResourcesAvailable
public boolean hasResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource) Description copied from interface:ResourceUtilizationTrackerCheck if NM has resources available currently to run requested resources.- Specified by:
hasResourcesAvailablein interfaceResourceUtilizationTracker- Parameters:
resource- the resources.- Returns:
- True, if NM has enough available resources.
-
getContainersMonitor
-