Class MarshalerUtil
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]
private static final boolean
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
U> Map <Resource, Map<InstrumentationScopeInfo, List<U>>> groupByResourceAndScope
(Collection<T> dataList, Function<T, Resource> getResource, Function<T, InstrumentationScopeInfo> getInstrumentationScope, Function<T, U> createMarshaler) Groups SDK items by resource and instrumentation scope.static String
preserializeJsonFields
(Marshaler marshaler) Preserialize into JSON format.static int
sizeBool
(ProtoFieldInfo field, boolean value) Returns the size of a bool field.static int
sizeByteAsFixed32
(ProtoFieldInfo field, byte message) Returns the size of a byte field when propagated to a fixed32.static int
sizeByteBuffer
(ProtoFieldInfo field, ByteBuffer message) Returns the size of a bytes field based on the buffer's capacity.static int
sizeBytes
(ProtoFieldInfo field, byte[] message) Returns the size of a bytes field.static int
sizeDouble
(ProtoFieldInfo field, double value) Returns the size of a double field.static int
sizeDoubleOptional
(ProtoFieldInfo field, double value) Returns the size of a double field.static int
sizeEnum
(ProtoFieldInfo field, ProtoEnumInfo enumValue) Returns the size of a enum field.static int
sizeFixed32
(ProtoFieldInfo field, int message) Returns the size of a fixed32 field.static int
sizeFixed64
(ProtoFieldInfo field, long value) Returns the size of a fixed64 field.static int
sizeFixed64Optional
(ProtoFieldInfo field, long value) Returns the size of a fixed64 field.static int
sizeInt32
(ProtoFieldInfo field, int message) Returns the size of a int32 field.static int
sizeInt64
(ProtoFieldInfo field, long message) Returns the size of a int64 field.static int
sizeMessage
(ProtoFieldInfo field, Marshaler message) Returns the size of a message field.static int
sizeRepeatedDouble
(ProtoFieldInfo field, List<Double> values) Returns the size of a repeated double field.private static int
sizeRepeatedFixed64
(ProtoFieldInfo field, int numValues) static int
sizeRepeatedFixed64
(ProtoFieldInfo field, List<Long> values) Returns the size of a repeated fixed64 field.static int
sizeRepeatedInt64
(ProtoFieldInfo field, long[] values) Returns the size of a repeated int64 field.static int
sizeRepeatedInt64
(ProtoFieldInfo field, List<Long> values) Returns the size of a repeated int64 field.static int
sizeRepeatedMessage
(ProtoFieldInfo field, List<? extends Marshaler> repeatedMessage) Returns the size of a repeated message field.static <T extends Marshaler>
intsizeRepeatedMessage
(ProtoFieldInfo field, T[] repeatedMessage) Returns the size of a repeated message field.static int
sizeRepeatedUInt64
(ProtoFieldInfo field, long[] values) Returns the size of a repeated uint64 field.static int
sizeRepeatedUInt64
(ProtoFieldInfo field, DynamicPrimitiveLongList values) Returns the size of a repeated uint64 field.static int
sizeRepeatedUInt64
(ProtoFieldInfo field, List<Long> values) Returns the size of a repeated uint64 field.static int
sizeSInt32
(ProtoFieldInfo field, int message) Returns the size of a sint32 field.static int
sizeSpanId
(ProtoFieldInfo field, String spanId) Returns the size of a span_id field.static int
sizeTraceId
(ProtoFieldInfo field, String traceId) Returns the size of a trace_id field.static int
sizeUInt32
(ProtoFieldInfo field, int message) Returns the size of a uint32 field.static int
sizeUInt64
(ProtoFieldInfo field, long message) Returns the size of a uint64 field.static byte[]
Converts the string to utf8 bytes for encoding.
-
Field Details
-
TRACE_ID_VALUE_SIZE
private static final int TRACE_ID_VALUE_SIZE -
SPAN_ID_VALUE_SIZE
private static final int SPAN_ID_VALUE_SIZE -
JSON_AVAILABLE
private static final boolean JSON_AVAILABLE -
EMPTY_BYTES
private static final byte[] EMPTY_BYTES
-
-
Constructor Details
-
MarshalerUtil
private MarshalerUtil()
-
-
Method Details
-
groupByResourceAndScope
public static <T,U> Map<Resource,Map<InstrumentationScopeInfo, groupByResourceAndScopeList<U>>> (Collection<T> dataList, Function<T, Resource> getResource, Function<T, InstrumentationScopeInfo> getInstrumentationScope, Function<T, U> createMarshaler) Groups SDK items by resource and instrumentation scope. -
preserializeJsonFields
Preserialize into JSON format. -
sizeRepeatedFixed64
Returns the size of a repeated fixed64 field. -
sizeRepeatedFixed64
-
sizeRepeatedUInt64
Returns the size of a repeated uint64 field.Packed repeated fields contain the tag, an integer representing the incoming payload size, and an actual payload of repeated varints.
-
sizeRepeatedUInt64
Returns the size of a repeated uint64 field.Packed repeated fields contain the tag, an integer representing the incoming payload size, and an actual payload of repeated varints.
-
sizeRepeatedUInt64
Returns the size of a repeated uint64 field.Packed repeated fields contain the tag, an integer representing the incoming payload size, and an actual payload of repeated varints.
NOTE: This method has the same logic as
sizeRepeatedUInt64(ProtoFieldInfo, long[])
)} but instead of using a primitive array it usesDynamicPrimitiveLongList
to avoid boxing/unboxing -
sizeRepeatedInt64
Returns the size of a repeated int64 field.Packed repeated fields contain the tag, an integer representing the incoming payload size, and an actual payload of repeated varints.
-
sizeRepeatedInt64
Returns the size of a repeated int64 field.Packed repeated fields contain the tag, an integer representing the incoming payload size, and an actual payload of repeated varints.
-
sizeRepeatedDouble
Returns the size of a repeated double field. -
sizeRepeatedMessage
public static <T extends Marshaler> int sizeRepeatedMessage(ProtoFieldInfo field, T[] repeatedMessage) Returns the size of a repeated message field. -
sizeRepeatedMessage
public static int sizeRepeatedMessage(ProtoFieldInfo field, List<? extends Marshaler> repeatedMessage) Returns the size of a repeated message field. -
sizeMessage
Returns the size of a message field. -
sizeBool
Returns the size of a bool field. -
sizeInt64
Returns the size of a int64 field. -
sizeUInt64
Returns the size of a uint64 field. -
sizeUInt32
Returns the size of a uint32 field. -
sizeSInt32
Returns the size of a sint32 field. -
sizeInt32
Returns the size of a int32 field. -
sizeDouble
Returns the size of a double field. -
sizeDoubleOptional
Returns the size of a double field. -
sizeFixed64
Returns the size of a fixed64 field. -
sizeFixed64Optional
Returns the size of a fixed64 field. -
sizeByteAsFixed32
Returns the size of a byte field when propagated to a fixed32. -
sizeFixed32
Returns the size of a fixed32 field. -
sizeBytes
Returns the size of a bytes field. -
sizeByteBuffer
Returns the size of a bytes field based on the buffer's capacity. -
sizeEnum
Returns the size of a enum field. -
sizeTraceId
Returns the size of a trace_id field. -
sizeSpanId
Returns the size of a span_id field. -
toBytes
Converts the string to utf8 bytes for encoding.
-