Class LowAllocationLogsRequestMarshaler
- java.lang.Object
-
- io.opentelemetry.exporter.internal.marshal.Marshaler
-
- io.opentelemetry.exporter.internal.otlp.logs.LowAllocationLogsRequestMarshaler
-
public final class LowAllocationLogsRequestMarshaler extends Marshaler
Marshaler
to convert SDKLogRecordData
to OTLP ExportLogsServiceRequest. SeeLogsRequestMarshaler
.Example usage:
void marshal(LowAllocationLogRequestMarshaler requestMarshaler, OutputStream output, List<LogRecordData> logDataList) throws IOException { requestMarshaler.initialize(logDataList); try { requestMarshaler.writeBinaryTo(output); } finally { requestMarshaler.reset(); } }
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 MarshalerContext
context
private static MarshalerContext.Key
RESOURCE_LOG_SIZE_CALCULATOR_KEY
private static MarshalerContext.Key
RESOURCE_LOG_WRITER_KEY
private java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>>
resourceAndScopeMap
private int
size
-
Constructor Summary
Constructors Constructor Description LowAllocationLogsRequestMarshaler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
calculateSize(MarshalerContext context, java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>> resourceAndScopeMap)
int
getBinarySerializedSize()
Returns the number of bytes this Marshaler will write in proto binary format.private static java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>>
groupByResourceAndScope(MarshalerContext context, java.util.Collection<LogRecordData> logDataList)
void
initialize(java.util.Collection<LogRecordData> logDataList)
void
reset()
void
writeTo(Serializer output)
-
Methods inherited from class io.opentelemetry.exporter.internal.marshal.Marshaler
writeBinaryTo, writeJsonTo, writeJsonTo, writeJsonWithNewline
-
-
-
-
Field Detail
-
RESOURCE_LOG_SIZE_CALCULATOR_KEY
private static final MarshalerContext.Key RESOURCE_LOG_SIZE_CALCULATOR_KEY
-
RESOURCE_LOG_WRITER_KEY
private static final MarshalerContext.Key RESOURCE_LOG_WRITER_KEY
-
context
private final MarshalerContext context
-
resourceAndScopeMap
private java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>> resourceAndScopeMap
-
size
private int size
-
-
Method Detail
-
initialize
public void initialize(java.util.Collection<LogRecordData> logDataList)
-
reset
public void reset()
-
getBinarySerializedSize
public int getBinarySerializedSize()
Description copied from class:Marshaler
Returns the number of bytes this Marshaler will write in proto binary format.- Specified by:
getBinarySerializedSize
in classMarshaler
-
writeTo
public void writeTo(Serializer output) throws java.io.IOException
-
calculateSize
private static int calculateSize(MarshalerContext context, java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>> resourceAndScopeMap)
-
groupByResourceAndScope
private static java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>> groupByResourceAndScope(MarshalerContext context, java.util.Collection<LogRecordData> logDataList)
-
-