Top Description Inners Fields Constructors Methods
io.grpc

public abstract Class ClientStreamTracer

extends StreamTracer
Class Inheritance
Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/2861
@ThreadSafe
Static Imports
com.google.common.base.Preconditions.checkNotNull

StreamTracer for the client-side.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
public static class
ClientStreamTracer.StreamInfo

Information about a stream.

Field Summary

Modifier and TypeField and Description
public static final CallOptions.Key<Long>
NAME_RESOLUTION_DELAYED

Indicates how long the call was delayed, in nanoseconds, due to waiting for name resolution result.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
createPendingStream()

Name resolution is completed and the connection starts getting established.

public void
inboundHeaders()

Headers has been received from the server.

public void
inboundTrailers(Metadata
the mutable trailing metadata. Modifications to it will be seen by interceptors and the application.
trailers
)

Trailing metadata has been received from the server.

public void
outboundHeaders()

Headers has been sent to the socket.

public void
streamCreated(Attributes transportAttrs, Metadata
the mutable initial metadata. Modifications to it will be sent to the socket but not be seen by client interceptors and the application.
headers
)

The stream is being created on a ready transport.

Inherited from io.grpc.StreamTracer:
inboundMessageinboundMessageReadinboundUncompressedSizeinboundWireSizeoutboundMessageoutboundMessageSentoutboundUncompressedSizeoutboundWireSizestreamClosed

Field Detail

NAME_RESOLUTION_DELAYEDback to summary
public static final CallOptions.Key<Long> NAME_RESOLUTION_DELAYED

Indicates how long the call was delayed, in nanoseconds, due to waiting for name resolution result. If the call option is not set, the call did not experience name resolution delay.

Constructor Detail

ClientStreamTracerback to summary
public ClientStreamTracer()

Method Detail

createPendingStreamback to summary
public void createPendingStream()

Name 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.
inboundHeadersback to summary
public void inboundHeaders()

Headers has been received from the server.

inboundTrailersback to summary
public void inboundTrailers(Metadata trailers)

Trailing metadata has been received from the server.

Parameters
trailers:Metadata

the mutable trailing metadata. Modifications to it will be seen by interceptors and the application.

Since
1.17.0
outboundHeadersback to summary
public void outboundHeaders()

Headers has been sent to the socket.

streamCreatedback to summary
public void streamCreated(Attributes transportAttrs, Metadata headers)

The stream is being created on a ready transport.

Parameters
headers:Metadata

the mutable initial metadata. Modifications to it will be sent to the socket but not be seen by client interceptors and the application.

Since
1.40.0
io.grpc back to summary

public abstract Class ClientStreamTracer.Factory

extends Object
Class Inheritance

Factory class for ClientStreamTracer.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ClientStreamTracer
newClientStreamTracer(ClientStreamTracer.StreamInfo
information about the stream
info
,
Metadata
the mutable headers of the stream. It can be safely mutated within this method. Changes made to it will be sent by the stream. It should not be saved because it is not safe for read or write after the method returns.
headers
)

Creates a ClientStreamTracer for a new client stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

newClientStreamTracerback to summary
public ClientStreamTracer newClientStreamTracer(ClientStreamTracer.StreamInfo info, Metadata headers)

Creates a ClientStreamTracer for a new client stream. This is called inside the transport when it's creating the stream.

Parameters
info:ClientStreamTracer.StreamInfo

information about the stream

headers:Metadata

the mutable headers of the stream. It can be safely mutated within this method. Changes made to it will be sent by the stream. It should not be saved because it is not safe for read or write after the method returns.

Since
1.20.0
io.grpc back to summary

public final Class ClientStreamTracer.StreamInfo

extends Object
Class Inheritance
Annotations
@ExperimentalApi:https://github.com/grpc/grpc-java/issues/2861

Information about a stream.

Note this class doesn't override equals() and hashCode, as is the case for CallOptions.

Since
1.20.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final CallOptions
private final boolean
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
StreamInfo(CallOptions callOptions, int previousAttempts, boolean isTransparentRetry)

Method Summary

Modifier and TypeMethod and Description
public CallOptions
getCallOptions()

Returns the effective CallOptions of the call.

public int
getPreviousAttempts()

Returns the number of preceding attempts for the RPC.

public boolean
isTransparentRetry()

Whether the stream is a transparent retry.

public static ClientStreamTracer.StreamInfo.Builder
newBuilder()

Creates an empty Builder.

public ClientStreamTracer.StreamInfo.Builder
toBuilder()

Converts this StreamInfo into a new Builder.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

callOptionsback to summary
private final CallOptions callOptions
isTransparentRetryback to summary
private final boolean isTransparentRetry
previousAttemptsback to summary
private final int previousAttempts

Constructor Detail

StreamInfoback to summary
pack-priv StreamInfo(CallOptions callOptions, int previousAttempts, boolean isTransparentRetry)

Method Detail

getCallOptionsback to summary
public CallOptions getCallOptions()

Returns the effective CallOptions of the call.

getPreviousAttemptsback to summary
public int getPreviousAttempts()

Returns the number of preceding attempts for the RPC.

Since
1.40.0
isTransparentRetryback to summary
public boolean isTransparentRetry()

Whether the stream is a transparent retry.

Since
1.40.0
newBuilderback to summary
public static ClientStreamTracer.StreamInfo.Builder newBuilder()

Creates an empty Builder.

Since
1.21.0
toBuilderback to summary
public ClientStreamTracer.StreamInfo.Builder toBuilder()

Converts this StreamInfo into a new Builder.

Since
1.21.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
io.grpc back to summary

public final Class ClientStreamTracer.StreamInfo.Builder

extends Object
Class Inheritance

Builds StreamInfo objects.
Since
1.21.0

Field Summary

Modifier and TypeField and Description
private CallOptions
private boolean
private int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ClientStreamTracer.StreamInfo
build()

Builds a new StreamInfo.

public ClientStreamTracer.StreamInfo.Builder
setCallOptions(CallOptions callOptions)

Sets the effective CallOptions of the call.

public ClientStreamTracer.StreamInfo.Builder
setIsTransparentRetry(boolean isTransparentRetry)

Sets whether the stream is a transparent retry.

public ClientStreamTracer.StreamInfo.Builder
setPreviousAttempts(int previousAttempts)

Set the number of preceding attempts of the RPC.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callOptionsback to summary
private CallOptions callOptions
isTransparentRetryback to summary
private boolean isTransparentRetry
previousAttemptsback to summary
private int previousAttempts

Constructor Detail

Builderback to summary
pack-priv Builder()

Method Detail

buildback to summary
public ClientStreamTracer.StreamInfo build()

Builds a new StreamInfo.

setCallOptionsback to summary
public ClientStreamTracer.StreamInfo.Builder setCallOptions(CallOptions callOptions)

Sets the effective CallOptions of the call. This field is optional.

setIsTransparentRetryback to summary
public ClientStreamTracer.StreamInfo.Builder setIsTransparentRetry(boolean isTransparentRetry)

Sets whether the stream is a transparent retry.

Since
1.40.0
setPreviousAttemptsback to summary
public ClientStreamTracer.StreamInfo.Builder setPreviousAttempts(int previousAttempts)

Set the number of preceding attempts of the RPC.

Since
1.40.0