Struct raftstore::store::fsm::store::PollContext[][src]

pub struct PollContext<EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
{ pub processed_fsm_count: usize, pub cfg: Config, pub store: Store, pub pd_scheduler: FutureScheduler<PdTask<EK>>, pub consistency_check_scheduler: Scheduler<ConsistencyCheckTask<EK::Snapshot>>, pub split_check_scheduler: Scheduler<SplitCheckTask>, pub cleanup_scheduler: Scheduler<CleanupTask>, pub raftlog_gc_scheduler: Scheduler<RaftlogGcTask>, pub region_scheduler: Scheduler<RegionTask<EK::Snapshot>>, pub apply_router: ApplyRouter<EK>, pub router: RaftRouter<EK, ER>, pub importer: Arc<SSTImporter>, pub store_meta: Arc<Mutex<StoreMeta>>, pub feature_gate: FeatureGate, pub pending_create_peers: Arc<Mutex<HashMap<u64, (u64, bool)>>>, pub raft_metrics: RaftMetrics, pub snap_mgr: SnapManager, pub coprocessor_host: CoprocessorHost<EK>, pub timer: SteadyTimer, pub trans: T, pub global_replication_state: Arc<Mutex<GlobalReplicationState>>, pub global_stat: GlobalStoreStat, pub store_stat: LocalStoreStat, pub engines: Engines<EK, ER>, pub kv_wb: EK::WriteBatch, pub raft_wb: ER::LogBatch, pub pending_count: usize, pub sync_log: bool, pub has_ready: bool, pub ready_res: Vec<CollectedReady>, pub current_time: Option<Timespec>, pub perf_context: EK::PerfContext, pub tick_batch: Vec<PeerTickBatch>, pub node_start_time: Option<TiInstant>, }

Fields

processed_fsm_count: usize

The count of processed normal Fsm.

cfg: Configstore: Storepd_scheduler: FutureScheduler<PdTask<EK>>consistency_check_scheduler: Scheduler<ConsistencyCheckTask<EK::Snapshot>>split_check_scheduler: Scheduler<SplitCheckTask>cleanup_scheduler: Scheduler<CleanupTask>raftlog_gc_scheduler: Scheduler<RaftlogGcTask>region_scheduler: Scheduler<RegionTask<EK::Snapshot>>apply_router: ApplyRouter<EK>router: RaftRouter<EK, ER>importer: Arc<SSTImporter>store_meta: Arc<Mutex<StoreMeta>>feature_gate: FeatureGatepending_create_peers: Arc<Mutex<HashMap<u64, (u64, bool)>>>

region_id -> (peer_id, is_splitting) Used for handling race between splitting and creating new peer. An uninitialized peer can be replaced to the one from splitting iff they are exactly the same peer.

WARNING: To avoid deadlock, if you want to use store_meta and pending_create_peers together, the lock sequence MUST BE:

  1. lock the store_meta.
  2. lock the pending_create_peers.
raft_metrics: RaftMetricssnap_mgr: SnapManagercoprocessor_host: CoprocessorHost<EK>timer: SteadyTimertrans: Tglobal_replication_state: Arc<Mutex<GlobalReplicationState>>global_stat: GlobalStoreStatstore_stat: LocalStoreStatengines: Engines<EK, ER>kv_wb: EK::WriteBatchraft_wb: ER::LogBatchpending_count: usizesync_log: boolhas_ready: boolready_res: Vec<CollectedReady>current_time: Option<Timespec>perf_context: EK::PerfContexttick_batch: Vec<PeerTickBatch>node_start_time: Option<TiInstant>

Implementations

impl<EK, ER, T> PollContext<EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

pub fn store_id(&self) -> u64[src]

pub fn update_ticks_timeout(&mut self)[src]

impl<EK, ER, T: Transport> PollContext<EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

fn schedule_store_tick(&self, tick: StoreTick, timeout: Duration)[src]

pub fn handle_stale_msg(
    &mut self,
    msg: &RaftMessage,
    cur_epoch: RegionEpoch,
    need_gc: bool,
    target_region: Option<Region>
)
[src]

Trait Implementations

impl<EK, ER, T> HandleRaftReadyContext<<EK as WriteBatchExt>::WriteBatch, <ER as RaftEngine>::LogBatch> for PollContext<EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

impl<EK, ER, T> ReadExecutor<EK> for PollContext<EK, ER, T> where
    EK: KvEngine,
    ER: RaftEngine
[src]

Auto Trait Implementations

impl<EK, ER, T> !RefUnwindSafe for PollContext<EK, ER, T>

impl<EK, ER, T> Send for PollContext<EK, ER, T> where
    T: Send

impl<EK, ER, T> !Sync for PollContext<EK, ER, T>

impl<EK, ER, T> Unpin for PollContext<EK, ER, T> where
    ER: Unpin,
    T: Unpin,
    <ER as RaftEngine>::LogBatch: Unpin,
    <EK as PerfContextExt>::PerfContext: Unpin,
    <EK as WriteBatchExt>::WriteBatch: Unpin

impl<EK, ER, T> !UnwindSafe for PollContext<EK, ER, T>

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