Package org.rocksdb
Class IngestExternalFileOptions
- java.lang.Object
-
- org.rocksdb.AbstractNativeReference
-
- org.rocksdb.AbstractImmutableNativeReference
-
- org.rocksdb.RocksObject
-
- org.rocksdb.IngestExternalFileOptions
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class IngestExternalFileOptions extends RocksObject
IngestExternalFileOptions is used byRocksDB.ingestExternalFile(ColumnFamilyHandle, List, IngestExternalFileOptions).
-
-
Field Summary
-
Fields inherited from class org.rocksdb.RocksObject
nativeHandle_
-
Fields inherited from class org.rocksdb.AbstractImmutableNativeReference
owningHandle_
-
-
Constructor Summary
Constructors Constructor Description IngestExternalFileOptions()IngestExternalFileOptions(boolean moveFiles, boolean snapshotConsistency, boolean allowGlobalSeqNo, boolean allowBlockingFlush)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowBlockingFlush()If set to false and the file key range overlaps with the memtable key range (memtable flush required), IngestExternalFile will fail.booleanallowGlobalSeqNo()If set to false,RocksDB.ingestExternalFile(ColumnFamilyHandle, List, IngestExternalFileOptions)will fail if the file key range overlaps with existing keys or tombstones in the DB.protected voiddisposeInternal(long handle)booleaningestBehind()Returns true if duplicate keys in the file being ingested are to be skipped rather than overwriting existing data under that key.booleanmoveFiles()Can be set to true to move the files instead of copying them.IngestExternalFileOptionssetAllowBlockingFlush(boolean allowBlockingFlush)If set to false and the file key range overlaps with the memtable key range (memtable flush required), IngestExternalFile will fail.IngestExternalFileOptionssetAllowGlobalSeqNo(boolean allowGlobalSeqNo)If set to false,RocksDB.ingestExternalFile(ColumnFamilyHandle, List, IngestExternalFileOptions)will fail if the file key range overlaps with existing keys or tombstones in the DB.IngestExternalFileOptionssetIngestBehind(boolean ingestBehind)Set to true if you would like duplicate keys in the file being ingested to be skipped rather than overwriting existing data under that key.IngestExternalFileOptionssetMoveFiles(boolean moveFiles)Can be set to true to move the files instead of copying them.IngestExternalFileOptionssetSnapshotConsistency(boolean snapshotConsistency)If set to false, an ingested file keys could appear in existing snapshots that where created before the file was ingested.IngestExternalFileOptionssetWriteGlobalSeqno(boolean writeGlobalSeqno)Set to true if you would like to write the global_seqno to a given offset in the external SST file for backward compatibility.booleansnapshotConsistency()If set to false, an ingested file keys could appear in existing snapshots that where created before the file was ingested.booleanwriteGlobalSeqno()Returns true write if the global_seqno is written to a given offset in the external SST file for backward compatibility.-
Methods inherited from class org.rocksdb.RocksObject
disposeInternal, getNativeHandle
-
Methods inherited from class org.rocksdb.AbstractImmutableNativeReference
close, disOwnNativeHandle, isOwningHandle
-
Methods inherited from class org.rocksdb.AbstractNativeReference
dispose, finalize
-
-
-
-
Constructor Detail
-
IngestExternalFileOptions
public IngestExternalFileOptions()
-
IngestExternalFileOptions
public IngestExternalFileOptions(boolean moveFiles, boolean snapshotConsistency, boolean allowGlobalSeqNo, boolean allowBlockingFlush)- Parameters:
moveFiles-setMoveFiles(boolean)snapshotConsistency-setSnapshotConsistency(boolean)allowGlobalSeqNo-setAllowGlobalSeqNo(boolean)allowBlockingFlush-setAllowBlockingFlush(boolean)
-
-
Method Detail
-
moveFiles
public boolean moveFiles()
Can be set to true to move the files instead of copying them.- Returns:
- true if files will be moved
-
setMoveFiles
public IngestExternalFileOptions setMoveFiles(boolean moveFiles)
Can be set to true to move the files instead of copying them.- Parameters:
moveFiles- true if files should be moved instead of copied- Returns:
- the reference to the current IngestExternalFileOptions.
-
snapshotConsistency
public boolean snapshotConsistency()
If set to false, an ingested file keys could appear in existing snapshots that where created before the file was ingested.- Returns:
- true if snapshot consistency is assured
-
setSnapshotConsistency
public IngestExternalFileOptions setSnapshotConsistency(boolean snapshotConsistency)
If set to false, an ingested file keys could appear in existing snapshots that where created before the file was ingested.- Parameters:
snapshotConsistency- true if snapshot consistency is required- Returns:
- the reference to the current IngestExternalFileOptions.
-
allowGlobalSeqNo
public boolean allowGlobalSeqNo()
If set to false,RocksDB.ingestExternalFile(ColumnFamilyHandle, List, IngestExternalFileOptions)will fail if the file key range overlaps with existing keys or tombstones in the DB.- Returns:
- true if global seq numbers are assured
-
setAllowGlobalSeqNo
public IngestExternalFileOptions setAllowGlobalSeqNo(boolean allowGlobalSeqNo)
If set to false,RocksDB.ingestExternalFile(ColumnFamilyHandle, List, IngestExternalFileOptions)will fail if the file key range overlaps with existing keys or tombstones in the DB.- Parameters:
allowGlobalSeqNo- true if global seq numbers are required- Returns:
- the reference to the current IngestExternalFileOptions.
-
allowBlockingFlush
public boolean allowBlockingFlush()
If set to false and the file key range overlaps with the memtable key range (memtable flush required), IngestExternalFile will fail.- Returns:
- true if blocking flushes may occur
-
setAllowBlockingFlush
public IngestExternalFileOptions setAllowBlockingFlush(boolean allowBlockingFlush)
If set to false and the file key range overlaps with the memtable key range (memtable flush required), IngestExternalFile will fail.- Parameters:
allowBlockingFlush- true if blocking flushes are allowed- Returns:
- the reference to the current IngestExternalFileOptions.
-
ingestBehind
public boolean ingestBehind()
Returns true if duplicate keys in the file being ingested are to be skipped rather than overwriting existing data under that key.- Returns:
- true if duplicate keys in the file being ingested are to be skipped, false otherwise.
-
setIngestBehind
public IngestExternalFileOptions setIngestBehind(boolean ingestBehind)
Set to true if you would like duplicate keys in the file being ingested to be skipped rather than overwriting existing data under that key. Usecase: back-fill of some historical data in the database without over-writing existing newer version of data. This option could only be used if the DB has been running with DBOptions#allowIngestBehind() == true since the dawn of time. All files will be ingested at the bottommost level with seqno=0. Default: false- Parameters:
ingestBehind- true if you would like duplicate keys in the file being ingested to be skipped.- Returns:
- the reference to the current IngestExternalFileOptions.
-
writeGlobalSeqno
public boolean writeGlobalSeqno()
Returns true write if the global_seqno is written to a given offset in the external SST file for backward compatibility. SeesetWriteGlobalSeqno(boolean).- Returns:
- true if the global_seqno is written to a given offset, false otherwise.
-
setWriteGlobalSeqno
public IngestExternalFileOptions setWriteGlobalSeqno(boolean writeGlobalSeqno)
Set to true if you would like to write the global_seqno to a given offset in the external SST file for backward compatibility. Older versions of RocksDB write the global_seqno to a given offset within the ingested SST files, and new versions of RocksDB do not. If you ingest an external SST using new version of RocksDB and would like to be able to downgrade to an older version of RocksDB, you should setwriteGlobalSeqno()to true. If your service is just starting to use the new RocksDB, we recommend that you set this option to false, which brings two benefits: 1. No extra random write for global_seqno during ingestion. 2. Without writing external SST file, it's possible to do checksum. We have a plan to set this option to false by default in the future. Default: true- Parameters:
writeGlobalSeqno- true to write the gloal_seqno to a given offset, false otherwise- Returns:
- the reference to the current IngestExternalFileOptions.
-
disposeInternal
protected final void disposeInternal(long handle)
- Specified by:
disposeInternalin classRocksObject
-
-