org.apache.hadoop.yarn.server.scheduler

## 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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected AtomicLong` | `containerIdCounter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ContainerIdGenerator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `generateContainerId()` Generates a new long value.
    `void` | `resetContainerIdCounter(long containerIdStart)` This method can reset the generator to a specific value.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### containerIdCounter

          protected volatile AtomicLong containerIdCounter

  - ### Constructor Detail

    - #### ContainerIdGenerator

          public ContainerIdGenerator()

  - ### Method Detail

    - #### 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.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.