Package zipkin2.collector
Class Collector
- java.lang.Object
-
- zipkin2.collector.Collector
-
public class Collector extends java.lang.Object
This component takes action on spans received from a transport. This includes deserializing, sampling and scheduling for storage.Callbacks passed do not propagate to the storage layer. They only return success or failures before storage is attempted. This ensures that calling threads are disconnected from storage threads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Collector.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(java.util.List<Span> spans, Callback<java.lang.Void> callback)
void
accept(java.util.List<Span> spans, Callback<java.lang.Void> callback, java.util.concurrent.Executor executor)
void
acceptSpans(byte[] serialized, Callback<java.lang.Void> callback)
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
.void
acceptSpans(byte[] serializedSpans, BytesDecoder<Span> decoder, Callback<java.lang.Void> callback)
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
.void
acceptSpans(java.nio.ByteBuffer encoded, SpanBytesDecoder decoder, Callback<java.lang.Void> callback, java.util.concurrent.Executor executor)
LikeacceptSpans(byte[], BytesDecoder, Callback)
, except using a byte buffer.static Collector.Builder
newBuilder(java.lang.Class<?> loggingClass)
Needed to scope this to the correct logging category
-
-
-
Method Detail
-
newBuilder
public static Collector.Builder newBuilder(java.lang.Class<?> loggingClass)
Needed to scope this to the correct logging category
-
accept
public void accept(java.util.List<Span> spans, Callback<java.lang.Void> callback, java.util.concurrent.Executor executor)
- Parameters:
executor
- the executor used to enqueue the storage request.Calls to get the storage component could be blocking. This ensures requests that block callers (such as http or gRPC) do not add additional load during such events.
-
acceptSpans
public void acceptSpans(java.nio.ByteBuffer encoded, SpanBytesDecoder decoder, Callback<java.lang.Void> callback, java.util.concurrent.Executor executor)
LikeacceptSpans(byte[], BytesDecoder, Callback)
, except using a byte buffer.
-
acceptSpans
public void acceptSpans(byte[] serialized, Callback<java.lang.Void> callback)
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
. Do not call any other metrics callbacks as those are handled internal to this method.- Parameters:
serialized
- not empty message
-
acceptSpans
public void acceptSpans(byte[] serializedSpans, BytesDecoder<Span> decoder, Callback<java.lang.Void> callback)
Before calling this, callCollectorMetrics.incrementMessages()
, andCollectorMetrics.incrementBytes(int)
. Do not call any other metrics callbacks as those are handled internal to this method.- Parameters:
serializedSpans
- not empty message
-
-