in grpc-gcp/src/main/java/com/google/cloud/grpc/GcpManagedChannel.java [1289:1308]
public <ReqT, RespT> ClientCall<ReqT, RespT> newCall(
MethodDescriptor<ReqT, RespT> methodDescriptor, CallOptions callOptions) {
if (callOptions.getOption(DISABLE_AFFINITY_KEY)
|| DISABLE_AFFINITY_CTX_KEY.get(Context.current())) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest(log("Channel affinity is disabled via context or call options."));
}
return new GcpClientCall.SimpleGcpClientCall<>(
getChannelRef(null), methodDescriptor, callOptions);
}
AffinityConfig affinity = methodToAffinity.get(methodDescriptor.getFullMethodName());
String key = keyFromOptsCtx(callOptions);
if (affinity != null && key == null) {
return new GcpClientCall<>(this, methodDescriptor, callOptions, affinity);
}
return new GcpClientCall.SimpleGcpClientCall<>(
getChannelRef(key), methodDescriptor, callOptions);
}