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 Type
    Method
    Description
    void
    Add Container's resources to Node Utilization.
    org.apache.hadoop.yarn.api.records.ResourceUtilization
    Get the current total utilization of all the Containers running on the node.
    boolean
    hasResourcesAvailable(org.apache.hadoop.yarn.api.records.Resource resource)
    Check if NM has resources available currently to run requested resources.
    boolean
    Check if NM has resources available currently to run the container.
    void
    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

      void addContainerResources(Container container)
      Add Container's resources to Node Utilization.
      Parameters:
      container - Container.
    • subtractContainerResource

      void subtractContainerResource(Container container)
      Subtract Container's resources to Node Utilization.
      Parameters:
      container - Container.
    • hasResourcesAvailable

      boolean hasResourcesAvailable(Container container)
      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.