Package io.grpc.grpclb
Class TokenAttachingTracerFactory
java.lang.Object
io.grpc.ClientStreamTracer.Factory
io.grpc.grpclb.TokenAttachingTracerFactory
Wraps a
ClientStreamTracer.Factory
, retrieves tokens from transport attributes and
attaches them to headers. This is only used in the PICK_FIRST mode.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientStreamTracer.Factory
private static final ClientStreamTracer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
newClientStreamTracer
(ClientStreamTracer.StreamInfo info, Metadata headers) Creates aClientStreamTracer
for a new client stream.
-
Field Details
-
NOOP_TRACER
-
delegate
-
-
Constructor Details
-
TokenAttachingTracerFactory
TokenAttachingTracerFactory(@Nullable ClientStreamTracer.Factory delegate)
-
-
Method Details
-
newClientStreamTracer
public ClientStreamTracer newClientStreamTracer(ClientStreamTracer.StreamInfo info, Metadata headers) Description copied from class:ClientStreamTracer.Factory
Creates aClientStreamTracer
for a new client stream. This is called inside the transport when it's creating the stream.- Overrides:
newClientStreamTracer
in classClientStreamTracer.Factory
- Parameters:
info
- information about the streamheaders
- 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.
-
hashCode
public int hashCode() -
equals
-