-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-349]: Added new cleaning policy based on number of hours #3646
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
97113ff
[HUDI-349]: dev in progress
pratyakshsharma 92d085d
added cleaner hours retained function
pratyakshsharma 9c1364c
checkstyle fixes
pratyakshsharma f93ee61
[HUDI-349]: added new cleaning policy
pratyakshsharma 0cd1fe6
Merge branch 'hudi-349' of https://github.com/pratyakshsharma/incubat…
pratyakshsharma 68b0a68
[HUDI-349]: rebased with master
pratyakshsharma f58beda
[HUDI-349]: small changes
pratyakshsharma 3c79136
code review comments addressed
pratyakshsharma 676d999
[HUDI-349]: in sync with master
pratyakshsharma 29e8200
[HUDI-349]: addressed code review comments
pratyakshsharma 9527702
Merge branch 'master' of https://github.com/apache/hudi into hudi-349
pratyakshsharma efa6056
updated documentation for CLEANER_HOURS_RETAINED prop
pratyakshsharma 7eea9ec
build fix
pratyakshsharma 8e7e497
Merge branch 'master' of https://github.com/apache/hudi into hudi-349
pratyakshsharma cc0a44a
[HUDI-349]: moved tests to new test class
pratyakshsharma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why do have (fileCommitTime.equals(lastVersionBeforeEarliestCommitToRetain) in L318. I would prefer to keep the same logic unless we have strong reasons to remove. As I mentioned, cleaning based on num hours is just a diff way to conveying retain N commits. So, lets try to keep the logic similar across both. Easier to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cleaner policies are designed to enable the longest running query to succeed. Let us take a small example where ingestion is happening every 30 minutes and
hoodie.cleaner.commits.retained = 2. This implies the longest running query is going to take 1 hour to complete. Now if I maintain a list of commits, when commit at index=2 in this list (i.e 3rd commit from the beginning) is completed, the query which started when commit at index=0 completed might still be running.list of commits -> 0. 1. 2
time (in mins). -> 0. 30. 60
Hence to allow this query to finish, we take into account
lastVersionBeforeEarliestCommitToRetainin L318.lastVersionin this case is going to be commit at index=1.With the new policy KEEP_LATEST_BY_HOURS, when 3rd commit is completed, 1st commit will be retained automatically by the logic. Hence the code in its current form works fine.