Integrated changes due to review bei ankgup87
This commit is contained in:
parent
b8ce526487
commit
a1bae76c87
@ -92,7 +92,11 @@ public class ReadOptions extends RocksObject {
|
||||
*/
|
||||
public ReadOptions setSnapshot(Snapshot snapshot) {
|
||||
assert(isInitialized());
|
||||
setSnapshot(nativeHandle_, snapshot.nativeHandle_);
|
||||
if (snapshot != null) {
|
||||
setSnapshot(nativeHandle_, snapshot.nativeHandle_);
|
||||
} else {
|
||||
setSnapshot(nativeHandle_, 0l);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
private native void setSnapshot(long handle, long snapshotHandle);
|
||||
|
@ -69,6 +69,11 @@ public class SnapshotTest
|
||||
// null
|
||||
assert(db.get(readOptions, "newkey".getBytes())
|
||||
== null);
|
||||
// setting null to snapshot in ReadOptions leads
|
||||
// to no Snapshot being used.
|
||||
readOptions.setSnapshot(null);
|
||||
assert(new String(db.get(readOptions,
|
||||
"newkey".getBytes())).equals("newvalue"));
|
||||
// release Snapshot
|
||||
db.releaseSnapshot(snapshot);
|
||||
// Close database
|
||||
|
Loading…
Reference in New Issue
Block a user