Interface ResourceUtilizationTracker
- All Known Implementing Classes:
AllocationBasedResourceUtilizationTracker
public interface ResourceUtilizationTracker
This interface abstracts out how a container contributes to
Resource Utilization of the node.
It is used by the
ContainerScheduler to determine which
OPPORTUNISTIC containers to be killed to make room for a GUARANTEED
container.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddContainerResources(Container container) Add Container's resources to Node Utilization.org.apache.hadoop.yarn.api.records.ResourceUtilizationGet the current total utilization of all the Containers running on the node.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 Node Utilization.
-
Method Details
-
getCurrentUtilization
org.apache.hadoop.yarn.api.records.ResourceUtilization getCurrentUtilization()Get the current total utilization of all the Containers running on the node.- Returns:
- ResourceUtilization Resource Utilization.
-
addContainerResources
Add Container's resources to Node Utilization.- Parameters:
container- Container.
-
subtractContainerResource
Subtract Container's resources to Node Utilization.- Parameters:
container- Container.
-
hasResourcesAvailable
Check if NM has resources available currently to run the container.- Parameters:
container- Container.- Returns:
- True, if NM has resources available currently to run the container.
-
hasResourcesAvailable
boolean hasResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource) Check if NM has resources available currently to run requested resources.- Parameters:
resource- the resources.- Returns:
- True, if NM has enough available resources.
-