Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compaction] Filter out invalid splits to improve flink database compaction efficiency #3233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhourui999
Copy link
Contributor

@zhourui999 zhourui999 commented Apr 18, 2024

Purpose

Linked issue: close #xxx
Filter out invalid splits to improve flink database compaction efficiency

(1) Referring to the pickFullComparison method of CompactStrategy, filter out whether dataFiles is empty or all files in dataFiles are at the max-level
image

Tests

API and Format

Documentation

@zhourui999 zhourui999 changed the title [compaction] Filter commitMessage when compactIncrement is empty [compaction] Filter out invalid splits and commit messages to improve flink database compaction efficiency Apr 18, 2024
CommitMessageImpl commitMessage =
(CommitMessageImpl)
committable.wrappedCommittable();
return !commitMessage.compactIncrement().isEmpty();
Copy link
Contributor

Choose a reason for hiding this comment

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

just use CommitMessageImpl.isEmpty?

@zhourui999 zhourui999 changed the title [compaction] Filter out invalid splits and commit messages to improve flink database compaction efficiency [compaction] Filter out invalid splits to improve flink database compaction efficiency Apr 21, 2024
}
return dataSplit.dataFiles().stream()
.map(DataFileMeta::level)
.anyMatch(level -> level != maxLevel);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why filter maxLevel?

.filter(
split -> {
DataSplit dataSplit = (DataSplit) split;
if (dataSplit.dataFiles().isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not care before files?

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

@zhourui999 I cannot get how this optimization works...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants