Package io.grpc.protobuf.services
Class BinlogHelper.SinkWriterImpl
java.lang.Object
io.grpc.protobuf.services.BinlogHelper.SinkWriter
io.grpc.protobuf.services.BinlogHelper.SinkWriterImpl
- Enclosing class:
BinlogHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
private final BinaryLogSink
private BinlogHelper.TimeProvider
-
Constructor Summary
ConstructorsConstructorDescriptionSinkWriterImpl
(BinaryLogSink sink, BinlogHelper.TimeProvider timeProvider, int maxHeaderBytes, int maxMessageBytes) -
Method Summary
Modifier and TypeMethodDescription(package private) int
Returns the number bytes of the header this writer will log, according to configuration.(package private) int
Returns the number bytes of the message this writer will log, according to configuration.(package private) void
logCancel
(long seq, GrpcLogEntry.Logger logger, long callId) Logs the cancellation.(package private) void
logClientHeader
(long seq, String methodName, String authority, com.google.protobuf.Duration timeout, Metadata metadata, GrpcLogEntry.Logger logger, long callId, SocketAddress peerAddress) Logs the client header.(package private) void
logHalfClose
(long seq, GrpcLogEntry.Logger logger, long callId) (package private) <T> void
logRpcMessage
(long seq, GrpcLogEntry.EventType eventType, MethodDescriptor.Marshaller<T> marshaller, T message, GrpcLogEntry.Logger logger, long callId) Logs the message message.(package private) void
logServerHeader
(long seq, Metadata metadata, GrpcLogEntry.Logger logger, long callId, SocketAddress peerAddress) Logs the server header.(package private) void
logTrailer
(long seq, Status status, Metadata metadata, GrpcLogEntry.Logger logger, long callId, SocketAddress peerAddress) Logs the server trailer.(package private) GrpcLogEntry.Builder
-
Field Details
-
sink
-
timeProvider
-
maxHeaderBytes
private final int maxHeaderBytes -
maxMessageBytes
private final int maxMessageBytes
-
-
Constructor Details
-
SinkWriterImpl
SinkWriterImpl(BinaryLogSink sink, BinlogHelper.TimeProvider timeProvider, int maxHeaderBytes, int maxMessageBytes)
-
-
Method Details
-
newTimestampedBuilder
GrpcLogEntry.Builder newTimestampedBuilder() -
logClientHeader
void logClientHeader(long seq, String methodName, @Nullable String authority, @Nullable com.google.protobuf.Duration timeout, Metadata metadata, GrpcLogEntry.Logger logger, long callId, @Nullable SocketAddress peerAddress) Description copied from class:BinlogHelper.SinkWriter
Logs the client header. This method logs the appropriate number of bytes as determined by the binary logging configuration.- Specified by:
logClientHeader
in classBinlogHelper.SinkWriter
-
logServerHeader
void logServerHeader(long seq, Metadata metadata, GrpcLogEntry.Logger logger, long callId, @Nullable SocketAddress peerAddress) Description copied from class:BinlogHelper.SinkWriter
Logs the server header. This method logs the appropriate number of bytes as determined by the binary logging configuration.- Specified by:
logServerHeader
in classBinlogHelper.SinkWriter
-
logTrailer
void logTrailer(long seq, Status status, Metadata metadata, GrpcLogEntry.Logger logger, long callId, @Nullable SocketAddress peerAddress) Description copied from class:BinlogHelper.SinkWriter
Logs the server trailer. This method logs the appropriate number of bytes as determined by the binary logging configuration.- Specified by:
logTrailer
in classBinlogHelper.SinkWriter
-
logRpcMessage
<T> void logRpcMessage(long seq, GrpcLogEntry.EventType eventType, MethodDescriptor.Marshaller<T> marshaller, T message, GrpcLogEntry.Logger logger, long callId) Description copied from class:BinlogHelper.SinkWriter
Logs the message message. The number of bytes logged is determined by the binary logging configuration.- Specified by:
logRpcMessage
in classBinlogHelper.SinkWriter
-
logHalfClose
- Specified by:
logHalfClose
in classBinlogHelper.SinkWriter
-
logCancel
Description copied from class:BinlogHelper.SinkWriter
Logs the cancellation.- Specified by:
logCancel
in classBinlogHelper.SinkWriter
-
getMaxHeaderBytes
int getMaxHeaderBytes()Description copied from class:BinlogHelper.SinkWriter
Returns the number bytes of the header this writer will log, according to configuration.- Specified by:
getMaxHeaderBytes
in classBinlogHelper.SinkWriter
-
getMaxMessageBytes
int getMaxMessageBytes()Description copied from class:BinlogHelper.SinkWriter
Returns the number bytes of the message this writer will log, according to configuration.- Specified by:
getMaxMessageBytes
in classBinlogHelper.SinkWriter
-