Struct rocksdb::IngestExternalFileOptions

source ·
pub struct IngestExternalFileOptions { /* private fields */ }
Expand description

For configuring external files ingestion.

§Examples

Move files instead of copying them:

use rocksdb::{DB, IngestExternalFileOptions, SstFileWriter, Options};

let writer_opts = Options::default();
let mut writer = SstFileWriter::create(&writer_opts);
writer.open("_path_for_sst_file").unwrap();
writer.put(b"k1", b"v1").unwrap();
writer.finish().unwrap();

let path = "_path_for_rocksdb_storageY3";
{
  let db = DB::open_default(&path).unwrap();
  let mut ingest_opts = IngestExternalFileOptions::default();
  ingest_opts.set_move_files(true);
  db.ingest_external_file_opts(&ingest_opts, vec!["_path_for_sst_file"]).unwrap();
}
let _ = DB::destroy(&Options::default(), path);

Implementations§

source§

impl IngestExternalFileOptions

source

pub fn set_move_files(&mut self, v: bool)

Can be set to true to move the files instead of copying them.

source

pub fn set_snapshot_consistency(&mut self, v: bool)

If set to false, an ingested file keys could appear in existing snapshots that where created before the file was ingested.

source

pub fn set_allow_global_seqno(&mut self, v: bool)

If set to false, IngestExternalFile() will fail if the file key range overlaps with existing keys or tombstones in the DB.

source

pub fn set_allow_blocking_flush(&mut self, v: bool)

If set to false and the file key range overlaps with the memtable key range (memtable flush required), IngestExternalFile will fail.

source

pub fn set_ingest_behind(&mut self, v: bool)

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 allow_ingest_behind=true since the dawn of time. All files will be ingested at the bottommost level with seqno=0.

Trait Implementations§

source§

impl Default for IngestExternalFileOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Drop for IngestExternalFileOptions

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for IngestExternalFileOptions

source§

impl Sync for IngestExternalFileOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.