dmvk commented on code in PR #22564:
URL: https://github.com/apache/flink/pull/22564#discussion_r1202299569
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/exceptionhistory/ExceptionHistoryEntry.java:
##########
@@ -132,6 +132,22 @@ private ExceptionHistoryEntry(
this.failureLabels =
Collections.unmodifiableMap(labelMap));
}
+ /**
+ * Creates a new ExceptionHistoryEntry copy of the original but with the
provided labels
+ * (currently used for Failures).
+ *
+ * @param failureLabels to be passed to the new ExceptionHistoryEntry
+ * @return new ExceptionHistoryEntry with the associated labels
+ */
+ public ExceptionHistoryEntry withLabels(CompletableFuture<Map<String,
String>> failureLabels) {
Review Comment:
is this unused?
##########
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveSchedulerTest.java:
##########
@@ -1992,4 +2035,120 @@ public DummyState getState() {
}
}
}
+
+ private static class ExceptionHistoryTester {
Review Comment:
Would it be possible to use this for as a replacement for
`org.apache.flink.runtime.scheduler.adaptive.AdaptiveSchedulerTest#runExceptionHistoryTests(java.util.function.BiConsumer<org.apache.flink.runtime.scheduler.adaptive.AdaptiveScheduler,java.util.List<org.apache.flink.runtime.executiongraph.ExecutionAttemptID>>,
java.util.function.Consumer<org.apache.flink.runtime.scheduler.adaptive.AdaptiveSchedulerBuilder>,
java.util.function.Consumer<org.apache.flink.runtime.jobgraph.JobGraph>)` as
well?
##########
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveSchedulerTest.java:
##########
@@ -1295,23 +1329,25 @@ void testExceptionHistoryWithTaskFailure() throws
Exception {
@Test
void testExceptionHistoryWithTaskFailureWithRestart() throws Exception {
final Exception expectedException = new Exception("Expected Local
Exception");
- Consumer<AdaptiveSchedulerBuilder> setupScheduler =
+ final Consumer<AdaptiveSchedulerBuilder> setupScheduler =
builder ->
builder.setRestartBackoffTimeStrategy(
new FixedDelayRestartBackoffTimeStrategy
.FixedDelayRestartBackoffTimeStrategyFactory(1, 100)
.create());
- BiConsumer<AdaptiveScheduler, List<ExecutionAttemptID>> testLogic =
+ final BiConsumer<AdaptiveScheduler, List<ExecutionAttemptID>>
testLogic =
(scheduler, attemptIds) -> {
final ExecutionAttemptID attemptId = attemptIds.get(1);
scheduler.updateTaskExecutionState(
new TaskExecutionStateTransition(
new TaskExecutionState(
attemptId, ExecutionState.FAILED,
expectedException)));
};
-
final Iterable<RootExceptionHistoryEntry> actualExceptionHistory =
- runExceptionHistoryTests(testLogic, setupScheduler);
Review Comment:
this method is no longer used
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]