Class OpportunisticContainerAllocator.ContainerIdGenerator

java.lang.Object
org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator.ContainerIdGenerator
Enclosing class:
OpportunisticContainerAllocator

public static class OpportunisticContainerAllocator.ContainerIdGenerator extends Object
A Container Id Generator.
  • Field Details

    • containerIdCounter

      protected volatile AtomicLong containerIdCounter
  • Constructor Details

    • ContainerIdGenerator

      public ContainerIdGenerator()
  • Method Details

    • resetContainerIdCounter

      public void resetContainerIdCounter(long containerIdStart)
      This method can reset the generator to a specific value.
      Parameters:
      containerIdStart - containerId
    • generateContainerId

      public long generateContainerId()
      Generates a new long value. Default implementation increments the underlying AtomicLong. Sub classes are encouraged to over-ride this behaviour.
      Returns:
      Counter.