Struct tikv::server::node::Node[][src]

pub struct Node<C: PdClient + 'static, ER: RaftEngine> {
    cluster_id: u64,
    store: Store,
    store_cfg: Arc<VersionTrack<StoreConfig>>,
    system: RaftBatchSystem<RocksEngine, ER>,
    has_started: bool,
    pd_client: Arc<C>,
    state: Arc<Mutex<GlobalReplicationState>>,
    bg_worker: Worker,
}

A wrapper for the raftstore which runs Multi-Raft.

Fields

cluster_id: u64store: Storestore_cfg: Arc<VersionTrack<StoreConfig>>system: RaftBatchSystem<RocksEngine, ER>has_started: boolpd_client: Arc<C>state: Arc<Mutex<GlobalReplicationState>>bg_worker: Worker

Implementations

impl<C, ER> Node<C, ER> where
    C: PdClient,
    ER: RaftEngine
[src]

pub fn new(
    system: RaftBatchSystem<RocksEngine, ER>,
    cfg: &ServerConfig,
    store_cfg: Arc<VersionTrack<StoreConfig>>,
    pd_client: Arc<C>,
    state: Arc<Mutex<GlobalReplicationState>>,
    bg_worker: Worker
) -> Node<C, ER>
[src]

Creates a new Node.

pub fn try_bootstrap_store(
    &mut self,
    engines: Engines<RocksEngine, ER>
) -> Result<()>
[src]

pub fn start<T>(
    &mut self,
    engines: Engines<RocksEngine, ER>,
    trans: T,
    snap_mgr: SnapManager,
    pd_worker: FutureWorker<PdTask<RocksEngine>>,
    store_meta: Arc<Mutex<StoreMeta>>,
    coprocessor_host: CoprocessorHost<RocksEngine>,
    importer: Arc<SSTImporter>,
    split_check_scheduler: Scheduler<SplitCheckTask>,
    auto_split_controller: AutoSplitController,
    concurrency_manager: ConcurrencyManager
) -> Result<()> where
    T: Transport + 'static, 
[src]

Starts the Node. It tries to bootstrap cluster if the cluster is not bootstrapped yet. Then it spawns a thread to run the raftstore in background.

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

Gets the store id.

pub fn get_router(&self) -> RaftRouter<RocksEngine, ER>[src]

Gets a transmission end of a channel which is used to send Msg to the raftstore.

pub fn get_apply_router(&self) -> ApplyRouter<RocksEngine>[src]

Gets a transmission end of a channel which is used send messages to apply worker.

fn check_store(&self, engines: &Engines<RocksEngine, ER>) -> Result<u64>[src]

fn alloc_id(&self) -> Result<u64>[src]

fn load_all_stores(&mut self, status: Option<ReplicationStatus>)[src]

fn check_or_prepare_bootstrap_cluster(
    &self,
    engines: &Engines<RocksEngine, ER>,
    store_id: u64
) -> Result<Option<Region>>
[src]

fn bootstrap_cluster(
    &mut self,
    engines: &Engines<RocksEngine, ER>,
    first_region: Region
) -> Result<()>
[src]

fn check_cluster_bootstrapped(&self) -> Result<bool>[src]

fn start_store<T>(
    &mut self,
    store_id: u64,
    engines: Engines<RocksEngine, ER>,
    trans: T,
    snap_mgr: SnapManager,
    pd_worker: FutureWorker<PdTask<RocksEngine>>,
    store_meta: Arc<Mutex<StoreMeta>>,
    coprocessor_host: CoprocessorHost<RocksEngine>,
    importer: Arc<SSTImporter>,
    split_check_scheduler: Scheduler<SplitCheckTask>,
    auto_split_controller: AutoSplitController,
    concurrency_manager: ConcurrencyManager
) -> Result<()> where
    T: Transport + 'static, 
[src]

fn stop_store(&mut self, store_id: u64)[src]

pub fn stop(&mut self)[src]

Stops the Node.

Auto Trait Implementations

impl<C, ER> !RefUnwindSafe for Node<C, ER>

impl<C, ER> Send for Node<C, ER>

impl<C, ER> !Sync for Node<C, ER>

impl<C, ER> Unpin for Node<C, ER>

impl<C, ER> !UnwindSafe for Node<C, ER>

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]