LinkCompaction: Add Link Compaction related interfaces#232
Open
royguo wants to merge 5 commits intobytedance:link-compactionfrom
Open
LinkCompaction: Add Link Compaction related interfaces#232royguo wants to merge 5 commits intobytedance:link-compactionfrom
royguo wants to merge 5 commits intobytedance:link-compactionfrom
Conversation
907db3e to
0bb114e
Compare
0bb114e to
6ce5863
Compare
6ce5863 to
c9dd2ff
Compare
de060ed to
33ea11e
Compare
Collaborator
|
should we add some simple unit tests? |
Member
Author
This is not an official MR, I will re-submit a standard MR with enough UT sooner after we finished all critical logic. |
33ea11e to
d9e6677
Compare
oujiaxin
reviewed
Apr 20, 2022
table/two_level_iterator.cc
Outdated
| } | ||
|
|
||
| // Seek all iterators to their first item. | ||
| Status SeekToFirst() { |
Collaborator
There was a problem hiding this comment.
SeekToFirst/Seek...这些建议放在一个单独的LinkBlockIterator类中
table/two_level_iterator.cc
Outdated
| // position `idx`, fill all touched keys into the key buffer. | ||
| auto it = iterator_cache_->GetIterator(file_number); | ||
| it->SeekForPrev(max_key_); | ||
| assert(it->status().ok()); |
Collaborator
There was a problem hiding this comment.
这里不能assert,建议失败的状态需要返回出去
table/two_level_iterator.cc
Outdated
| // TODO Shall we init all other iterators to the right place so we can | ||
| // reuse them in later Next()/Prev()? | ||
| auto it = iterator_cache_->GetIterator(file_numbers_[iter_idx]); | ||
| it->Seek(target); |
Collaborator
There was a problem hiding this comment.
最后这一次file seek的开销是否可以去掉?在buffered_key的过程中已经把相应的file通过SeekForPrev+Prev走到了正确的位置了
3ed371c to
ff8e329
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.