StephanEwen commented on a change in pull request #17327:
URL: https://github.com/apache/flink/pull/17327#discussion_r713062361
##########
File path:
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/testutils/ValidatingExactlyOnceSink.java
##########
@@ -33,23 +34,29 @@
/** A {@link RichSinkFunction} that verifies that no duplicate records are
generated. */
public class ValidatingExactlyOnceSink extends RichSinkFunction<Integer>
- implements ListCheckpointed<Tuple2<Integer, BitSet>>, Runnable {
+ implements ListCheckpointed<Tuple2<Integer, BitSet>>, Runnable,
CheckpointListener {
private static final Logger LOG =
LoggerFactory.getLogger(ValidatingExactlyOnceSink.class);
private static final long serialVersionUID = 1748426382527469932L;
private final int numElementsTotal;
+ private final boolean waitForFinalCheckpoint;
private BitSet duplicateChecker = new BitSet(); // this is checkpointed
- private int numElements; // this is checkpointed
+ private volatile int numElements; // this is checkpointed
Review comment:
I think you do not need to make this volatile. Flink guarantees
single-threaded-style invocations of all methods, so the visibility in
different methods is guaranteed.
--
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]