ReadOptions Class
Definition
Namespace: RocksDbSharp
public class ReadOptions
ReadOptions controls a single Get,
MultiGet, or NewIterator
call. It carries snapshot pinning, iterate bounds, and read-path performance
knobs.
Remarks
The setters are fluent and return the same ReadOptions, so a configured
instance can be reused across calls or built on the fly. Passing null (or
omitting the parameter) uses a fresh default ReadOptions. See
Read & Write Options.
Methods
| Name | Description |
|---|---|
SetSnapshot(Snapshot) |
Pins the read to a specific snapshot. |
SetVerifyChecksums(bool) |
Verifies SST/block checksums on read. |
SetFillCache(bool) |
Controls whether read blocks enter the block cache. |
SetIterateLowerBound(...) |
Skips SST files/blocks below this key in iterators. |
SetIterateUpperBound(...) |
Skips SST files/blocks at or above this key in iterators. |
SetPrefixSameAsStart(bool) |
Constrains prefix-seek iterators to one prefix bucket. |
SetTotalOrderSeek(bool) |
Forces a prefix-extractor CF to scan across prefixes. |
SetTailing(bool) |
Creates a tailing iterator that follows new writes. |
SetReadTier(int) |
Restricts the read to a storage tier. |
SetReadaheadSize(ulong) |
Sets read-ahead size for iterator scans. |
SetSnapshot
public ReadOptions SetSnapshot(Snapshot snapshot)
Pins the read to a specific snapshot.
SetVerifyChecksums
public ReadOptions SetVerifyChecksums(bool value)
Verifies SST and block checksums on read.
SetFillCache
public ReadOptions SetFillCache(bool value)
When false, blocks read by this call won't pollute the block cache — useful
for large scans.
SetIterateLowerBound
public ReadOptions SetIterateLowerBound(string key)
Lets iterators skip SST files and blocks below this key.
SetIterateUpperBound
public ReadOptions SetIterateUpperBound(string key)
Lets iterators skip SST files and blocks at or above this key.
SetPrefixSameAsStart
public ReadOptions SetPrefixSameAsStart(bool value)
Constrains a prefix-seek iterator to a single prefix bucket.
SetTotalOrderSeek
public ReadOptions SetTotalOrderSeek(bool value)
Forces a column family with a prefix_extractor to scan across prefixes.
SetTailing
public ReadOptions SetTailing(bool value)
Creates a tailing iterator that follows newly-written keys while it remains valid.
SetReadTier
public ReadOptions SetReadTier(int tier)
Restricts the read to a storage tier: 0 any tier, 1 block cache + memtable,
2 memtable only, 3 persisted tier only.
SetReadaheadSize
public ReadOptions SetReadaheadSize(ulong size)
Sets the read-ahead size for iterator scans. A companion
SetAutoReadaheadSize(bool) enables auto-tuned readahead.
Applies to
RocksDbSharp — see Read & Write Options for the full setter table and examples.