Class StatelessMarshalerUtil
java.lang.Object
io.opentelemetry.exporter.internal.marshal.StatelessMarshalerUtil
Marshaler utilities.
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 TypeMethodDescriptionstatic <T> Map<Resource, Map<InstrumentationScopeInfo, List<T>>> groupByResourceAndScope(Collection<T> dataList, Function<T, Resource> getResource, Function<T, InstrumentationScopeInfo> getInstrumentationScope, MarshalerContext context) Groups SDK items by resource and instrumentation scope.static <K,V> int sizeMessageWithContext(ProtoFieldInfo field, K key, V value, StatelessMarshaler2<K, V> marshaler, MarshalerContext context) Returns the size of a message field.static <T> intsizeMessageWithContext(ProtoFieldInfo field, T element, StatelessMarshaler<T> marshaler, MarshalerContext context) Returns the size of a message field.static intsizeRepeatedMessageWithContext(ProtoFieldInfo field, Attributes attributes, StatelessMarshaler2<AttributeKey<?>, Object> marshaler, MarshalerContext context) Returns the size of a repeated message field.static <T> intsizeRepeatedMessageWithContext(ProtoFieldInfo field, Collection<? extends T> messages, StatelessMarshaler<T> marshaler, MarshalerContext context, MarshalerContext.Key key) Returns the size of a repeated message field.static <T> intsizeRepeatedMessageWithContext(ProtoFieldInfo field, List<? extends T> messages, StatelessMarshaler<T> marshaler, MarshalerContext context) Returns the size of a repeated message field.static <K,V> int sizeRepeatedMessageWithContext(ProtoFieldInfo field, Map<K, V> messages, StatelessMarshaler2<K, V> marshaler, MarshalerContext context, MarshalerContext.Key key) Returns the size of a repeated message field.static intsizeStringWithContext(ProtoFieldInfo field, String value, MarshalerContext context) Returns the size of a string field.
-
Method Details
-
groupByResourceAndScope
public static <T> Map<Resource, Map<InstrumentationScopeInfo, List<T>>> groupByResourceAndScope(Collection<T> dataList, Function<T, Resource> getResource, Function<T, InstrumentationScopeInfo> getInstrumentationScope, MarshalerContext context) Groups SDK items by resource and instrumentation scope. -
sizeStringWithContext
public static int sizeStringWithContext(ProtoFieldInfo field, @Nullable String value, MarshalerContext context) Returns the size of a string field. This method adds elements to context, use together withSerializer.serializeStringWithContext(ProtoFieldInfo, String, MarshalerContext). -
sizeRepeatedMessageWithContext
public static <T> int sizeRepeatedMessageWithContext(ProtoFieldInfo field, List<? extends T> messages, StatelessMarshaler<T> marshaler, MarshalerContext context) Returns the size of a repeated message field. This method adds elements to context, use together withSerializer.serializeRepeatedMessageWithContext(ProtoFieldInfo, List, StatelessMarshaler, MarshalerContext). -
sizeRepeatedMessageWithContext
public static <T> int sizeRepeatedMessageWithContext(ProtoFieldInfo field, Collection<? extends T> messages, StatelessMarshaler<T> marshaler, MarshalerContext context, MarshalerContext.Key key) Returns the size of a repeated message field. This method adds elements to context, use together withSerializer.serializeRepeatedMessageWithContext(ProtoFieldInfo, Collection, StatelessMarshaler, MarshalerContext, MarshalerContext.Key). -
sizeRepeatedMessageWithContext
public static <K,V> int sizeRepeatedMessageWithContext(ProtoFieldInfo field, Map<K, V> messages, StatelessMarshaler2<K, V> marshaler, MarshalerContext context, MarshalerContext.Key key) Returns the size of a repeated message field. This method adds elements to context, use together withSerializer.serializeRepeatedMessageWithContext(ProtoFieldInfo, Map, StatelessMarshaler2, MarshalerContext, MarshalerContext.Key). -
sizeRepeatedMessageWithContext
public static int sizeRepeatedMessageWithContext(ProtoFieldInfo field, Attributes attributes, StatelessMarshaler2<AttributeKey<?>, Object> marshaler, MarshalerContext context) Returns the size of a repeated message field. This method adds elements to context, use together withSerializer.serializeRepeatedMessageWithContext(ProtoFieldInfo, Attributes, StatelessMarshaler2, MarshalerContext). -
sizeMessageWithContext
public static <T> int sizeMessageWithContext(ProtoFieldInfo field, T element, StatelessMarshaler<T> marshaler, MarshalerContext context) Returns the size of a message field. This method adds elements to context, use together withSerializer.serializeMessageWithContext(ProtoFieldInfo, Object, StatelessMarshaler, MarshalerContext). -
sizeMessageWithContext
public static <K,V> int sizeMessageWithContext(ProtoFieldInfo field, K key, V value, StatelessMarshaler2<K, V> marshaler, MarshalerContext context) Returns the size of a message field. This method adds elements to context, use together withSerializer.serializeMessageWithContext(ProtoFieldInfo, Object, Object, StatelessMarshaler2, MarshalerContext).
-