Skip to content

Commit

Permalink
Add logs to confirm JvmInitializer completed running and Spanner succ…
Browse files Browse the repository at this point in the history
…essfully connected. (apache#29727)

* Add logs to confirm JvmInitializer completed running.

* Add log to confirm Spanner successfully connected.
  • Loading branch information
tomstepp authored Dec 13, 2023
1 parent 8672028 commit 06c3340
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static void runOnStartup() {
// We write to standard out since logging has yet to be initialized.
System.out.format("Running JvmInitializer#onStartup for %s%n", initializer);
initializer.onStartup();
System.out.format("Completed JvmInitializer#onStartup for %s%n", initializer);
}
}

Expand All @@ -52,6 +53,7 @@ public static void runBeforeProcessing(PipelineOptions options) {
for (JvmInitializer initializer : ReflectHelpers.loadServicesOrdered(JvmInitializer.class)) {
logger.info("Running JvmInitializer#beforeProcessing for {}", initializer);
initializer.beforeProcessing(options);
logger.info("Completed JvmInitializer#beforeProcessing for {}", initializer);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public static SpannerAccessor getOrCreate(SpannerConfig spannerConfig) {
// Connect to spanner for this SpannerConfig.
LOG.info("Connecting to {}", spannerConfig);
self = SpannerAccessor.createAndConnect(spannerConfig);
LOG.info("Successfully connected to {}", spannerConfig);
spannerAccessors.put(spannerConfig, self);
refcounts.putIfAbsent(spannerConfig, new AtomicInteger(0));
}
Expand Down

0 comments on commit 06c3340

Please sign in to comment.