[][src]Struct rocks::options::ReadOptions

pub struct ReadOptions<'a> { /* fields omitted */ }

Options that control read operations.

Examples

Construct ReadOptions using builder pattern.

use rocks::rocksdb::{ReadOptions, ReadTier};

let _ropt = ReadOptions::default()
    .fill_cache(true)
    .managed(true)
    .read_tier(ReadTier::PersistedTier);

Implementations

impl<'a> ReadOptions<'a>[src]

pub fn default_instance() -> &'static ReadOptions<'static>[src]

default ReadOptions optimization

pub fn new<'b>(cksum: bool, cache: bool) -> ReadOptions<'b>[src]

pub fn snapshot<'s, 'b: 'a, T: AsRef<Snapshot<'s>> + 'b>(
    self,
    val: Option<T>
) -> Self
[src]

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: nullptr

pub fn iterate_lower_bound<'b: 'a>(self, val: &'b [u8]) -> Self[src]

iterate_lower_bound defines the smallest key at which the backward iterator can return an entry. Once the bound is passed, Valid() will be false. iterate_lower_bound is inclusive ie the bound value is a valid entry.

If prefix_extractor is not null, the Seek target and iterate_lower_bound need to have the same prefix. This is because ordering is not guaranteed outside of prefix domain.

Default: nullptr

pub fn iterate_upper_bound<'b: 'a>(self, val: &'b [u8]) -> Self[src]

iterate_upper_bound defines the extent upto which the forward iterator can returns entries. Once the bound is reached, is_valid() will be false. iterate_upper_bound is exclusive ie the bound value is not a valid entry. If iterator_extractor is not null, the Seek target and iterator_upper_bound need to have the same prefix. This is because ordering is not guaranteed outside of prefix domain. There is no lower bound on the iterator. If needed, that can be easily implemented

Default: nullptr

pub fn readahead_size(self, val: usize) -> Self[src]

If non-zero, NewIterator will create a new table reader which performs reads of the given size. Using a large size (> 2MB) can improve the performance of forward iteration on spinning disks.

Default: 0

pub fn max_skippable_internal_keys(self, val: u64) -> Self[src]

A threshold for the number of keys that can be skipped before failing an iterator seek as incomplete. The default value of 0 should be used to never fail a request as incomplete, even on skipping too many keys.

Default: 0

pub fn read_tier(self, val: ReadTier) -> Self[src]

Specify if this read request should process data that ALREADY resides on a particular cache. If the required data is not found at the specified cache, then Status::Incomplete is returned.

Default: kReadAllTier

pub fn verify_checksums(self, val: bool) -> Self[src]

If true, all data read from underlying storage will be verified against corresponding checksums.

Default: true

pub fn fill_cache(self, val: bool) -> Self[src]

Should the "data block"/"index block"/"filter block" read for this iteration be cached in memory?

Callers may wish to set this field to false for bulk scans.

Default: true

pub fn tailing(self, val: bool) -> Self[src]

Specify to create a tailing iterator -- a special iterator that has a view of the complete database (i.e. it can also be used to read newly added data) and is optimized for sequential reads. It will return records that were inserted into the database after the creation of the iterator.

Default: false

pub fn managed(self, val: bool) -> Self[src]

Specify to create a managed iterator -- a special iterator that uses less resources by having the ability to free its underlying resources on request.

Default: false

pub fn total_order_seek(self, val: bool) -> Self[src]

Enable a total order seek regardless of index format (e.g. hash index) used in the table. Some table format (e.g. plain table) may not support this option.

If true when calling get(), we also skip prefix bloom when reading from block based table. It provides a way to read existing data after changing implementation of prefix extractor.

pub fn prefix_same_as_start(self, val: bool) -> Self[src]

Enforce that the iterator only iterates over the same prefix as the seek. This option is effective only for prefix seeks, i.e. prefix_extractor is non-null for the column family and total_order_seek is false. Unlike iterate_upper_bound, prefix_same_as_start only works within a prefix but in both directions.

Default: false

pub fn pin_data(self, val: bool) -> Self[src]

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.

Default: false

pub fn background_purge_on_iterator_cleanup(self, val: bool) -> Self[src]

If true, when PurgeObsoleteFile is called in CleanupIteratorState, we schedule a background job in the flush job queue and delete obsolete files in background.

Default: false

pub fn ignore_range_deletions(self, val: bool) -> Self[src]

If true, keys deleted using the delete_range() API will be visible to readers until they are naturally deleted during compaction. This improves read performance in DBs with many range deletions.

Default: false

pub fn iter_start_seqnum(self, val: SequenceNumber) -> Self[src]

Needed to support differential snapshots. Has 2 effects:

  1. Iterator will skip all internal keys with seqnum < iter_start_seqnum
  2. if this param > 0 iterator will return INTERNAL keys instead of user keys; e.g. return tombstones as well.

Default: 0 (don't filter by seqnum, return user keys)

Trait Implementations

impl<'a> AsRef<ReadOptions<'a>> for ReadOptions<'a>[src]

impl<'a> Default for ReadOptions<'a>[src]

impl<'a> Drop for ReadOptions<'a>[src]

impl<'a> Sync for ReadOptions<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for ReadOptions<'a>[src]

impl<'a> !Send for ReadOptions<'a>[src]

impl<'a> Unpin for ReadOptions<'a>[src]

impl<'a> UnwindSafe for ReadOptions<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.