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 inMarshalerContext
. Marshaler should be used so that firstgetBinarySerializedSize(K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
is called and after thatwriteTo(io.opentelemetry.exporter.internal.marshal.Serializer, K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
is called. CallinggetBinarySerializedSize(K, V, io.opentelemetry.exporter.internal.marshal.MarshalerContext)
may add values toMarshalerContext
that are later used inwriteTo(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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
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 Detail
-
getBinarySerializedSize
int getBinarySerializedSize(K key, V value, MarshalerContext context)
Returns the number of bytes this Marshaler will write.
-
writeTo
void writeTo(Serializer output, K key, V value, MarshalerContext context) throws java.io.IOException
Marshal given key and value using the providedSerializer
.- Throws:
java.io.IOException
-
-