-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support reverse iteration #2
Comments
Here are my proposed methods for this:
They are tested to work fine for me. I don't use remove, so I've just disabled it for the useFixFirst special case for the result to spare me the effort of finding out how to do that properly. UseFixFirst works as follows: |
Hey Subes, This is great. The only recommendation that I have is making the useFixFirst method private. It mutates state, and shouldn't allow others to call it. If you want to patch this, and send a pull request over, I'll merge it in. With the patch, please include:
Cheers, |
Since the code has been migrated, this issue can be closed. |
leveldbjni supports reverse iteration: https://github.com/fusesource/leveldbjni/blob/master/leveldbjni/src/main/java/org/fusesource/leveldbjni/internal/JniDBIterator.java
so it would be nice if ezdb would have api methods that make this functionality available aswell.
e.g. next to range(...) methods, also rangeReversed(...) or having another parameter in the range(...) method to enable reverse. Or make the iterator returned one that has seekFirst, seekLast, next, prev.
For the pure java version of leveldb there is this ticket: dain/leveldb#8
The APi method for this is available, it's just that it will throw UnsupportedOperationException for now: https://github.com/dain/leveldb/blob/master/leveldb/src/main/java/org/iq80/leveldb/impl/SeekingIteratorAdapter.java
The text was updated successfully, but these errors were encountered: