Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.hudi.sink.compact;

import org.apache.flink.streaming.runtime.streamrecord.LatencyMarker;
import org.apache.hudi.client.HoodieFlinkWriteClient;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the import sequence.

import org.apache.hudi.client.WriteStatus;
import org.apache.hudi.common.model.CompactionOperation;
Expand Down Expand Up @@ -98,10 +99,16 @@ public void open() throws Exception {
}

@Override
public void processWatermark(Watermark mark) {
public void processWatermark(Watermark mark) throws Exception {
// no need to propagate the watermark

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary change.

}

@Override
public void processLatencyMarker(LatencyMarker latencyMarker)
throws Exception {
// no need to propagate the latencyMarker

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to throw exception.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClusteringOperator should also be fixed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ClusteringOperator fixed in HUDI-5515

}

@Override
public void processElement(StreamRecord<CompactionPlanEvent> record) throws Exception {
final CompactionPlanEvent event = record.getValue();
Expand All @@ -111,7 +118,9 @@ public void processElement(StreamRecord<CompactionPlanEvent> record) throws Exce
// executes the compaction task asynchronously to not block the checkpoint barrier propagate.
executor.execute(
() -> doCompaction(instantTime, compactionOperation, collector, reloadWriteConfig()),
(errMsg, t) -> collector.collect(new CompactionCommitEvent(instantTime, compactionOperation.getFileId(), taskID)),
(errMsg, t) -> {
collector.collect(new CompactionCommitEvent(instantTime,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary change.

compactionOperation.getFileId(), taskID));},
"Execute compaction for instant %s from task %d", instantTime, taskID);
} else {
// executes the compaction task synchronously for batch mode.
Expand All @@ -137,7 +146,8 @@ private void doCompaction(String instantTime,
compactionOperation,
instantTime, maxInstantTime,
writeClient.getHoodieTable().getTaskContextSupplier());
collector.collect(new CompactionCommitEvent(instantTime, compactionOperation.getFileId(), writeStatuses, taskID));
collector.collect(new CompactionCommitEvent(instantTime, compactionOperation.getFileId(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary change.

writeStatuses, taskID));
}

private HoodieWriteConfig reloadWriteConfig() throws Exception {
Expand Down