Class LowAllocationLogsRequestMarshaler
- java.lang.Object
-
- io.opentelemetry.exporter.internal.marshal.Marshaler
-
- io.opentelemetry.exporter.internal.otlp.logs.LowAllocationLogsRequestMarshaler
-
public final class LowAllocationLogsRequestMarshaler extends Marshaler
Marshalerto convert SDKLogRecordDatato 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 MarshalerContextcontextprivate static MarshalerContext.KeyRESOURCE_LOG_SIZE_CALCULATOR_KEYprivate static MarshalerContext.KeyRESOURCE_LOG_WRITER_KEYprivate java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>>resourceAndScopeMapprivate intsize
-
Constructor Summary
Constructors Constructor Description LowAllocationLogsRequestMarshaler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static intcalculateSize(MarshalerContext context, java.util.Map<Resource,java.util.Map<InstrumentationScopeInfo,java.util.List<LogRecordData>>> resourceAndScopeMap)intgetBinarySerializedSize()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)voidinitialize(java.util.Collection<LogRecordData> logDataList)voidreset()voidwriteTo(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:MarshalerReturns the number of bytes this Marshaler will write in proto binary format.- Specified by:
getBinarySerializedSizein 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)
-
-