MB-24151: Implement general range read iterator in seqlist
This commit implements range read iterator in sequence list, the ordered
data strucuture in Ephemeral buckets.
We need range read iterators because we have more than one client that
needs to do a range read (backfill, tombstone purger). Further the reads
can also have more involved constraints like memory management in backfills.
By having an API of read iterator we can just do the read from the sequence
list and additional stuff like memory management can be done outside by the
clients. That is, iterator clients can make progress at their own pace.
The iterator is unidirectional (forward only) and cannot be invalidated
while in use. That means reading the items in the iterator results in a
valid point-in-time snapshot. But this adds a caveat that while an
iterator instance is active, certain invariants are to be met to get the
snapshot, and this happens at the expense of increased memory usage.
For now, only one iterator can be created at a time.
Change-Id: Idb320a148299255b74b7cf7e92cef35a20f483d4
Reviewed-on: http://review.couchbase.org/77640
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>