39
39
import com .google .bigtable .v2 .MutateRowResponse ;
40
40
import com .google .bigtable .v2 .MutateRowsRequest ;
41
41
import com .google .bigtable .v2 .MutateRowsResponse ;
42
+ import com .google .bigtable .v2 .PingAndWarmRequest ;
43
+ import com .google .bigtable .v2 .PingAndWarmResponse ;
42
44
import com .google .bigtable .v2 .ReadModifyWriteRowRequest ;
43
45
import com .google .bigtable .v2 .ReadModifyWriteRowResponse ;
44
46
import com .google .bigtable .v2 .ReadRowsRequest ;
@@ -78,6 +80,7 @@ public class BigtableStubSettings extends StubSettings<BigtableStubSettings> {
78
80
mutateRowsSettings ;
79
81
private final UnaryCallSettings <CheckAndMutateRowRequest , CheckAndMutateRowResponse >
80
82
checkAndMutateRowSettings ;
83
+ private final UnaryCallSettings <PingAndWarmRequest , PingAndWarmResponse > pingAndWarmSettings ;
81
84
private final UnaryCallSettings <ReadModifyWriteRowRequest , ReadModifyWriteRowResponse >
82
85
readModifyWriteRowSettings ;
83
86
@@ -108,6 +111,11 @@ public ServerStreamingCallSettings<MutateRowsRequest, MutateRowsResponse> mutate
108
111
return checkAndMutateRowSettings ;
109
112
}
110
113
114
+ /** Returns the object with the settings used for calls to pingAndWarm. */
115
+ public UnaryCallSettings <PingAndWarmRequest , PingAndWarmResponse > pingAndWarmSettings () {
116
+ return pingAndWarmSettings ;
117
+ }
118
+
111
119
/** Returns the object with the settings used for calls to readModifyWriteRow. */
112
120
public UnaryCallSettings <ReadModifyWriteRowRequest , ReadModifyWriteRowResponse >
113
121
readModifyWriteRowSettings () {
@@ -194,6 +202,7 @@ protected BigtableStubSettings(Builder settingsBuilder) throws IOException {
194
202
mutateRowSettings = settingsBuilder .mutateRowSettings ().build ();
195
203
mutateRowsSettings = settingsBuilder .mutateRowsSettings ().build ();
196
204
checkAndMutateRowSettings = settingsBuilder .checkAndMutateRowSettings ().build ();
205
+ pingAndWarmSettings = settingsBuilder .pingAndWarmSettings ().build ();
197
206
readModifyWriteRowSettings = settingsBuilder .readModifyWriteRowSettings ().build ();
198
207
}
199
208
@@ -209,6 +218,8 @@ public static class Builder extends StubSettings.Builder<BigtableStubSettings, B
209
218
mutateRowsSettings ;
210
219
private final UnaryCallSettings .Builder <CheckAndMutateRowRequest , CheckAndMutateRowResponse >
211
220
checkAndMutateRowSettings ;
221
+ private final UnaryCallSettings .Builder <PingAndWarmRequest , PingAndWarmResponse >
222
+ pingAndWarmSettings ;
212
223
private final UnaryCallSettings .Builder <ReadModifyWriteRowRequest , ReadModifyWriteRowResponse >
213
224
readModifyWriteRowSettings ;
214
225
private static final ImmutableMap <String , ImmutableSet <StatusCode .Code >>
@@ -218,18 +229,19 @@ public static class Builder extends StubSettings.Builder<BigtableStubSettings, B
218
229
ImmutableMap .Builder <String , ImmutableSet <StatusCode .Code >> definitions =
219
230
ImmutableMap .builder ();
220
231
definitions .put (
221
- "retry_policy_3_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
232
+ "no_retry_3_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
222
233
definitions .put (
223
- "retry_policy_1_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
234
+ "no_retry_1_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
224
235
definitions .put (
225
236
"retry_policy_4_codes" ,
226
237
ImmutableSet .copyOf (
227
238
Lists .<StatusCode .Code >newArrayList (
228
239
StatusCode .Code .UNAVAILABLE , StatusCode .Code .DEADLINE_EXCEEDED )));
229
240
definitions .put (
230
- "retry_policy_2_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
241
+ "no_retry_2_codes " , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
231
242
definitions .put (
232
- "retry_policy_0_codes" , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
243
+ "no_retry_0_codes" , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
244
+ definitions .put ("no_retry_codes" , ImmutableSet .copyOf (Lists .<StatusCode .Code >newArrayList ()));
233
245
RETRYABLE_CODE_DEFINITIONS = definitions .build ();
234
246
}
235
247
@@ -240,26 +252,20 @@ public static class Builder extends StubSettings.Builder<BigtableStubSettings, B
240
252
RetrySettings settings = null ;
241
253
settings =
242
254
RetrySettings .newBuilder ()
243
- .setInitialRetryDelay (Duration .ofMillis (10L ))
244
- .setRetryDelayMultiplier (2.0 )
245
- .setMaxRetryDelay (Duration .ofMillis (60000L ))
246
255
.setInitialRpcTimeout (Duration .ofMillis (43200000L ))
247
256
.setRpcTimeoutMultiplier (1.0 )
248
257
.setMaxRpcTimeout (Duration .ofMillis (43200000L ))
249
258
.setTotalTimeout (Duration .ofMillis (43200000L ))
250
259
.build ();
251
- definitions .put ("retry_policy_3_params " , settings );
260
+ definitions .put ("no_retry_3_params " , settings );
252
261
settings =
253
262
RetrySettings .newBuilder ()
254
- .setInitialRetryDelay (Duration .ofMillis (10L ))
255
- .setRetryDelayMultiplier (2.0 )
256
- .setMaxRetryDelay (Duration .ofMillis (60000L ))
257
263
.setInitialRpcTimeout (Duration .ofMillis (60000L ))
258
264
.setRpcTimeoutMultiplier (1.0 )
259
265
.setMaxRpcTimeout (Duration .ofMillis (60000L ))
260
266
.setTotalTimeout (Duration .ofMillis (60000L ))
261
267
.build ();
262
- definitions .put ("retry_policy_1_params " , settings );
268
+ definitions .put ("no_retry_1_params " , settings );
263
269
settings =
264
270
RetrySettings .newBuilder ()
265
271
.setInitialRetryDelay (Duration .ofMillis (10L ))
@@ -273,26 +279,22 @@ public static class Builder extends StubSettings.Builder<BigtableStubSettings, B
273
279
definitions .put ("retry_policy_4_params" , settings );
274
280
settings =
275
281
RetrySettings .newBuilder ()
276
- .setInitialRetryDelay (Duration .ofMillis (10L ))
277
- .setRetryDelayMultiplier (2.0 )
278
- .setMaxRetryDelay (Duration .ofMillis (60000L ))
279
282
.setInitialRpcTimeout (Duration .ofMillis (600000L ))
280
283
.setRpcTimeoutMultiplier (1.0 )
281
284
.setMaxRpcTimeout (Duration .ofMillis (600000L ))
282
285
.setTotalTimeout (Duration .ofMillis (600000L ))
283
286
.build ();
284
- definitions .put ("retry_policy_2_params " , settings );
287
+ definitions .put ("no_retry_2_params " , settings );
285
288
settings =
286
289
RetrySettings .newBuilder ()
287
- .setInitialRetryDelay (Duration .ofMillis (10L ))
288
- .setRetryDelayMultiplier (2.0 )
289
- .setMaxRetryDelay (Duration .ofMillis (60000L ))
290
290
.setInitialRpcTimeout (Duration .ofMillis (20000L ))
291
291
.setRpcTimeoutMultiplier (1.0 )
292
292
.setMaxRpcTimeout (Duration .ofMillis (20000L ))
293
293
.setTotalTimeout (Duration .ofMillis (20000L ))
294
294
.build ();
295
- definitions .put ("retry_policy_0_params" , settings );
295
+ definitions .put ("no_retry_0_params" , settings );
296
+ settings = RetrySettings .newBuilder ().setRpcTimeoutMultiplier (1.0 ).build ();
297
+ definitions .put ("no_retry_params" , settings );
296
298
RETRY_PARAM_DEFINITIONS = definitions .build ();
297
299
}
298
300
@@ -308,11 +310,15 @@ protected Builder(ClientContext clientContext) {
308
310
mutateRowSettings = UnaryCallSettings .newUnaryCallSettingsBuilder ();
309
311
mutateRowsSettings = ServerStreamingCallSettings .newBuilder ();
310
312
checkAndMutateRowSettings = UnaryCallSettings .newUnaryCallSettingsBuilder ();
313
+ pingAndWarmSettings = UnaryCallSettings .newUnaryCallSettingsBuilder ();
311
314
readModifyWriteRowSettings = UnaryCallSettings .newUnaryCallSettingsBuilder ();
312
315
313
316
unaryMethodSettingsBuilders =
314
317
ImmutableList .<UnaryCallSettings .Builder <?, ?>>of (
315
- mutateRowSettings , checkAndMutateRowSettings , readModifyWriteRowSettings );
318
+ mutateRowSettings ,
319
+ checkAndMutateRowSettings ,
320
+ pingAndWarmSettings ,
321
+ readModifyWriteRowSettings );
316
322
initDefaults (this );
317
323
}
318
324
@@ -324,11 +330,15 @@ protected Builder(BigtableStubSettings settings) {
324
330
mutateRowSettings = settings .mutateRowSettings .toBuilder ();
325
331
mutateRowsSettings = settings .mutateRowsSettings .toBuilder ();
326
332
checkAndMutateRowSettings = settings .checkAndMutateRowSettings .toBuilder ();
333
+ pingAndWarmSettings = settings .pingAndWarmSettings .toBuilder ();
327
334
readModifyWriteRowSettings = settings .readModifyWriteRowSettings .toBuilder ();
328
335
329
336
unaryMethodSettingsBuilders =
330
337
ImmutableList .<UnaryCallSettings .Builder <?, ?>>of (
331
- mutateRowSettings , checkAndMutateRowSettings , readModifyWriteRowSettings );
338
+ mutateRowSettings ,
339
+ checkAndMutateRowSettings ,
340
+ pingAndWarmSettings ,
341
+ readModifyWriteRowSettings );
332
342
}
333
343
334
344
private static Builder createDefault () {
@@ -347,13 +357,13 @@ private static Builder createDefault() {
347
357
private static Builder initDefaults (Builder builder ) {
348
358
builder
349
359
.readRowsSettings ()
350
- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_3_codes " ))
351
- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_3_params " ));
360
+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_3_codes " ))
361
+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_3_params " ));
352
362
353
363
builder
354
364
.sampleRowKeysSettings ()
355
- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_1_codes " ))
356
- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_1_params " ));
365
+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_1_codes " ))
366
+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_1_params " ));
357
367
358
368
builder
359
369
.mutateRowSettings ()
@@ -362,18 +372,23 @@ private static Builder initDefaults(Builder builder) {
362
372
363
373
builder
364
374
.mutateRowsSettings ()
365
- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_2_codes " ))
366
- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_2_params " ));
375
+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_2_codes " ))
376
+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_2_params " ));
367
377
368
378
builder
369
379
.checkAndMutateRowSettings ()
370
- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_0_codes" ))
371
- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_0_params" ));
380
+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_0_codes" ))
381
+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_0_params" ));
382
+
383
+ builder
384
+ .pingAndWarmSettings ()
385
+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_codes" ))
386
+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_params" ));
372
387
373
388
builder
374
389
.readModifyWriteRowSettings ()
375
- .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("retry_policy_0_codes " ))
376
- .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("retry_policy_0_params " ));
390
+ .setRetryableCodes (RETRYABLE_CODE_DEFINITIONS .get ("no_retry_0_codes " ))
391
+ .setRetrySettings (RETRY_PARAM_DEFINITIONS .get ("no_retry_0_params " ));
377
392
378
393
return builder ;
379
394
}
@@ -422,6 +437,12 @@ public UnaryCallSettings.Builder<MutateRowRequest, MutateRowResponse> mutateRowS
422
437
return checkAndMutateRowSettings ;
423
438
}
424
439
440
+ /** Returns the builder for the settings used for calls to pingAndWarm. */
441
+ public UnaryCallSettings .Builder <PingAndWarmRequest , PingAndWarmResponse >
442
+ pingAndWarmSettings () {
443
+ return pingAndWarmSettings ;
444
+ }
445
+
425
446
/** Returns the builder for the settings used for calls to readModifyWriteRow. */
426
447
public UnaryCallSettings .Builder <ReadModifyWriteRowRequest , ReadModifyWriteRowResponse >
427
448
readModifyWriteRowSettings () {
0 commit comments