Struct tikv::server::gc_worker::GcWorker[][src]

pub struct GcWorker<E, RR> where
    E: Engine,
    RR: RaftStoreRouter<RocksEngine> + 'static, 
{ engine: E, raft_store_router: RR, config_manager: GcWorkerConfigManager, scheduled_tasks: Arc<AtomicUsize>, refs: Arc<AtomicUsize>, worker: Arc<Mutex<FutureWorker<GcTask>>>, worker_scheduler: FutureScheduler<GcTask>, applied_lock_collector: Option<Arc<AppliedLockCollector>>, gc_manager_handle: Arc<Mutex<Option<GcManagerHandle>>>, feature_gate: FeatureGate, }

Used to schedule GC operations.

Fields

engine: Eraft_store_router: RR

raft_store_router is useful to signal raftstore clean region size informations.

config_manager: GcWorkerConfigManagerscheduled_tasks: Arc<AtomicUsize>

How many requests are scheduled from outside and unfinished.

refs: Arc<AtomicUsize>

How many strong references. The worker will be stopped once there are no more references.

worker: Arc<Mutex<FutureWorker<GcTask>>>worker_scheduler: FutureScheduler<GcTask>applied_lock_collector: Option<Arc<AppliedLockCollector>>gc_manager_handle: Arc<Mutex<Option<GcManagerHandle>>>feature_gate: FeatureGate

Implementations

impl<E, RR> GcWorker<E, RR> where
    E: Engine,
    RR: RaftStoreRouter<RocksEngine>, 
[src]

pub fn new(
    engine: E,
    raft_store_router: RR,
    cfg: GcConfig,
    feature_gate: FeatureGate
) -> GcWorker<E, RR>
[src]

pub fn start_auto_gc<S: GcSafePointProvider, R: RegionInfoProvider + Clone + 'static>(
    &self,
    cfg: AutoGcConfig<S, R>,
    safe_point: Arc<AtomicU64>
) -> Result<()>
[src]

pub fn start(&mut self) -> Result<()>[src]

pub fn start_observe_lock_apply(
    &mut self,
    coprocessor_host: &mut CoprocessorHost<RocksEngine>,
    concurrency_manager: ConcurrencyManager
) -> Result<()>
[src]

pub fn stop(&self) -> Result<()>[src]

pub fn scheduler(&self) -> FutureScheduler<GcTask>[src]

fn check_is_busy<T: 'static>(
    &self,
    callback: Callback<T>
) -> Option<Callback<T>>
[src]

Check whether GCWorker is busy. If busy, callback will be invoked with an error that indicates GCWorker is busy; otherwise, return a new callback that invokes the original callback as well as decrease the scheduled task counter.

pub fn gc(&self, safe_point: TimeStamp, callback: Callback<()>) -> Result<()>[src]

Only for tests.

pub fn unsafe_destroy_range(
    &self,
    ctx: Context,
    start_key: Key,
    end_key: Key,
    callback: Callback<()>
) -> Result<()>
[src]

Cleans up all keys in a range and quickly free the disk space. The range might span over multiple regions, and the ctx doesn’t indicate region. The request will be done directly on RocksDB, bypassing the Raft layer. User must promise that, after calling destroy_range, the range will never be accessed any more. However, destroy_range is allowed to be called multiple times on an single range.

pub fn get_config_manager(&self) -> GcWorkerConfigManager[src]

pub fn physical_scan_lock(
    &self,
    ctx: Context,
    max_ts: TimeStamp,
    start_key: Key,
    limit: usize,
    callback: Callback<Vec<LockInfo>>
) -> Result<()>
[src]

pub fn start_collecting(
    &self,
    max_ts: TimeStamp,
    callback: Box<dyn FnOnce(Result<()>) + Send>
) -> Result<()>
[src]

pub fn get_collected_locks(
    &self,
    max_ts: TimeStamp,
    callback: Box<dyn FnOnce(Result<(Vec<LockInfo>, bool)>) + Send>
) -> Result<()>
[src]

pub fn stop_collecting(
    &self,
    max_ts: TimeStamp,
    callback: Box<dyn FnOnce(Result<()>) + Send>
) -> Result<()>
[src]

Trait Implementations

impl<E, RR> Clone for GcWorker<E, RR> where
    E: Engine,
    RR: RaftStoreRouter<RocksEngine>, 
[src]

impl<E, RR> Drop for GcWorker<E, RR> where
    E: Engine,
    RR: RaftStoreRouter<RocksEngine> + 'static, 
[src]

Auto Trait Implementations

impl<E, RR> !RefUnwindSafe for GcWorker<E, RR>

impl<E, RR> Send for GcWorker<E, RR>

impl<E, RR> Sync for GcWorker<E, RR> where
    E: Sync,
    RR: Sync

impl<E, RR> Unpin for GcWorker<E, RR> where
    E: Unpin,
    RR: Unpin

impl<E, RR> !UnwindSafe for GcWorker<E, RR>

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]