File tree
Expand file treeCollapse file tree1 file changed
+9
-0
lines changed samples/snippets/src/main/java/com/example/spanner
Expand file treeCollapse file tree1 file changed
+9
-0
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -53,14 +53,23 @@ static void executeSqlWithCustomTimeoutAndRetrySettings(
|
53 | 53 | .setRetrySettings(
|
54 | 54 | RetrySettings.newBuilder()
|
55 | 55 | // Configure retry delay settings.
|
| 56 | +// The initial amount of time to wait before retrying the request. |
56 | 57 | .setInitialRetryDelay(Duration.ofMillis(500))
|
| 58 | +// The maximum amount of time to wait before retrying. I.e. after this value is |
| 59 | +// reached, the wait time will not increase further by the multiplier. |
57 | 60 | .setMaxRetryDelay(Duration.ofSeconds(64))
|
| 61 | +// The previous wait time is multiplied by this multiplier to come up with the next |
| 62 | +// wait time, until the max is reached. |
58 | 63 | .setRetryDelayMultiplier(1.5)
|
59 | 64 |
|
60 | 65 | // Configure RPC and total timeout settings.
|
| 66 | +// Timeout for the first RPC call. Subsequent retries will be based off this value. |
61 | 67 | .setInitialRpcTimeout(Duration.ofSeconds(60))
|
| 68 | +// The max for the per RPC timeout. |
62 | 69 | .setMaxRpcTimeout(Duration.ofSeconds(60))
|
| 70 | +// Controls the change of timeout for each retry. |
63 | 71 | .setRpcTimeoutMultiplier(1.0)
|
| 72 | +// The timeout for all calls (first call + all retries). |
64 | 73 | .setTotalTimeout(Duration.ofSeconds(60))
|
65 | 74 | .build());
|
66 | 75 | // Create a Spanner client using the custom retry and timeout settings.
|
|
You can’t perform that action at this time.
0 commit comments