Struct tikv::server::gc_worker::GcWorker [−][src]
Used to schedule GC operations.
Fields
engine: E
raft_store_router: RR
raft_store_router
is useful to signal raftstore clean region size informations.
config_manager: GcWorkerConfigManager
scheduled_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][−]
E: Engine,
RR: RaftStoreRouter<RocksEngine>,
pub fn new(
engine: E,
raft_store_router: RR,
cfg: GcConfig,
feature_gate: FeatureGate
) -> GcWorker<E, RR>
[src]
engine: E,
raft_store_router: RR,
cfg: GcConfig,
feature_gate: FeatureGate
) -> GcWorker<E, RR>
pub fn start_auto_gc<S: GcSafePointProvider, R: RegionInfoProvider + Clone + 'static>(
&self,
cfg: AutoGcConfig<S, R>,
safe_point: Arc<AtomicU64>
) -> Result<()>
[src]
&self,
cfg: AutoGcConfig<S, R>,
safe_point: Arc<AtomicU64>
) -> Result<()>
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]
&mut self,
coprocessor_host: &mut CoprocessorHost<RocksEngine>,
concurrency_manager: ConcurrencyManager
) -> Result<()>
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][−]
&self,
callback: Callback<T>
) -> Option<Callback<T>>
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][−]
&self,
ctx: Context,
start_key: Key,
end_key: Key,
callback: Callback<()>
) -> Result<()>
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]
&self,
ctx: Context,
max_ts: TimeStamp,
start_key: Key,
limit: usize,
callback: Callback<Vec<LockInfo>>
) -> Result<()>
pub fn start_collecting(
&self,
max_ts: TimeStamp,
callback: Box<dyn FnOnce(Result<()>) + Send>
) -> Result<()>
[src]
&self,
max_ts: TimeStamp,
callback: Box<dyn FnOnce(Result<()>) + Send>
) -> Result<()>
pub fn get_collected_locks(
&self,
max_ts: TimeStamp,
callback: Box<dyn FnOnce(Result<(Vec<LockInfo>, bool)>) + Send>
) -> Result<()>
[src]
&self,
max_ts: TimeStamp,
callback: Box<dyn FnOnce(Result<(Vec<LockInfo>, bool)>) + Send>
) -> Result<()>
pub fn stop_collecting(
&self,
max_ts: TimeStamp,
callback: Box<dyn FnOnce(Result<()>) + Send>
) -> Result<()>
[src]
&self,
max_ts: TimeStamp,
callback: Box<dyn FnOnce(Result<()>) + Send>
) -> Result<()>
Trait Implementations
impl<E, RR> Clone for GcWorker<E, RR> where
E: Engine,
RR: RaftStoreRouter<RocksEngine>,
[src][+]
E: Engine,
RR: RaftStoreRouter<RocksEngine>,
impl<E, RR> Drop for GcWorker<E, RR> where
E: Engine,
RR: RaftStoreRouter<RocksEngine> + 'static,
[src][+]
E: Engine,
RR: RaftStoreRouter<RocksEngine> + 'static,
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,
E: Sync,
RR: Sync,
impl<E, RR> Unpin for GcWorker<E, RR> where
E: Unpin,
RR: Unpin,
E: Unpin,
RR: Unpin,
impl<E, RR> !UnwindSafe for GcWorker<E, RR>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src][+]
W: ConvertTo<V>,
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][+]
U: From<T>,
impl<T> Pointable for T
[src][+]
impl<T> Pointable for T
[src][+]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,