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

[FLINK-27705] Prevent num-sorted-run.compaction-trigger from interfering num-levels #132

Merged
merged 3 commits into from May 23, 2022

Conversation

LadyForest
Copy link
Contributor

@LadyForest LadyForest commented May 20, 2022

This PR specifies the number of levels as max(restoredFiles.maxLevel() + 1, mergeTreeOptions.numOfLevels), to avoid the possible out-of-bounds exception.

@LadyForest LadyForest marked this pull request as ready for review May 20, 2022 11:54
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.

Thanks for the contribution, left two comments.

numLevels =
Math.max(
numLevels,
inputFiles.stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: We can extract a field here: int restoreMaxLevel = .... The format of the java stream in the method parameters doesn't look very good.

Math.max(
numLevels,
inputFiles.stream()
.map(DataFileMeta::level)
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: .mapToInt().max()

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.

Looks good to me!

@JingsongLi JingsongLi merged commit a163dc8 into apache:master May 23, 2022
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