Skip to main content

CompactionServiceJobInfo

Struct CompactionServiceJobInfo 

Source
pub struct CompactionServiceJobInfo<'a> { /* private fields */ }
Expand description

What one compaction the primary DB wants run looks like, borrowed for the length of the schedule call.

RocksDB builds this on the compaction thread’s stack (compaction_service_job.cc:76) and drops it as soon as schedule returns, so 'a ties the view and every byte slice it hands back to that call. Copy out anything the worker needs to keep.

None of this is needed to run the compaction. The serialized input carries that. This is for routing, logging, and deciding whether to take the job at all.

Implementations§

Source§

impl CompactionServiceJobInfo<'_>

Source

pub fn db_name(&self) -> &[u8]

Path of the DB the compaction belongs to.

Raw bytes, because RocksDB builds this from a path this crate passes through without validating it as UTF-8. Borrowed straight from the std::string inside the job info (c.cc:1115), so nothing is copied and nothing needs freeing.

Source

pub fn db_id(&self) -> &[u8]

The DB’s persistent identity, which survives restarts.

Pair this with db_session_id and job_id to name a job uniquely across DBs and runs.

Source

pub fn db_session_id(&self) -> &[u8]

Identity of this run of the DB, regenerated on every open.

Source

pub fn cf_name(&self) -> &[u8]

Name of the column family being compacted.

Raw bytes, because RocksDB does not require column family names to be UTF-8.

Source

pub fn cf_id(&self) -> u32

Id of the column family being compacted.

Source

pub fn job_id(&self) -> u64

Id of the compaction job.

Only unique within the current DB and session. It restarts from zero when the DB reopens.

Source

pub fn priority(&self) -> Option<EnvPriority>

Which background thread pool the compaction was scheduled in, or None for a priority this crate does not name.

Source

pub fn compaction_reason(&self) -> Option<DBCompactionReason>

Why RocksDB started this compaction, or None for a reason this crate does not name.

Source

pub fn base_input_level(&self) -> i32

The lowest level the compaction reads from.

Source

pub fn output_level(&self) -> i32

The level the compaction writes to.

Source

pub fn is_full_compaction(&self) -> bool

Whether the compaction covers every file in the column family.

Source

pub fn is_manual_compaction(&self) -> bool

Whether the application asked for this compaction rather than RocksDB picking it.

Source

pub fn is_bottommost_level(&self) -> bool

Whether the output level is the bottommost one holding data.

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.