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<'_>
impl CompactionServiceJobInfo<'_>
Sourcepub fn db_name(&self) -> &[u8] ⓘ
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.
Sourcepub fn db_id(&self) -> &[u8] ⓘ
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.
Sourcepub fn db_session_id(&self) -> &[u8] ⓘ
pub fn db_session_id(&self) -> &[u8] ⓘ
Identity of this run of the DB, regenerated on every open.
Sourcepub fn cf_name(&self) -> &[u8] ⓘ
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.
Sourcepub fn job_id(&self) -> u64
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.
Sourcepub fn priority(&self) -> Option<EnvPriority>
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.
Sourcepub fn compaction_reason(&self) -> Option<DBCompactionReason>
pub fn compaction_reason(&self) -> Option<DBCompactionReason>
Why RocksDB started this compaction, or None for a reason this crate
does not name.
Sourcepub fn base_input_level(&self) -> i32
pub fn base_input_level(&self) -> i32
The lowest level the compaction reads from.
Sourcepub fn output_level(&self) -> i32
pub fn output_level(&self) -> i32
The level the compaction writes to.
Sourcepub fn is_full_compaction(&self) -> bool
pub fn is_full_compaction(&self) -> bool
Whether the compaction covers every file in the column family.
Sourcepub fn is_manual_compaction(&self) -> bool
pub fn is_manual_compaction(&self) -> bool
Whether the application asked for this compaction rather than RocksDB picking it.
Sourcepub fn is_bottommost_level(&self) -> bool
pub fn is_bottommost_level(&self) -> bool
Whether the output level is the bottommost one holding data.