ThinkerLei commented on code in PR #7609:
URL: https://github.com/apache/hudi/pull/7609#discussion_r1062136801
##########
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:
In my opinion, it will be more user-friendly to display through flink ui
after delivery, and some specific functions may need to deliver this
information. So i do not ignore the watermark and latency marker totally.
--
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]