Skip to content

Commit a530ab5

Browse files
committed
Fix spotless formatting violations in streaming monitor
1 parent 715ea3e commit a530ab5

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/TestDataflowRunner.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ private static class CancelOnError implements Callable<Void> {
392392
private final DataflowPipelineJob job;
393393
private final ErrorMonitorMessagesHandler messageHandler;
394394
private final TestDataflowRunner runner;
395-
private final java.util.concurrent.atomic.AtomicReference<Optional<Boolean>> assertionsPassedRef;
395+
private final java.util.concurrent.atomic.AtomicReference<Optional<Boolean>>
396+
assertionsPassedRef;
396397

397398
public CancelOnError(
398399
DataflowPipelineJob job,
@@ -418,7 +419,8 @@ public Void call() throws Exception {
418419
return null;
419420
}
420421

421-
// Check if we should initiate cancellation based on metrics (only if assertion state is not yet known)
422+
// Check if we should initiate cancellation based on metrics (only if assertion state is
423+
// not yet known)
422424
if (!assertionsPassedRef.get().isPresent() && !cancellationPending) {
423425
if (runner.expectedNumberOfAssertions > 0 && steps % checkMetricsIntervalSteps == 0) {
424426
try {
@@ -437,15 +439,13 @@ public Void call() throws Exception {
437439
}
438440
}
439441
} catch (Exception e) {
440-
LOG.warn(
441-
"Transient error polling metrics for job {}",
442-
job.getJobId(),
443-
e);
442+
LOG.warn("Transient error polling metrics for job {}", job.getJobId(), e);
444443
}
445444
}
446445
}
447446

448-
// Check if we should initiate cancellation based on error logs (only if not already cancellationPending)
447+
// Check if we should initiate cancellation based on error logs (only if not already
448+
// cancellationPending)
449449
if (!cancellationPending) {
450450
long runningTimeMillis = steps * 3000L;
451451
if (messageHandler.hasSeenError()
@@ -471,10 +471,7 @@ public Void call() throws Exception {
471471
}
472472

473473
} catch (Exception e) {
474-
LOG.warn(
475-
"Exception in streaming job monitor loop for job {}",
476-
job.getJobId(),
477-
e);
474+
LOG.warn("Exception in streaming job monitor loop for job {}", job.getJobId(), e);
478475
}
479476

480477
Thread.sleep(3000L);

runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/TestDataflowRunnerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ public void testBatchPipelineFailsIfException() throws Exception {
212212
when(mockClient.getJobMetrics(anyString()))
213213
.thenReturn(generateMockMetricResponse(false /* success */, true /* tentative */));
214214
TestDataflowRunner runner = TestDataflowRunner.fromOptionsAndClient(options, mockClient);
215-
AssertionError expected =
216-
assertThrows(AssertionError.class, () -> runner.run(p, mockRunner));
215+
AssertionError expected = assertThrows(AssertionError.class, () -> runner.run(p, mockRunner));
217216
assertThat(expected.getMessage(), containsString("FooException"));
218217
verify(mockJob, never()).cancel();
219218
}

0 commit comments

Comments
 (0)