public class ReadOptions extends RocksObject
Modifier and Type | Field and Description |
---|---|
protected Slice |
iterateUpperBoundSlice_ |
nativeHandle_
Constructor and Description |
---|
ReadOptions() |
ReadOptions(ReadOptions other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
backgroundPurgeOnIteratorCleanup()
If true, when PurgeObsoleteFile is called in CleanupIteratorState, we
schedule a background job in the flush job queue and delete obsolete files
in background.
|
protected void |
disposeInternal(long handle) |
boolean |
fillCache()
Fill the cache when loading the block-based sst formated db.
|
boolean |
ignoreRangeDeletions()
If true, keys deleted using the DeleteRange() API will be visible to
readers until they are naturally deleted during compaction.
|
Slice |
iterateUpperBound()
Defines the extent upto which the forward iterator can returns entries.
|
boolean |
managed()
Returns whether managed iterators will be used.
|
boolean |
pinData()
Returns whether the blocks loaded by the iterator will be pinned in memory
|
boolean |
prefixSameAsStart()
Returns whether the iterator only iterates over the same prefix as the seek
|
long |
readaheadSize()
If non-zero, NewIterator will create a new table reader which
performs reads of the given size.
|
ReadTier |
readTier()
Returns the current read tier.
|
ReadOptions |
setBackgroundPurgeOnIteratorCleanup(boolean backgroundPurgeOnIteratorCleanup)
If true, when PurgeObsoleteFile is called in CleanupIteratorState, we
schedule a background job in the flush job queue and delete obsolete files
in background.
|
ReadOptions |
setFillCache(boolean fillCache)
Fill the cache when loading the block-based sst formatted db.
|
ReadOptions |
setIgnoreRangeDeletions(boolean ignoreRangeDeletions)
If true, keys deleted using the DeleteRange() API will be visible to
readers until they are naturally deleted during compaction.
|
ReadOptions |
setIterateUpperBound(Slice iterateUpperBound)
Defines the extent upto which the forward iterator can returns entries.
|
ReadOptions |
setManaged(boolean managed)
Specify to create a managed iterator -- a special iterator that
uses less resources by having the ability to free its underlying
resources on request.
|
ReadOptions |
setPinData(boolean pinData)
Keep the blocks loaded by the iterator pinned in memory as long as the
iterator is not deleted, If used when reading from tables created with
BlockBasedTableOptions::use_delta_encoding = false,
Iterator's property "rocksdb.iterator.is-key-pinned" is guaranteed to
return 1.
|
ReadOptions |
setPrefixSameAsStart(boolean prefixSameAsStart)
Enforce that the iterator only iterates over the same prefix as the seek.
|
ReadOptions |
setReadaheadSize(long readaheadSize)
If non-zero, NewIterator will create a new table reader which
performs reads of the given size.
|
ReadOptions |
setReadTier(ReadTier readTier)
Specify if this read request should process data that ALREADY
resides on a particular cache.
|
ReadOptions |
setSnapshot(Snapshot snapshot)
If "snapshot" is non-nullptr, read as of the supplied snapshot
(which must belong to the DB that is being read and which must
not have been released).
|
ReadOptions |
setTailing(boolean tailing)
Specify to create a tailing iterator -- a special iterator that has a
view of the complete database (i.e.
|
ReadOptions |
setTotalOrderSeek(boolean totalOrderSeek)
Enable a total order seek regardless of index format (e.g.
|
ReadOptions |
setVerifyChecksums(boolean verifyChecksums)
If true, all data read from underlying storage will be
verified against corresponding checksums.
|
Snapshot |
snapshot()
Returns the currently assigned Snapshot instance.
|
boolean |
tailing()
Specify to create a tailing iterator -- a special iterator that has a
view of the complete database (i.e.
|
boolean |
totalOrderSeek()
Returns whether a total seek order will be used
|
boolean |
verifyChecksums()
If true, all data read from underlying storage will be
verified against corresponding checksums.
|
disposeInternal
close, disOwnNativeHandle, isOwningHandle
dispose, finalize
protected Slice iterateUpperBoundSlice_
public ReadOptions()
public ReadOptions(ReadOptions other)
other
- The ReadOptions to copy.public boolean verifyChecksums()
public ReadOptions setVerifyChecksums(boolean verifyChecksums)
verifyChecksums
- if true, then checksum verification
will be performed on every read.public boolean fillCache()
public ReadOptions setFillCache(boolean fillCache)
fillCache
- if true, then fill-cache behavior will be
performed.public Snapshot snapshot()
public ReadOptions setSnapshot(Snapshot snapshot)
If "snapshot" is non-nullptr, read as of the supplied snapshot (which must belong to the DB that is being read and which must not have been released). If "snapshot" is nullptr, use an implicit snapshot of the state at the beginning of this read operation.
Default: null
snapshot
- Snapshot
instancepublic ReadTier readTier()
ReadTier.READ_ALL_TIER
public ReadOptions setReadTier(ReadTier readTier)
RocksDBException
is thrown.readTier
- ReadTier
instancepublic boolean tailing()
ROCKSDB_LITE
mode!public ReadOptions setTailing(boolean tailing)
tailing
- if true, then tailing iterator will be enabled.public boolean managed()
public ReadOptions setManaged(boolean managed)
managed
- if true, then managed iterators will be enabled.public boolean totalOrderSeek()
public ReadOptions setTotalOrderSeek(boolean totalOrderSeek)
totalOrderSeek
- if true, then total order seek will be enabled.public boolean prefixSameAsStart()
public ReadOptions setPrefixSameAsStart(boolean prefixSameAsStart)
totalOrderSeek()
is false.
Unlike iterate_upper_bound, setPrefixSameAsStart(boolean)
only
works within a prefix but in both directions.prefixSameAsStart
- if true, then the iterator only iterates over the
same prefix as the seekpublic boolean pinData()
public ReadOptions setPinData(boolean pinData)
pinData
- if true, the blocks loaded by the iterator will be pinnedpublic boolean backgroundPurgeOnIteratorCleanup()
public ReadOptions setBackgroundPurgeOnIteratorCleanup(boolean backgroundPurgeOnIteratorCleanup)
backgroundPurgeOnIteratorCleanup
- true when PurgeObsoleteFile is
called in CleanupIteratorStatepublic long readaheadSize()
public ReadOptions setReadaheadSize(long readaheadSize)
readaheadSize
- The readahead size is bytespublic boolean ignoreRangeDeletions()
public ReadOptions setIgnoreRangeDeletions(boolean ignoreRangeDeletions)
ignoreRangeDeletions
- true if keys deleted using the DeleteRange()
API should be visiblepublic ReadOptions setIterateUpperBound(Slice iterateUpperBound)
iterateUpperBound
- Slice representing the upper boundpublic Slice iterateUpperBound()
protected final void disposeInternal(long handle)
disposeInternal
in class RocksObject