Skip to content

Commit 2043063

Browse files
authored
feat: attempt DirectPath by default (#544)
1 parent 44d77e6 commit 2043063

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java

+4-24
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
8989
private static final int MAX_MESSAGE_SIZE = 256 * 1024 * 1024;
9090
private static final String SERVER_DEFAULT_APP_PROFILE_ID = "";
9191

92-
// TODO(weiranf): Remove this temporary endpoint once DirectPath goes to public beta
93-
private static final String DIRECT_PATH_ENDPOINT = "test-bigtable.sandbox.googleapis.com:443";
94-
9592
private static final Set<Code> IDEMPOTENT_RETRY_CODES =
9693
ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE);
9794

@@ -170,12 +167,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
170167
private EnhancedBigtableStubSettings(Builder builder) {
171168
super(builder);
172169

173-
if (DIRECT_PATH_ENDPOINT.equals(builder.getEndpoint())) {
174-
logger.warning(
175-
"Connecting to Bigtable using DirectPath."
176-
+ " This is currently an experimental feature and should not be used in production.");
177-
}
178-
179170
// Since point reads, streaming reads, bulk reads share the same base callable that converts
180171
// grpc errors into ApiExceptions, they must have the same retry codes.
181172
Preconditions.checkState(
@@ -248,13 +239,9 @@ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProvi
248239
.setKeepAliveTime(Duration.ofSeconds(30)) // sends ping in this interval
249240
.setKeepAliveTimeout(
250241
Duration.ofSeconds(10)) // wait this long before considering the connection dead
251-
// TODO(weiranf): Set this to true by default once DirectPath goes to public beta
252-
.setAttemptDirectPath(isDirectPathEnabled());
253-
}
254-
255-
// TODO(weiranf): Remove this once DirectPath goes to public beta
256-
private static boolean isDirectPathEnabled() {
257-
return Boolean.getBoolean("bigtable.attempt-directpath");
242+
// Attempts direct access to CBT service over gRPC to improve throughput,
243+
// whether the attempt is allowed is totally controlled by service owner.
244+
.setAttemptDirectPath(true);
258245
}
259246

260247
static int getDefaultChannelPoolSize() {
@@ -529,14 +516,7 @@ private Builder() {
529516
// Defaults provider
530517
BigtableStubSettings.Builder baseDefaults = BigtableStubSettings.newBuilder();
531518

532-
// TODO(weiranf): remove this once DirectPath goes to public Beta and uses the default
533-
// endpoint.
534-
if (isDirectPathEnabled()) {
535-
setEndpoint(DIRECT_PATH_ENDPOINT);
536-
} else {
537-
setEndpoint(baseDefaults.getEndpoint());
538-
}
539-
519+
setEndpoint(baseDefaults.getEndpoint());
540520
setTransportChannelProvider(defaultTransportChannelProvider());
541521
setStreamWatchdogCheckInterval(baseDefaults.getStreamWatchdogCheckInterval());
542522
setStreamWatchdogProvider(baseDefaults.getStreamWatchdogProvider());

0 commit comments

Comments
 (0)