spirit-labs / tektite

Tektite DB
http://www.tektitedb.com
Other
167 stars 26 forks source link

Consider simpler iterator abstraction #82

Closed purplefox closed 2 months ago

purplefox commented 4 months ago

The current Iterator https://github.com/spirit-labs/tektite/blob/main/iteration/iter.go abstraction seems overcomplex leading to complex implementations.

We should consider simplifying it to something like:

type Iterator interface {
    Next() (bool, common.KV)
    Close()
}

Related to this. currently MergingIterator advances to next element if IsValid() is called twice in a row without Next()

watson28 commented 3 months ago

@purplefox, I would like to take this one. Could you assign it to me?

purplefox commented 3 months ago

Happy to give this one to you if you want to give it a go. The tricky part will be in getting the MergingIterator to work with the new API.

purplefox commented 2 months ago

Hi @watson28 please see latest comments on the PR

purplefox commented 2 months ago

Issues fixed, so now closed