For IncrementalIndexStorageAdapter, we can simply reverse the cursorMap.
For QueryableIndexStorageAdapter, things get more tricky. We'll need reversible offset objects for filtered and non-filtered queries. The non-filtered index is more straightforward to implement. For the filtered case, we'll need the bitmap indexes to support reversible iterators. Concise sets already support this out of the box, but the immutable concise set will need to be adjusted to support this as well. Roaring bitmaps currently have no concept of a reversible cursor, and we'll need to either throw an exception, or add the logic to roaring bitmaps.
Merging Results
Care needs to be taken here as most of the merge logic assumes timestamps are ordered naturally. We'll need the ability to use different comparators based on the query. I believe this can be tricky to get right, so many new unit tests will be required.
Thoughts?
-- FJ
Roaring bitmaps currently have no concept of a reversible cursor, and we'll need to either throw an exception, or add the logic to roaring bitmaps.