Sitelet https://github.com/googleapis/sdk-platform-java/pull/4136/files
Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -693,13 +693,8 @@ ChannelCredentials createS2ASecuredChannelCredentials() {
return s2aChannelCredentials;
}

private ManagedChannel createSingleChannel() throws IOException {
GrpcHeaderInterceptor headerInterceptor =
new GrpcHeaderInterceptor(headersWithDuplicatesRemoved);

GrpcMetadataHandlerInterceptor metadataHandlerInterceptor =
new GrpcMetadataHandlerInterceptor();

@InternalApi("For internal use by google-cloud-java clients only")
public ManagedChannelBuilder<?> createChannelBuilder() throws IOException {
int colon = endpoint.lastIndexOf(':');
if (colon < 0) {
throw new IllegalStateException("invalid endpoint - should have been validated: " + endpoint);
Expand Down Expand Up @@ -775,8 +770,19 @@ private ManagedChannel createSingleChannel() throws IOException {
// See https://github.com/googleapis/gapic-generator/issues/2816
builder.disableServiceConfigLookUp();
}
builder =
builder
return builder;
}

@InternalApi("For internal use by google-cloud-java clients only")
public ManagedChannelBuilder<?> createDecoratedChannelBuilder() throws IOException {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq IIRC, the createChannelBuilder() method will be used the BigTable to create the channel and they can add whatever functionality on top of it. Is this one also used downstream? If not, can this be package-private?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be useful for Cloud Spanner team as they also have a need to get the channel builder but with all interceptors.

GrpcHeaderInterceptor headerInterceptor =
new GrpcHeaderInterceptor(headersWithDuplicatesRemoved);

GrpcMetadataHandlerInterceptor metadataHandlerInterceptor =
new GrpcMetadataHandlerInterceptor();

ManagedChannelBuilder<?> builder =
createChannelBuilder()
.intercept(new GrpcChannelUUIDInterceptor())
.intercept(new GrpcLoggingInterceptor())
.intercept(headerInterceptor)
Expand Down Expand Up @@ -806,6 +812,12 @@ private ManagedChannel createSingleChannel() throws IOException {
builder = channelConfigurator.apply(builder);
}

return builder;
}

private ManagedChannel createSingleChannel() throws IOException {
ManagedChannelBuilder<?> builder = createDecoratedChannelBuilder();

ManagedChannel managedChannel = builder.build();
if (channelPrimer != null) {
channelPrimer.primeChannel(managedChannel);
Expand Down
Loading