Class JcTools

java.lang.Object
io.opentelemetry.sdk.trace.internal.JcTools

public final class JcTools extends Object
Internal accessor of JCTools package for fast queues.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Field Details

    • queueCreationWarningLogged

      private static final AtomicBoolean queueCreationWarningLogged
    • logger

      private static final Logger logger
  • Constructor Details

    • JcTools

      private JcTools()
  • Method Details

    • newFixedSizeQueue

      public static <T> Queue<T> newFixedSizeQueue(int capacity)
      Returns a new Queue appropriate for use with multiple producers and a single consumer.
    • capacity

      public static long capacity(Queue<?> queue)
      Returns the capacity of the Queue. We cast to the implementation so callers do not need to use the shaded classes.
    • drain

      public static <T> void drain(Queue<T> queue, int limit, Consumer<T> consumer)
      Remove up to limit elements from the Queue and hand to consume.
      Throws:
      IllegalArgumentException - consumer is null
      IllegalArgumentException - if maxExportBatchSize is negative
    • drainNonJcQueue

      private static <T> void drainNonJcQueue(Queue<T> queue, int maxExportBatchSize, Consumer<T> consumer)