]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/java/src/main/java/org/rocksdb/FlushOptions.java
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / java / src / main / java / org / rocksdb / FlushOptions.java
1 package org.rocksdb;
2
3 /**
4 * FlushOptions to be passed to flush operations of
5 * {@link org.rocksdb.RocksDB}.
6 */
7 public class FlushOptions extends RocksObject {
8 static {
9 RocksDB.loadLibrary();
10 }
11
12 /**
13 * Construct a new instance of FlushOptions.
14 */
15 public FlushOptions(){
16 super(newFlushOptions());
17 }
18
19 /**
20 * Set if the flush operation shall block until it terminates.
21 *
22 * @param waitForFlush boolean value indicating if the flush
23 * operations waits for termination of the flush process.
24 *
25 * @return instance of current FlushOptions.
26 */
27 public FlushOptions setWaitForFlush(final boolean waitForFlush) {
28 assert(isOwningHandle());
29 setWaitForFlush(nativeHandle_, waitForFlush);
30 return this;
31 }
32
33 /**
34 * Wait for flush to finished.
35 *
36 * @return boolean value indicating if the flush operation
37 * waits for termination of the flush process.
38 */
39 public boolean waitForFlush() {
40 assert(isOwningHandle());
41 return waitForFlush(nativeHandle_);
42 }
43
44 private native static long newFlushOptions();
45 @Override protected final native void disposeInternal(final long handle);
46 private native void setWaitForFlush(long handle,
47 boolean wait);
48 private native boolean waitForFlush(long handle);
49 }