[Java] Add a basic binding and test for BackupableDB and StackableDB.

Summary:
Add a skeleton binding and test for BackupableDB which shows that BackupableDB
and RocksDB can share the same JNI calls.

Test Plan:
make rocksdbjava
make jtest

Reviewers: haobo, ankgup87, sdong, dhruba

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D17793
This commit is contained in:
Yueh-Hsuan Chiang
2014-04-17 17:28:51 -07:00
parent 651792251a
commit bb6fd15a6e
9 changed files with 315 additions and 13 deletions

View File

@@ -145,33 +145,33 @@ public class RocksDB {
/**
* Private constructor.
*/
private RocksDB() {
protected RocksDB() {
nativeHandle_ = 0;
}
// native methods
private native void open(
protected native void open(
long optionsHandle, long cacheSize, String path) throws RocksDBException;
private native void put(
protected native void put(
long handle, byte[] key, int keyLen,
byte[] value, int valueLen) throws RocksDBException;
private native void put(
protected native void put(
long handle, long writeOptHandle,
byte[] key, int keyLen,
byte[] value, int valueLen) throws RocksDBException;
private native void write(
protected native void write(
long writeOptHandle, long batchHandle) throws RocksDBException;
private native int get(
protected native int get(
long handle, byte[] key, int keyLen,
byte[] value, int valueLen) throws RocksDBException;
private native byte[] get(
protected native byte[] get(
long handle, byte[] key, int keyLen) throws RocksDBException;
private native void remove(
protected native void remove(
long handle, byte[] key, int keyLen) throws RocksDBException;
private native void remove(
protected native void remove(
long handle, long writeOptHandle,
byte[] key, int keyLen) throws RocksDBException;
private native void close0();
protected native void close0();
private long nativeHandle_;
protected long nativeHandle_;
}