Struct raftstore::store::worker::region::SnapContext[][src]

struct SnapContext<EK, R> where
    EK: KvEngine
{ engine: EK, batch_size: usize, mgr: SnapManager, use_delete_range: bool, pending_delete_ranges: PendingDeleteRanges, coprocessor_host: CoprocessorHost<EK>, router: R, }

Fields

engine: EKbatch_size: usizemgr: SnapManageruse_delete_range: boolpending_delete_ranges: PendingDeleteRangescoprocessor_host: CoprocessorHost<EK>router: R

Implementations

impl<EK, R> SnapContext<EK, R> where
    EK: KvEngine,
    R: CasualRouter<EK>, 
[src]

fn generate_snap(
    &self,
    region_id: u64,
    last_applied_index_term: u64,
    last_applied_state: RaftApplyState,
    kv_snap: EK::Snapshot,
    notifier: SyncSender<RaftSnapshot>,
    for_balance: bool
) -> Result<(), Error>
[src]

Generates the snapshot of the Region.

fn handle_gen(
    &self,
    region_id: u64,
    last_applied_index_term: u64,
    last_applied_state: RaftApplyState,
    kv_snap: EK::Snapshot,
    canceled: Arc<AtomicBool>,
    notifier: SyncSender<RaftSnapshot>,
    for_balance: bool
)
[src]

Handles the task of generating snapshot of the Region. It calls generate_snap to do the actual work.

fn apply_snap(
    &mut self,
    region_id: u64,
    abort: Arc<AtomicUsize>
) -> Result<(), Error>
[src]

Applies snapshot data of the Region.

fn handle_apply(&mut self, region_id: u64, status: Arc<AtomicUsize>)[src]

Tries to apply the snapshot of the specified Region. It calls apply_snap to do the actual work.

fn cleanup_range(&self, ranges: &[Range<'_>]) -> Result<(), Error>[src]

Cleans up the data within the range.

fn cleanup_overlap_ranges(
    &mut self,
    start_key: &[u8],
    end_key: &[u8]
) -> Result<(), Error>
[src]

Gets the overlapping ranges and cleans them up.

fn insert_pending_delete_range(
    &mut self,
    region_id: u64,
    start_key: &[u8],
    end_key: &[u8]
)
[src]

Inserts a new pending range, and it will be cleaned up with some delay.

fn clean_stale_ranges(&mut self)[src]

Cleans up stale ranges.

fn ingest_maybe_stall(&self) -> bool[src]

Checks the number of files at level 0 to avoid write stall after ingesting sst. Returns true if the ingestion causes write stall.

fn delete_all_in_range(&self, ranges: &[Range<'_>]) -> Result<(), Error>[src]

Trait Implementations

impl<EK: Clone, R: Clone> Clone for SnapContext<EK, R> where
    EK: KvEngine
[src]

Auto Trait Implementations

impl<EK, R> !RefUnwindSafe for SnapContext<EK, R>

impl<EK, R> Send for SnapContext<EK, R> where
    R: Send

impl<EK, R> !Sync for SnapContext<EK, R>

impl<EK, R> Unpin for SnapContext<EK, R> where
    R: Unpin

impl<EK, R> !UnwindSafe for SnapContext<EK, R>

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<V, W> ConvertFrom<W> for V where
    W: ConvertTo<V>, 
[src]

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

impl<T> Instrument for T[src]

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]