Class SchedulerRequestKey

java.lang.Object
org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey
All Implemented Interfaces:
Comparable<SchedulerRequestKey>
Direct Known Subclasses:
ResourceRequestSetKey

public class SchedulerRequestKey extends Object implements Comparable<SchedulerRequestKey>
Composite key for outstanding scheduler requests for any schedulable entity. Currently it includes Priority.
  • Constructor Details

    • SchedulerRequestKey

      public SchedulerRequestKey(org.apache.hadoop.yarn.api.records.Priority priority, long allocationRequestId, org.apache.hadoop.yarn.api.records.ContainerId containerToUpdate)
  • Method Details

    • create

      public static SchedulerRequestKey create(org.apache.hadoop.yarn.api.records.ResourceRequest req)
      Factory method to generate a SchedulerRequestKey from a ResourceRequest.
      Parameters:
      req - ResourceRequest
      Returns:
      SchedulerRequestKey
    • create

      public static SchedulerRequestKey create(org.apache.hadoop.yarn.api.records.SchedulingRequest req)
      Factory method to generate a SchedulerRequestKey from a SchedulingRequest.
      Parameters:
      req - SchedulingRequest
      Returns:
      SchedulerRequestKey
    • create

      public static SchedulerRequestKey create(org.apache.hadoop.yarn.api.records.UpdateContainerRequest req, SchedulerRequestKey schedulerRequestKey)
    • extractFrom

      public static SchedulerRequestKey extractFrom(org.apache.hadoop.yarn.api.records.Container container)
      Convenience method to extract the SchedulerRequestKey used to schedule the Container.
      Parameters:
      container - Container
      Returns:
      SchedulerRequestKey
    • getPriority

      public org.apache.hadoop.yarn.api.records.Priority getPriority()
      Get the Priority of the request.
      Returns:
      the Priority of the request
    • getAllocationRequestId

      public long getAllocationRequestId()
      Get the Id of the associated ResourceRequest.
      Returns:
      the Id of the associated ResourceRequest
    • getContainerToUpdate

      public org.apache.hadoop.yarn.api.records.ContainerId getContainerToUpdate()
    • compareTo

      public int compareTo(SchedulerRequestKey o)
      Specified by:
      compareTo in interface Comparable<SchedulerRequestKey>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object