Skip to content

Commit 89c622d

Browse files
authored
feat: attemp DirectPath by default (googleapis#467)
* feat: attemp DirectPath by default * Add comment for DP attempt
1 parent 9e56edf commit 89c622d

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

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

+4-23
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
8585
private static final int MAX_MESSAGE_SIZE = 256 * 1024 * 1024;
8686
private static final String SERVER_DEFAULT_APP_PROFILE_ID = "";
8787

88-
// TODO(weiranf): Remove this temporary endpoint once DirectPath goes to public beta
89-
private static final String DIRECT_PATH_ENDPOINT = "test-bigtable.sandbox.googleapis.com:443";
90-
9188
private static final Set<Code> IDEMPOTENT_RETRY_CODES =
9289
ImmutableSet.of(Code.DEADLINE_EXCEEDED, Code.UNAVAILABLE);
9390

@@ -166,12 +163,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
166163
private EnhancedBigtableStubSettings(Builder builder) {
167164
super(builder);
168165

169-
if (DIRECT_PATH_ENDPOINT.equals(builder.getEndpoint())) {
170-
logger.warning(
171-
"Connecting to Bigtable using DirectPath."
172-
+ " This is currently an experimental feature and should not be used in production.");
173-
}
174-
175166
// Since point reads, streaming reads, bulk reads share the same base callable that converts
176167
// grpc errors into ApiExceptions, they must have the same retry codes.
177168
Preconditions.checkState(
@@ -245,13 +236,9 @@ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProvi
245236
.setKeepAliveTimeout(
246237
Duration.ofSeconds(10)) // wait this long before considering the connection dead
247238
.setKeepAliveWithoutCalls(true) // sends ping without active streams
248-
// TODO(weiranf): Set this to true by default once DirectPath goes to public beta
249-
.setAttemptDirectPath(isDirectPathEnabled());
250-
}
251-
252-
// TODO(weiranf): Remove this once DirectPath goes to public beta
253-
private static boolean isDirectPathEnabled() {
254-
return Boolean.getBoolean("bigtable.attempt-directpath");
239+
// Attempts direct access to CBT service over gRPC to improve throughput,
240+
// whether the attempt is allowed is totally controlled by service owner.
241+
.setAttemptDirectPath(true);
255242
}
256243

257244
static int getDefaultChannelPoolSize() {
@@ -526,13 +513,7 @@ private Builder() {
526513
// Defaults provider
527514
BigtableStubSettings.Builder baseDefaults = BigtableStubSettings.newBuilder();
528515

529-
// TODO(weiranf): remove this once DirectPath goes to public Beta and uses the default
530-
// endpoint.
531-
if (isDirectPathEnabled()) {
532-
setEndpoint(DIRECT_PATH_ENDPOINT);
533-
} else {
534-
setEndpoint(baseDefaults.getEndpoint());
535-
}
516+
setEndpoint(baseDefaults.getEndpoint());
536517

537518
setTransportChannelProvider(defaultTransportChannelProvider());
538519
setStreamWatchdogCheckInterval(baseDefaults.getStreamWatchdogCheckInterval());

0 commit comments

Comments
 (0)