Package io.grpc.util
Class ForwardingClientStreamTracer
- java.lang.Object
-
- io.grpc.StreamTracer
-
- io.grpc.ClientStreamTracer
-
- io.grpc.util.ForwardingClientStreamTracer
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") public abstract class ForwardingClientStreamTracer extends ClientStreamTracer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.ClientStreamTracer
ClientStreamTracer.Factory, ClientStreamTracer.StreamInfo
-
-
Field Summary
-
Fields inherited from class io.grpc.ClientStreamTracer
NAME_RESOLUTION_DELAYED
-
-
Constructor Summary
Constructors Constructor Description ForwardingClientStreamTracer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddOptionalLabel(String key, String value)Information providing context to the call became available.voidcreatePendingStream()Name resolution is completed and the connection starts getting established.protected abstract ClientStreamTracerdelegate()Returns the underlyingClientStreamTracer.voidinboundHeaders()Headers has been received from the server.voidinboundHeaders(Metadata headers)Headers has been received from the server.voidinboundMessage(int seqNo)An inbound message has been received by the stream.voidinboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize)An inbound message has been fully read from the transport.voidinboundTrailers(Metadata trailers)Trailing metadata has been received from the server.voidinboundUncompressedSize(long bytes)The uncompressed size of some inbound data is revealed.voidinboundWireSize(long bytes)The wire size of some inbound data is revealed.voidoutboundHeaders()Headers has been sent to the socket.voidoutboundMessage(int seqNo)An outbound message has been passed to the stream.voidoutboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize)An outbound message has been serialized and sent to the transport.voidoutboundUncompressedSize(long bytes)The uncompressed size of some outbound data is revealed.voidoutboundWireSize(long bytes)The wire size of some outbound data is revealed.voidstreamClosed(Status status)Stream is closed.voidstreamCreated(Attributes transportAttrs, Metadata headers)The stream is being created on a ready transport.StringtoString()
-
-
-
Method Detail
-
delegate
protected abstract ClientStreamTracer delegate()
Returns the underlyingClientStreamTracer.
-
streamCreated
public void streamCreated(Attributes transportAttrs, Metadata headers)
Description copied from class:ClientStreamTracerThe stream is being created on a ready transport.- Overrides:
streamCreatedin classClientStreamTracerheaders- the mutable initial metadata. Modifications to it will be sent to the socket but not be seen by client interceptors and the application.
-
createPendingStream
public void createPendingStream()
Description copied from class:ClientStreamTracerName resolution is completed and the connection starts getting established. This method is only invoked on the streams that encounter such delay. gRPC buffers the client call if the remote address and configurations, e.g. timeouts and retry policy, are not ready. Asynchronously gRPC internally does the name resolution to get this information. The streams that are processed immediately on ready transports by the time the RPC comes do not go through the pending process, thus this callback will not be invoked.- Overrides:
createPendingStreamin classClientStreamTracer
-
outboundHeaders
public void outboundHeaders()
Description copied from class:ClientStreamTracerHeaders has been sent to the socket.- Overrides:
outboundHeadersin classClientStreamTracer
-
inboundHeaders
public void inboundHeaders()
Description copied from class:ClientStreamTracerHeaders has been received from the server.- Overrides:
inboundHeadersin classClientStreamTracer
-
inboundHeaders
public void inboundHeaders(Metadata headers)
Description copied from class:ClientStreamTracerHeaders has been received from the server. This method does not pass ownership toheaders, so implementations must not access the metadata after returning. Modifications to the metadata within this method will be seen by interceptors and the application.- Overrides:
inboundHeadersin classClientStreamTracer- Parameters:
headers- the received header metadata
-
inboundTrailers
public void inboundTrailers(Metadata trailers)
Description copied from class:ClientStreamTracerTrailing metadata has been received from the server. This method does not pass ownership totrailers, so implementations must not access the metadata after returning. Modifications to the metadata within this method will be seen by interceptors and the application.- Overrides:
inboundTrailersin classClientStreamTracer- Parameters:
trailers- the received trailing metadata
-
addOptionalLabel
public void addOptionalLabel(String key, String value)
Description copied from class:ClientStreamTracerInformation providing context to the call became available.- Overrides:
addOptionalLabelin classClientStreamTracer
-
streamClosed
public void streamClosed(Status status)
Description copied from class:StreamTracerStream is closed. This will be called exactly once.- Overrides:
streamClosedin classStreamTracer
-
outboundMessage
public void outboundMessage(int seqNo)
Description copied from class:StreamTracerAn outbound message has been passed to the stream. This is called as soon as the stream knows about the message, but doesn't have further guarantee such as whether the message is serialized or not.- Overrides:
outboundMessagein classStreamTracer- Parameters:
seqNo- the sequential number of the message within the stream, starting from 0. It can be used to correlate withStreamTracer.outboundMessageSent(int, long, long)for the same message.
-
inboundMessage
public void inboundMessage(int seqNo)
Description copied from class:StreamTracerAn inbound message has been received by the stream. This is called as soon as the stream knows about the message, but doesn't have further guarantee such as whether the message is deserialized or not.- Overrides:
inboundMessagein classStreamTracer- Parameters:
seqNo- the sequential number of the message within the stream, starting from 0. It can be used to correlate withStreamTracer.inboundMessageRead(int, long, long)for the same message.
-
outboundMessageSent
public void outboundMessageSent(int seqNo, long optionalWireSize, long optionalUncompressedSize)Description copied from class:StreamTracerAn outbound message has been serialized and sent to the transport.- Overrides:
outboundMessageSentin classStreamTracer- Parameters:
seqNo- the sequential number of the message within the stream, starting from 0. It can be used to correlate withStreamTracer.outboundMessage(int)for the same message.optionalWireSize- the wire size of the message. -1 if unknownoptionalUncompressedSize- the uncompressed serialized size of the message. -1 if unknown
-
inboundMessageRead
public void inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize)Description copied from class:StreamTracerAn inbound message has been fully read from the transport.- Overrides:
inboundMessageReadin classStreamTracer- Parameters:
seqNo- the sequential number of the message within the stream, starting from 0. It can be used to correlate withStreamTracer.inboundMessage(int)for the same message.optionalWireSize- the wire size of the message. -1 if unknownoptionalUncompressedSize- the uncompressed serialized size of the message. -1 if unknown
-
outboundWireSize
public void outboundWireSize(long bytes)
Description copied from class:StreamTracerThe wire size of some outbound data is revealed. This can only used to record the accumulative outbound wire size. There is no guarantee wrt timing or granularity of this method.- Overrides:
outboundWireSizein classStreamTracer
-
outboundUncompressedSize
public void outboundUncompressedSize(long bytes)
Description copied from class:StreamTracerThe uncompressed size of some outbound data is revealed. This can only used to record the accumulative outbound uncompressed size. There is no guarantee wrt timing or granularity of this method.- Overrides:
outboundUncompressedSizein classStreamTracer
-
inboundWireSize
public void inboundWireSize(long bytes)
Description copied from class:StreamTracerThe wire size of some inbound data is revealed. This can only be used to record the accumulative received wire size. There is no guarantee wrt timing or granularity of this method.- Overrides:
inboundWireSizein classStreamTracer
-
inboundUncompressedSize
public void inboundUncompressedSize(long bytes)
Description copied from class:StreamTracerThe uncompressed size of some inbound data is revealed. This can only used to record the accumulative received uncompressed size. There is no guarantee wrt timing or granularity of this method.- Overrides:
inboundUncompressedSizein classStreamTracer
-
-