Git Product home page Git Product logo

Comments (5)

cmumford avatar cmumford commented on May 5, 2024

Comment #1 originally posted by john.carrino on 2011-08-13T19:18:34.000Z:

Actually I realized there is an iterator snapshot operation. This will work for me in this case. Do you know the performance penalty of using a snapshot?

from leveldb.

cmumford avatar cmumford commented on May 5, 2024

Comment #2 originally posted by [email protected] on 2011-08-15T00:19:00.000Z:

Hi John, thanks a lot for your tests.

We'd like to patch these tests into LevelDB code's - do you mind filling out this CLA so we can patch it in?
http://code.google.com/legal/individual-cla-v1.0.html
Let me know when you've completed this.

Thanks for your help,

Gabor

from leveldb.

cmumford avatar cmumford commented on May 5, 2024

Comment #3 originally posted by david.yu.ftw on 2011-08-15T05:55:05.000Z:

"I would like to find the first key that is less than a given key. I can only think of two ways to achieve this goal and they both fail.

  1. seek to key then go back one. This fails because if the key you want is the last key, then you have an invalid iterator and you get a segfault."

I've the same use-case but I solved # 1 by adding a definite last key as a marker. This key is checked on database startup ... and initialized if database is new.
Its possible if your keys are predictable (I used 0xFFFF as the exclusive last key).

from leveldb.

cmumford avatar cmumford commented on May 5, 2024

Comment #4 originally posted by [email protected] on 2011-08-22T20:55:38.000Z:

This should be fixed in R48 - please verify!

from leveldb.

trylle avatar trylle commented on May 5, 2024

I've run into the same issue re Prev on an "end" iterator (when Seek runs past the last key).

I tried John's tests on the latest code in master (7035af5) and they both fail there.

On ab323f7, which was supposed to fix this issue, IterSnapshotViewSeekToEnd passes, but not IterPastEndThenPrev.

I currently have to use the dummy key approach suggested by David to get around it.

from leveldb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.