Skip to content
New issue

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

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

Already on GitHub? # to your account

questions asscociated with iterators in starter project #123

Open
ppdogg opened this issue Feb 16, 2025 · 1 comment
Open

questions asscociated with iterators in starter project #123

ppdogg opened this issue Feb 16, 2025 · 1 comment

Comments

@ppdogg
Copy link
Contributor

ppdogg commented Feb 16, 2025

  1. Is there some rules about names? In MergeIterator you use create, but in LsmIterator and FusedIterator you use new.
  2. Is there some rules about returning a type or result? LsmIterator::new() returns Result<Self>, but MergeIterator::create() and FusedIterator::new() return Self.
  3. I implement a new range iterator that accepts Range like 1..10 rather than (Bound, Bound). I have to add new struct in mem_table.rs and lsm_iterators.rs.
    In mem_table.rs, crossbeam_skiplist::map::Range<'this, Bytes, Range<Bytes>, Bytes, Bytes> to replace old SkipMapRangeIter<'this>.
    In lsm_iterators.rs, you specify MergeIterator<MemTableIterator> rather than use generic. That's why I have to add new duplicated code.
    Is there any reasons why you don't use generic? Is there any better ways to add a range iterator?
@ppdogg
Copy link
Contributor Author

ppdogg commented Feb 26, 2025

Will you consider changing SkipMapRangeIter definition? This would be compatible with adding range iterator for memtable.

type SkipMapRangeIter<'a, Q, R>
= crossbeam_skiplist::map::Range<'a, Q, R, Bytes, Bytes>;

Example:
iter: SkipMapRangeIter<'this, Bytes, (Bound<Bytes>, Bound<Bytes>)>,
and
iter: SkipMapRangeIter<'this, Bytes, Range<Bytes>>,

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

No branches or pull requests

1 participant