Class KeyValueMarshaler
- java.lang.Object
-
- io.opentelemetry.exporter.internal.marshal.Marshaler
-
- io.opentelemetry.exporter.internal.marshal.MarshalerWithSize
-
- io.opentelemetry.exporter.internal.otlp.KeyValueMarshaler
-
public final class KeyValueMarshaler extends MarshalerWithSize
A Marshaler of key value pairs.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
EMPTY_BYTES
private static KeyValueMarshaler[]
EMPTY_REPEATED
private byte[]
keyUtf8
private Marshaler
value
-
Constructor Summary
Constructors Modifier Constructor Description private
KeyValueMarshaler(byte[] keyUtf8, Marshaler value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
calculateSize(byte[] keyUtf8, Marshaler value)
private static KeyValueMarshaler
create(AttributeKey<?> attributeKey, java.lang.Object value)
static KeyValueMarshaler[]
createForAttributes(Attributes attributes)
Returns Marshalers for the given Attributes.static KeyValueMarshaler
createForKeyValue(KeyValue keyValue)
Returns Marshaler for the given KeyValue.void
writeTo(Serializer output)
-
Methods inherited from class io.opentelemetry.exporter.internal.marshal.MarshalerWithSize
getBinarySerializedSize
-
Methods inherited from class io.opentelemetry.exporter.internal.marshal.Marshaler
writeBinaryTo, writeJsonTo, writeJsonTo, writeJsonWithNewline
-
-
-
-
Field Detail
-
EMPTY_BYTES
private static final byte[] EMPTY_BYTES
-
EMPTY_REPEATED
private static final KeyValueMarshaler[] EMPTY_REPEATED
-
keyUtf8
private final byte[] keyUtf8
-
value
private final Marshaler value
-
-
Constructor Detail
-
KeyValueMarshaler
private KeyValueMarshaler(byte[] keyUtf8, Marshaler value)
-
-
Method Detail
-
createForKeyValue
public static KeyValueMarshaler createForKeyValue(KeyValue keyValue)
Returns Marshaler for the given KeyValue.
-
createForAttributes
public static KeyValueMarshaler[] createForAttributes(Attributes attributes)
Returns Marshalers for the given Attributes.
-
create
private static KeyValueMarshaler create(AttributeKey<?> attributeKey, java.lang.Object value)
-
writeTo
public void writeTo(Serializer output) throws java.io.IOException
-
calculateSize
private static int calculateSize(byte[] keyUtf8, Marshaler value)
-
-