[JAVA] Add java binding for Options.block_cache.

Summary:
Add java bindings for Options.block_cache and allow DbBenchmark to
set cache_size.

Test Plan:
make rocksdbjava
make jtest
make jdb_Bench

Reviewers: haobo, sdong, ankgup87

Reviewed By: ankgup87

CC: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D17481
This commit is contained in:
Yueh-Hsuan Chiang
2014-04-14 13:42:36 -07:00
parent 2885ad9b77
commit 31e7e7fe84
6 changed files with 84 additions and 44 deletions

View File

@@ -56,13 +56,11 @@ public class RocksDBSample {
assert(db == null);
assert(false);
}
// be sure to release the c++ pointer
options.dispose();
db.close();
try {
db = RocksDB.open(db_path);
db = RocksDB.open(options, db_path);
db.put("hello".getBytes(), "world".getBytes());
byte[] value = db.get("hello".getBytes());
System.out.format("Get('hello') = %s\n",
@@ -127,5 +125,7 @@ public class RocksDBSample {
if (db != null) {
db.close();
}
// be sure to dispose c++ pointer
options.dispose();
}
}