]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
JNI support for ReadOptions::iterate_upper_bound
authorBen Clay <bclay@twitter.com>
Fri, 15 Sep 2017 01:18:49 +0000 (18:18 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 15 Sep 2017 01:28:20 +0000 (18:28 -0700)
commit382277d0fe79ece86b799e3925919cf44c3afb4c
tree3713a13e88d3fb5c04a7c99be90c50907e4effea
parentedcbb3694479fdc3ad3a820739c7164a7b07d63d
JNI support for ReadOptions::iterate_upper_bound

Summary:
Plumbed ReadOptions::iterate_upper_bound through JNI.

Made the following design choices:
* Used Slice instead of AbstractSlice due to the anticipated usecase (key / key prefix). Can change this if anyone disagrees.
* Used Slice instead of raw byte[] which seemed cleaner but necessitated the package-private handle-based Slice constructor. Followed WriteBatch as an example.
* We need a copy constructor for ReadOptions, as we create one base ReadOptions for a particular usecase and clone -> change the iterate_upper_bound on each slice operation. Shallow copy seemed cleanest.
* Hold a reference to the upper bound slice on ReadOptions, in contrast to Snapshot.

Signed a Facebook CLA this morning.
Closes https://github.com/facebook/rocksdb/pull/2872

Differential Revision: D5824446

Pulled By: sagar0

fbshipit-source-id: 74fc51313a10a81ecd348625e2a50ca5b7766888
java/rocksjni/options.cc
java/src/main/java/org/rocksdb/ReadOptions.java
java/src/main/java/org/rocksdb/Slice.java
java/src/test/java/org/rocksdb/ReadOptionsTest.java