6565import java .util .List ;
6666import java .util .Map ;
6767import java .util .Set ;
68- import java .util .logging .Logger ;
6968import javax .annotation .Nonnull ;
7069import javax .annotation .Nullable ;
7170import org .threeten .bp .Duration ;
9998 * }</pre>
10099 */
101100public class EnhancedBigtableStubSettings extends StubSettings <EnhancedBigtableStubSettings > {
102- private static final Logger logger =
103- Logger .getLogger (EnhancedBigtableStubSettings .class .getName ());
104-
105101 // The largest message that can be received is a 256 MB ReadRowsResponse.
106102 private static final int MAX_MESSAGE_SIZE = 256 * 1024 * 1024 ;
107103 private static final String SERVER_DEFAULT_APP_PROFILE_ID = "" ;
@@ -145,7 +141,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
145141 .setRetryDelayMultiplier (2.0 )
146142 .setMaxRetryDelay (Duration .ofMinutes (1 ))
147143 .setMaxAttempts (10 )
148- .setJittered (true )
149144 .setInitialRpcTimeout (Duration .ofMinutes (30 ))
150145 .setRpcTimeoutMultiplier (2.0 )
151146 .setMaxRpcTimeout (Duration .ofMinutes (30 ))
@@ -172,7 +167,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
172167 .setRetryDelayMultiplier (2.0 )
173168 .setMaxRetryDelay (Duration .ofMinutes (1 ))
174169 .setMaxAttempts (10 )
175- .setJittered (true )
176170 .setInitialRpcTimeout (Duration .ofMinutes (1 ))
177171 .setRpcTimeoutMultiplier (2.0 )
178172 .setMaxRpcTimeout (Duration .ofMinutes (10 ))
@@ -211,7 +205,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
211205 .setRetryDelayMultiplier (2.0 )
212206 .setMaxRetryDelay (Duration .ofMinutes (1 ))
213207 .setMaxAttempts (10 )
214- .setJittered (true )
215208 .setInitialRpcTimeout (Duration .ofMinutes (30 ))
216209 .setRpcTimeoutMultiplier (1.0 )
217210 .setMaxRpcTimeout (Duration .ofMinutes (30 ))
@@ -255,9 +248,6 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
255248 private final String instanceId ;
256249 private final String appProfileId ;
257250 private final boolean isRefreshingChannel ;
258- private ImmutableList <String > primedTableIds ;
259- private final boolean enableRoutingCookie ;
260- private final boolean enableRetryInfo ;
261251
262252 private final ServerStreamingCallSettings <Query , Row > readRowsSettings ;
263253 private final UnaryCallSettings <Query , Row > readRowSettings ;
@@ -279,7 +269,7 @@ public class EnhancedBigtableStubSettings extends StubSettings<EnhancedBigtableS
279269
280270 private final MetricsProvider metricsProvider ;
281271 @ Nullable private final String metricsEndpoint ;
282- @ Nonnull private final boolean areInternalMetricsEnabled ;
272+ private final boolean areInternalMetricsEnabled ;
283273 private final String jwtAudience ;
284274
285275 private EnhancedBigtableStubSettings (Builder builder ) {
@@ -304,9 +294,6 @@ private EnhancedBigtableStubSettings(Builder builder) {
304294 instanceId = builder .instanceId ;
305295 appProfileId = builder .appProfileId ;
306296 isRefreshingChannel = builder .isRefreshingChannel ;
307- primedTableIds = builder .primedTableIds ;
308- enableRoutingCookie = builder .enableRoutingCookie ;
309- enableRetryInfo = builder .enableRetryInfo ;
310297 metricsProvider = builder .metricsProvider ;
311298 metricsEndpoint = builder .metricsEndpoint ;
312299 areInternalMetricsEnabled = builder .areInternalMetricsEnabled ;
@@ -366,7 +353,7 @@ public boolean isRefreshingChannel() {
366353 */
367354 @ Deprecated
368355 public List <String > getPrimedTableIds () {
369- return primedTableIds ;
356+ return ImmutableList . of () ;
370357 }
371358
372359 /**
@@ -384,21 +371,19 @@ public MetricsProvider getMetricsProvider() {
384371 }
385372
386373 /**
387- * Gets if routing cookie is enabled. If true, client will retry a request with extra metadata
388- * server sent back.
374+ * @deprecated routing cookies are always on.
389375 */
390- @ BetaApi ( "Routing cookie is not currently stable and may change in the future" )
376+ @ Deprecated
391377 public boolean getEnableRoutingCookie () {
392- return enableRoutingCookie ;
378+ return true ;
393379 }
394380
395381 /**
396- * Gets if RetryInfo is enabled. If true, client bases retry decision and back off time on server
397- * returned RetryInfo value. Otherwise, client uses {@link RetrySettings}.
382+ * @deprecated RetryInfo is now always on.
398383 */
399- @ BetaApi ( "RetryInfo is not currently stable and may change in the future" )
384+ @ Deprecated
400385 public boolean getEnableRetryInfo () {
401- return enableRetryInfo ;
386+ return true ;
402387 }
403388
404389 /**
@@ -745,10 +730,7 @@ public static class Builder extends StubSettings.Builder<EnhancedBigtableStubSet
745730 private String instanceId ;
746731 private String appProfileId ;
747732 private boolean isRefreshingChannel ;
748- private ImmutableList <String > primedTableIds ;
749733 private String jwtAudience ;
750- private boolean enableRoutingCookie ;
751- private boolean enableRetryInfo ;
752734
753735 private final ServerStreamingCallSettings .Builder <Query , Row > readRowsSettings ;
754736 private final UnaryCallSettings .Builder <Query , Row > readRowSettings ;
@@ -768,7 +750,7 @@ public static class Builder extends StubSettings.Builder<EnhancedBigtableStubSet
768750 private final UnaryCallSettings .Builder <PrepareQueryRequest , PrepareResponse >
769751 prepareQuerySettings ;
770752
771- private FeatureFlags .Builder featureFlags ;
753+ private final FeatureFlags .Builder featureFlags ;
772754
773755 private MetricsProvider metricsProvider ;
774756 @ Nullable private String metricsEndpoint ;
@@ -785,10 +767,7 @@ public static class Builder extends StubSettings.Builder<EnhancedBigtableStubSet
785767 private Builder () {
786768 this .appProfileId = SERVER_DEFAULT_APP_PROFILE_ID ;
787769 this .isRefreshingChannel = true ;
788- primedTableIds = ImmutableList .of ();
789770 setCredentialsProvider (defaultCredentialsProviderBuilder ().build ());
790- this .enableRoutingCookie = true ;
791- this .enableRetryInfo = true ;
792771 metricsProvider = DefaultMetricsProvider .INSTANCE ;
793772 this .areInternalMetricsEnabled = true ;
794773 this .jwtAudience = DEFAULT_DATA_JWT_AUDIENCE ;
@@ -924,9 +903,6 @@ private Builder(EnhancedBigtableStubSettings settings) {
924903 instanceId = settings .instanceId ;
925904 appProfileId = settings .appProfileId ;
926905 isRefreshingChannel = settings .isRefreshingChannel ;
927- primedTableIds = settings .primedTableIds ;
928- enableRoutingCookie = settings .enableRoutingCookie ;
929- enableRetryInfo = settings .enableRetryInfo ;
930906 metricsProvider = settings .metricsProvider ;
931907 metricsEndpoint = settings .getMetricsEndpoint ();
932908 areInternalMetricsEnabled = settings .areInternalMetricsEnabled ;
@@ -1049,7 +1025,6 @@ public Builder setRefreshingChannel(boolean isRefreshingChannel) {
10491025 */
10501026 @ Deprecated
10511027 public Builder setPrimedTableIds (String ... tableIds ) {
1052- this .primedTableIds = ImmutableList .copyOf (tableIds );
10531028 return this ;
10541029 }
10551030
@@ -1069,7 +1044,7 @@ public boolean isRefreshingChannel() {
10691044 */
10701045 @ Deprecated
10711046 public List <String > getPrimedTableIds () {
1072- return primedTableIds ;
1047+ return ImmutableList . of () ;
10731048 }
10741049
10751050 /**
@@ -1159,41 +1134,35 @@ String getJwtAudience() {
11591134 }
11601135
11611136 /**
1162- * Sets if routing cookie is enabled. If true, client will retry a request with extra metadata
1163- * server sent back.
1137+ * @deprecated this now a no-op as routing cookies are always on.
11641138 */
1165- @ BetaApi ( "Routing cookie is not currently stable and may change in the future" )
1139+ @ Deprecated
11661140 public Builder setEnableRoutingCookie (boolean enableRoutingCookie ) {
1167- this .enableRoutingCookie = enableRoutingCookie ;
11681141 return this ;
11691142 }
11701143
11711144 /**
1172- * Gets if routing cookie is enabled. If true, client will retry a request with extra metadata
1173- * server sent back.
1145+ * @deprecated routing cookies are always on.
11741146 */
1175- @ BetaApi ( "Routing cookie is not currently stable and may change in the future" )
1147+ @ Deprecated
11761148 public boolean getEnableRoutingCookie () {
1177- return enableRoutingCookie ;
1149+ return true ;
11781150 }
11791151
11801152 /**
1181- * Sets if RetryInfo is enabled. If true, client bases retry decision and back off time on
1182- * server returned RetryInfo value. Otherwise, client uses {@link RetrySettings}.
1153+ * @deprecated This is a no-op, RetryInfo is always used now.
11831154 */
1184- @ BetaApi ( "RetryInfo is not currently stable and may change in the future" )
1155+ @ Deprecated
11851156 public Builder setEnableRetryInfo (boolean enableRetryInfo ) {
1186- this .enableRetryInfo = enableRetryInfo ;
11871157 return this ;
11881158 }
11891159
11901160 /**
1191- * Gets if RetryInfo is enabled. If true, client bases retry decision and back off time on
1192- * server returned RetryInfo value. Otherwise, client uses {@link RetrySettings}.
1161+ * @deprecated RetryInfo is always on.
11931162 */
1194- @ BetaApi ( "RetryInfo is not currently stable and may change in the future" )
1163+ @ Deprecated
11951164 public boolean getEnableRetryInfo () {
1196- return enableRetryInfo ;
1165+ return true ;
11971166 }
11981167
11991168 /** Returns the builder for the settings used for calls to readRows. */
@@ -1283,8 +1252,8 @@ public EnhancedBigtableStubSettings build() {
12831252 featureFlags .setMutateRowsRateLimit2 (true );
12841253 }
12851254
1286- featureFlags .setRoutingCookie (this . getEnableRoutingCookie () );
1287- featureFlags .setRetryInfo (this . getEnableRetryInfo () );
1255+ featureFlags .setRoutingCookie (true );
1256+ featureFlags .setRetryInfo (true );
12881257 // client_Side_metrics_enabled feature flag is only set when a user is running with a
12891258 // DefaultMetricsProvider. This may cause false negatives when a user registered the
12901259 // metrics on their CustomOpenTelemetryMetricsProvider.
@@ -1325,9 +1294,6 @@ public String toString() {
13251294 .add ("instanceId" , instanceId )
13261295 .add ("appProfileId" , appProfileId )
13271296 .add ("isRefreshingChannel" , isRefreshingChannel )
1328- .add ("primedTableIds" , primedTableIds )
1329- .add ("enableRoutingCookie" , enableRoutingCookie )
1330- .add ("enableRetryInfo" , enableRetryInfo )
13311297 .add ("readRowsSettings" , readRowsSettings )
13321298 .add ("readRowSettings" , readRowSettings )
13331299 .add ("sampleRowKeysSettings" , sampleRowKeysSettings )
0 commit comments