Skip to content

Commit

Permalink
feat: Bigtable supports universe domain
Browse files Browse the repository at this point in the history
  • Loading branch information
amanda-tarafa committed Feb 7, 2024
1 parent f3ac59a commit c3610f9
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -205,22 +205,22 @@ private BigtableServiceApiClientBuilder MaybeCreateEmulatorClientBuilder()
protected override CallInvoker CreateCallInvoker() => CallInvoker ?? CreateGcpCallInvoker();

/// <summary>
///
/// Creates a <see cref="GcpCallInvoker"/> which is a call invoker that can distribute calls across
/// different underlying channels based on request properties.
/// </summary>
/// <returns></returns>
public GcpCallInvoker CreateGcpCallInvoker()
{
GaxPreconditions.CheckState(CallInvoker is null,
"Cannot call {0} on a builder that already has {1} set.", nameof(CreateGcpCallInvoker), nameof(CallInvoker));
var endpoint = Endpoint ?? ServiceMetadata.DefaultEndpoint;
var endpoint = EffectiveEndpoint;
var channelOptions = GetChannelOptions();
var apiConfig = Settings.CreateApiConfig();
var grpcAdapter = EffectiveGrpcAdapter;
// Although *we* never allow the use of the channel pool, we can use the call invoker pool if and
// only if the base class thinks it can use the channel pool - i.e. it's only using default credentials.
if (base.CanUseChannelPool)
{
return CallInvokerPool.GetCallInvoker(endpoint, channelOptions, apiConfig, grpcAdapter);
return CallInvokerPool.GetCallInvoker(EffectiveUniverseDomain, endpoint, channelOptions, apiConfig, grpcAdapter);
}
else
{
Expand All @@ -245,22 +245,22 @@ protected override async Task<CallInvoker> CreateCallInvokerAsync(CancellationTo
CallInvoker ?? await CreateGcpCallInvokerAsync(cancellationToken).ConfigureAwait(false);

/// <summary>
///
/// Creates a <see cref="GcpCallInvoker"/> which is a call invoker that can distribute calls across
/// different underlying channels based on request properties.
/// </summary>
/// <returns></returns>
public async Task<GcpCallInvoker> CreateGcpCallInvokerAsync(CancellationToken cancellationToken)
{
GaxPreconditions.CheckState(CallInvoker is null,
"Cannot call {0} on a builder that already has {1} set.", nameof(CreateGcpCallInvoker), nameof(CallInvoker));
var endpoint = Endpoint ?? ServiceMetadata.DefaultEndpoint;
var endpoint = EffectiveEndpoint;
var channelOptions = GetChannelOptions();
var apiConfig = Settings.CreateApiConfig();
var grpcAdapter = EffectiveGrpcAdapter;
// Although *we* never allow the use of the channel pool, we can use the call invoker pool if and
// only if the base class thinks it can use the channel pool - i.e. it's only using default credentials.
if (base.CanUseChannelPool)
{
return await CallInvokerPool.GetCallInvokerAsync(endpoint, channelOptions, apiConfig, grpcAdapter).ConfigureAwait(false);
return await CallInvokerPool.GetCallInvokerAsync(EffectiveUniverseDomain, endpoint, channelOptions, apiConfig, grpcAdapter, cancellationToken).ConfigureAwait(false);
}
else
{
Expand Down

0 comments on commit c3610f9

Please sign in to comment.