public class WriteOptions extends Object
| Constructor and Description |
|---|
WriteOptions() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
snapshot()
If "snapshot" is true, take a snapshot at the end of this write operation
|
WriteOptions |
snapshot(boolean snapshot) |
boolean |
sync()
If true, the write will be flushed from the operating system
buffer cache (by calling WritableFile::Sync()) before the write
is considered complete.
|
WriteOptions |
sync(boolean sync) |
public boolean sync()
If this flag is false, and the machine crashes, some recent writes may be lost. Note that if it is just the process that crashes (i.e., the machine does not reboot), no writes will be lost even if sync==false.
In other words, a DB write with sync==false has similar crash semantics as the "write()" system call. A DB write with sync==true has similar crash semantics to a "write()" system call followed by "fsync()".
In java Implementation if process crash Default: false
public WriteOptions sync(boolean sync)
public boolean snapshot()
public WriteOptions snapshot(boolean snapshot)
Copyright © 2011–2020. All rights reserved.