public class AllocationBasedResourceUtilizationTracker extends Object implements ResourceUtilizationTracker
ResourceUtilizationTracker that equates
resource utilization with the total resource allocated to the container.| Modifier and Type | Method and Description |
|---|---|
void |
addContainerResources(Container container)
Add Container's resources to the accumulated Utilization.
|
ContainersMonitor |
getContainersMonitor() |
org.apache.hadoop.yarn.api.records.ResourceUtilization |
getCurrentUtilization()
Get the accumulation of totally allocated resources to a container.
|
boolean |
hasResourcesAvailable(Container container)
Check if NM has resources available currently to run the container.
|
boolean |
hasResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource)
Check if NM has resources available currently to run requested resources.
|
void |
subtractContainerResource(Container container)
Subtract Container's resources to the accumulated Utilization.
|
public org.apache.hadoop.yarn.api.records.ResourceUtilization getCurrentUtilization()
getCurrentUtilization in interface ResourceUtilizationTrackerpublic void addContainerResources(Container container)
addContainerResources in interface ResourceUtilizationTrackercontainer - Container.public void subtractContainerResource(Container container)
subtractContainerResource in interface ResourceUtilizationTrackercontainer - Container.public boolean hasResourcesAvailable(Container container)
hasResourcesAvailable in interface ResourceUtilizationTrackercontainer - Container.public boolean hasResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource)
ResourceUtilizationTrackerhasResourcesAvailable in interface ResourceUtilizationTrackerresource - the resources.public ContainersMonitor getContainersMonitor()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.