ThinkerLei commented on code in PR #7609:
URL: https://github.com/apache/hudi/pull/7609#discussion_r1063074311
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactOperator.java:
##########
@@ -95,11 +101,32 @@ public void open() throws Exception {
this.executor = NonThrownExecutor.builder(LOG).build();
}
this.collector = new StreamRecordCollector<>(output);
+ this.mutex = new Object();
+ }
+
+ @Override
+ public void processWatermark(Watermark mark) throws Exception {
+ // thread safe to propagate the watermark when asyncCompaction is enabled
+ if (asyncCompaction) {
+ synchronized (mutex) {
+ super.processWatermark(mark);
+ }
+ return;
+ }
+ super.processWatermark(mark);
}
@Override
- public void processWatermark(Watermark mark) {
- // no need to propagate the watermark
+ public void processLatencyMarker(LatencyMarker latencyMarker)
+ throws Exception {
+ // thread safe to propagate the latencyMarker when asyncCompaction is
enabled
+ if (asyncCompaction) {
+ synchronized (mutex) {
+ super.processLatencyMarker(latencyMarker);
+ }
Review Comment:
now, i have ignored the watermark and latency marker totally. @danny0405
--
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]