Skip to content

Commit 91d1e7b

Browse files
javabrownsduskis
authored andcommitted
---
yaml --- r: 12891 b: refs/heads/autosynth-bigtable c: e9ea3d9 h: refs/heads/master i: 12889: 0227414 12887: 40a173c
1 parent 350040e commit 91d1e7b

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

  • branches/autosynth-bigtable/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ refs/heads/autosynth-asset: af3772eb76acbfc401f7c3f9310f09f2b0e17602
126126
refs/heads/autosynth-automl: d4315b3596bac160e3439432c54435f44b09953e
127127
refs/heads/autosynth-bigquerydatatransfer: 2a9f3938237f85a8919602d74011326580ff387f
128128
refs/heads/autosynth-bigquerystorage: 99aee05df348f39d98b6fb23c292006f1d2a6c28
129-
refs/heads/autosynth-bigtable: 36fbd97799e222fac888ca5e643beb37d6700c77
129+
refs/heads/autosynth-bigtable: e9ea3d9bacf0410ef578a9d5c2d25fcbe5955a0d
130130
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
131131
refs/heads/autosynth-containeranalysis: 781fdb430a60f9a6491f116e31e4e10118157bdb
132132
refs/heads/autosynth-datastore: af1fb76aa3eee02fe6f31f8fa1c72a4f048d149b

branches/autosynth-bigtable/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
import java.util.concurrent.ExecutionException;
108108
import java.util.concurrent.Executors;
109109
import java.util.concurrent.Future;
110+
import java.util.concurrent.ScheduledExecutorService;
110111
import javax.annotation.Nullable;
111112
import org.threeten.bp.Duration;
112113

@@ -139,6 +140,8 @@ public class GapicSpannerRpc implements SpannerRpc {
139140
private final Duration checkInterval =
140141
systemProperty(PROPERTY_PERIOD_SECONDS, DEFAULT_PERIOD_SECONDS);
141142

143+
private final ScheduledExecutorService spannerWatchdog;
144+
142145
public static GapicSpannerRpc create(SpannerOptions options) {
143146
return new GapicSpannerRpc(options);
144147
}
@@ -191,14 +194,15 @@ public GapicSpannerRpc(SpannerOptions options) {
191194
CredentialsProvider credentialsProvider =
192195
GrpcTransportOptions.setUpCredentialsProvider(options);
193196

197+
spannerWatchdog =
198+
Executors.newSingleThreadScheduledExecutor(
199+
new ThreadFactoryBuilder()
200+
.setDaemon(true)
201+
.setNameFormat("Cloud-Spanner-WatchdogProvider-%d")
202+
.build());
194203
WatchdogProvider watchdogProvider =
195204
InstantiatingWatchdogProvider.create()
196-
.withExecutor(
197-
Executors.newSingleThreadScheduledExecutor(
198-
new ThreadFactoryBuilder()
199-
.setDaemon(true)
200-
.setNameFormat("Cloud-Spanner-WatchdogProvider-%d")
201-
.build()))
205+
.withExecutor(spannerWatchdog)
202206
.withCheckInterval(checkInterval)
203207
.withClock(NanoClock.getDefaultClock());
204208

@@ -572,6 +576,7 @@ public void shutdown() {
572576
this.spannerStub.close();
573577
this.instanceAdminStub.close();
574578
this.databaseAdminStub.close();
579+
this.spannerWatchdog.shutdown();
575580
}
576581

577582
/**

0 commit comments

Comments
 (0)