Interface StatelessMarshaler2<K,V>
- All Known Implementing Classes:
AttributeArrayAnyValueStatelessMarshaler
,AttributeKeyValueStatelessMarshaler
,AttributeKeyValueStatelessMarshaler.ValueStatelessMarshaler
,InstrumentationScopeLogsStatelessMarshaler
,InstrumentationScopeMetricsStatelessMarshaler
,InstrumentationScopeSpansStatelessMarshaler
,ResourceLogsStatelessMarshaler
,ResourceMetricsStatelessMarshaler
,ResourceSpansStatelessMarshaler
public interface StatelessMarshaler2<K,V>
Marshaler from an SDK structure to protobuf wire format. It is intended that the instances of
this interface don't keep marshaling state and can be singletons. Any state needed for marshaling
should be stored in
MarshalerContext
. Marshaler should be used so that first getBinarySerializedSize(K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
is called and after that writeTo(io.opentelemetry.exporter.internal.marshal.Serializer, K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
is called. Calling getBinarySerializedSize(K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
may add values to MarshalerContext
that are later used in
writeTo(io.opentelemetry.exporter.internal.marshal.Serializer, K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Method Summary
Modifier and TypeMethodDescriptionint
getBinarySerializedSize
(K key, V value, MarshalerContext context) Returns the number of bytes this Marshaler will write.void
writeTo
(Serializer output, K key, V value, MarshalerContext context) Marshal given key and value using the providedSerializer
.
-
Method Details
-
getBinarySerializedSize
Returns the number of bytes this Marshaler will write. -
writeTo
Marshal given key and value using the providedSerializer
.- Throws:
IOException
-