Class JcTools
java.lang.Object
io.opentelemetry.sdk.trace.internal.JcTools
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
Returns the capacity of theQueue
.static <T> void
Remove up to limit elements from theQueue
and hand to consume.private static <T> void
drainNonJcQueue
(Queue<T> queue, int maxExportBatchSize, Consumer<T> consumer) static <T> Queue
<T> newFixedSizeQueue
(int capacity) Returns a newQueue
appropriate for use with multiple producers and a single consumer.
-
Field Details
-
queueCreationWarningLogged
-
logger
-
-
Constructor Details
-
JcTools
private JcTools()
-
-
Method Details
-
newFixedSizeQueue
Returns a newQueue
appropriate for use with multiple producers and a single consumer. -
capacity
Returns the capacity of theQueue
. We cast to the implementation so callers do not need to use the shaded classes. -
drain
Remove up to limit elements from theQueue
and hand to consume.- Throws:
IllegalArgumentException
- consumer isnull
IllegalArgumentException
- if maxExportBatchSize is negative
-
drainNonJcQueue
-