zentol commented on a change in pull request #9038:
[FLINK-13169][tests][coordination] IT test for fine-grained recovery (task
executor failures)
URL: https://github.com/apache/flink/pull/9038#discussion_r303854792
##########
File path:
flink-tests/src/test/java/org/apache/flink/test/recovery/BatchFineGrainedRecoveryITCase.java
##########
@@ -199,6 +371,76 @@ private boolean toss() {
}
}
+ private enum StaticMapFailureTracker {
+ ;
+
+ private static final List<AtomicInteger> mapRestarts = new
ArrayList<>(MAP_NUMBER);
+ private static final List<AtomicInteger> expectedMapRestarts =
new ArrayList<>(MAP_NUMBER);
+ private static final List<AtomicInteger> mapFailures = new
ArrayList<>(MAP_NUMBER);
+ private static final List<AtomicInteger>
mapFailuresWithBacktracking = new ArrayList<>(MAP_NUMBER);
+ private static final AtomicReference<Throwable>
unrelatedFailure = new AtomicReference<>(null);
+
+ private static void reset() {
+ mapRestarts.clear();
+ expectedMapRestarts.clear();
+ mapFailures.clear();
+ mapFailuresWithBacktracking.clear();
+ }
+
+ private static int addNewMap() {
+ mapRestarts.add(new AtomicInteger(0));
+ expectedMapRestarts.add(new AtomicInteger(1));
+ mapFailures.add(new AtomicInteger(0));
+ mapFailuresWithBacktracking.add(new AtomicInteger(0));
+ return mapRestarts.size() - 1;
+ }
+
+ private static void mapRestart(int index) {
+ mapRestarts.get(index).incrementAndGet();
+ }
+
+ private static void mapFailure(int index) {
+ mapFailures.get(index).incrementAndGet();
+ expectedMapRestarts.get(index).incrementAndGet();
+ }
+
+ private static void mapFailureWithBacktracking(int index) {
+
mapFailuresWithBacktracking.get(index).incrementAndGet();
+ IntStream.range(0, index + 1).forEach(i ->
expectedMapRestarts.get(i).incrementAndGet());
+ IntStream.range(0, index + 1).forEach(i ->
expectedMapRestarts.get(i).incrementAndGet());
Review comment:
why are we doing this twice?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services