Class ResourceLogsMarshaler
- java.lang.Object
-
- io.opentelemetry.exporter.internal.marshal.Marshaler
-
- io.opentelemetry.exporter.internal.marshal.MarshalerWithSize
-
- io.opentelemetry.exporter.internal.otlp.logs.ResourceLogsMarshaler
-
public final class ResourceLogsMarshaler extends MarshalerWithSize
A Marshaler of ResourceLogs.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 InstrumentationScopeLogsMarshaler[]instrumentationScopeLogsMarshalersprivate ResourceMarshalerresourceMarshalerprivate byte[]schemaUrl
-
Constructor Summary
Constructors Constructor Description ResourceLogsMarshaler(ResourceMarshaler resourceMarshaler, byte[] schemaUrl, InstrumentationScopeLogsMarshaler[] instrumentationScopeLogsMarshalers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcalculateSize(ResourceMarshaler resourceMarshaler, byte[] schemaUrl, InstrumentationScopeLogsMarshaler[] instrumentationScopeLogsMarshalers)static ResourceLogsMarshaler[]create(java.util.Collection<LogRecordData> logs)Returns Marshalers of ResourceLogs created by grouping the provided logRecords.private static java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<Marshaler>>>groupByResourceAndScope(java.util.Collection<LogRecordData> logs)voidwriteTo(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
-
resourceMarshaler
private final ResourceMarshaler resourceMarshaler
-
schemaUrl
private final byte[] schemaUrl
-
instrumentationScopeLogsMarshalers
private final InstrumentationScopeLogsMarshaler[] instrumentationScopeLogsMarshalers
-
-
Constructor Detail
-
ResourceLogsMarshaler
ResourceLogsMarshaler(ResourceMarshaler resourceMarshaler, byte[] schemaUrl, InstrumentationScopeLogsMarshaler[] instrumentationScopeLogsMarshalers)
-
-
Method Detail
-
create
public static ResourceLogsMarshaler[] create(java.util.Collection<LogRecordData> logs)
Returns Marshalers of ResourceLogs created by grouping the provided logRecords.
-
writeTo
public void writeTo(Serializer output) throws java.io.IOException
-
calculateSize
private static int calculateSize(ResourceMarshaler resourceMarshaler, byte[] schemaUrl, InstrumentationScopeLogsMarshaler[] instrumentationScopeLogsMarshalers)
-
groupByResourceAndScope
private static java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<Marshaler>>> groupByResourceAndScope(java.util.Collection<LogRecordData> logs)
-
-