mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
[JNI] Each set function of Options / WriteOptions now returns its option instance.
Summary:
Make each set function of Options / WriteOptions return its option instance.
Java developers can now easier specify each option like the following:
options.setCreateIfMissing(true)
.setWriteBufferSize(8 * 1024)
.setMaxWriteBufferNumber(3)
.setDisableSeekCompaction(true)
.setBlockSize(64 * 1024)
.setMaxBackgroundCompactions(10);
Test Plan:
make rocksdbjava
make jtest
Reviewers: haobo, ankgup87, sdong, dhruba
Reviewed By: haobo
CC: leveldb
Differential Revision: https://reviews.facebook.net/D17661
This commit is contained in:
@@ -40,9 +40,14 @@ public class WriteOptions {
|
||||
* system call followed by "fdatasync()".
|
||||
*
|
||||
* Default: false
|
||||
*
|
||||
* @param flag a boolean flag to indicate whether a write
|
||||
* should be synchronized.
|
||||
* @return the instance of the current WriteOptions.
|
||||
*/
|
||||
public void setSync(boolean flag) {
|
||||
public WriteOptions setSync(boolean flag) {
|
||||
setSync(nativeHandle_, flag);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,9 +73,14 @@ public class WriteOptions {
|
||||
/**
|
||||
* If true, writes will not first go to the write ahead log,
|
||||
* and the write may got lost after a crash.
|
||||
*
|
||||
* @param flag a boolean flag to specify whether to disable
|
||||
* write-ahead-log on writes.
|
||||
* @return the instance of the current WriteOptions.
|
||||
*/
|
||||
public void setDisableWAL(boolean flag) {
|
||||
public WriteOptions setDisableWAL(boolean flag) {
|
||||
setDisableWAL(nativeHandle_, flag);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,5 +102,5 @@ public class WriteOptions {
|
||||
private native boolean disableWAL(long handle);
|
||||
private native void dispose0(long handle);
|
||||
|
||||
protected long nativeHandle_;
|
||||
protected long nativeHandle_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user