mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
[Java] Add RocksObject, the base class of all java objects with a c++ pointer.
Summary: Add RocksObject, the base class of all java objects which has a c++ pointer. While the finalizer of a RocksObject will release its c++ resource, it is suggested to call its RocksObject.dispose() to manually release its c++ resource. Existing RocksDB java classes are now extending RocksObject. Test Plan: make rocksdbjava make jtest make jdb_bench Reviewers: haobo, dhruba, sdong, ankgup87, rsumbaly, swapnilghike, zzbennett Reviewed By: haobo CC: leveldb Differential Revision: https://reviews.facebook.net/D18411
This commit is contained in:
@@ -55,8 +55,8 @@ public class BackupableDB extends RocksDB {
|
||||
* should be transparent to Java developers.
|
||||
*/
|
||||
@Override public synchronized void close() {
|
||||
if (isOpened()) {
|
||||
super.close0();
|
||||
if (isInitialized()) {
|
||||
super.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,10 +73,6 @@ public class BackupableDB extends RocksDB {
|
||||
close();
|
||||
}
|
||||
|
||||
private boolean isOpened() {
|
||||
return nativeHandle_ != 0;
|
||||
}
|
||||
|
||||
protected native void open(long rocksDBHandle, long backupDBOptionsHandle);
|
||||
protected native void createNewBackup(long handle, boolean flag);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user