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

pub struct StoreMeta {
    pub store_id: Option<u64>,
    pub region_ranges: BTreeMap<Vec<u8>, u64>,
    pub regions: HashMap<u64, Region>,
    pub readers: HashMap<u64, ReadDelegate>,
    pub leaders: HashMap<u64, (u64, u64)>,
    pub pending_msgs: RingQueue<RaftMessage>,
    pub pending_snapshot_regions: Vec<Region>,
    pub pending_merge_targets: HashMap<u64, HashMap<u64, Region>>,
    pub targets_map: HashMap<u64, u64>,
    pub atomic_snap_regions: HashMap<u64, HashMap<u64, bool>>,
    pub destroyed_region_for_snap: HashMap<u64, bool>,
    pub region_read_progress: HashMap<u64, Arc<RegionReadProgress>>,
}

Fields

store_id: Option<u64>

store id

region_ranges: BTreeMap<Vec<u8>, u64>

region_end_key -> region_id

regions: HashMap<u64, Region>

region_id -> region

readers: HashMap<u64, ReadDelegate>

region_id -> reader

leaders: HashMap<u64, (u64, u64)>

region_id -> (term, leader_peer_id)

pending_msgs: RingQueue<RaftMessage>

MsgRequestPreVote, MsgRequestVote or MsgAppend messages from newly split Regions shouldn’t be dropped if there is no such Region in this store now. So the messages are recorded temporarily and will be handled later.

pending_snapshot_regions: Vec<Region>

The regions with pending snapshots.

pending_merge_targets: HashMap<u64, HashMap<u64, Region>>

A marker used to indicate the peer of a Region has received a merge target message and waits to be destroyed. target_region_id -> (source_region_id -> merge_target_region)

targets_map: HashMap<u64, u64>

An inverse mapping of pending_merge_targets used to let source peer help target peer to clean up related entry. source_region_id -> target_region_id

atomic_snap_regions: HashMap<u64, HashMap<u64, bool>>

atomic_snap_regions and destroyed_region_for_snap are used for making destroy overlapped regions and apply snapshot atomically. region_id -> wait_destroy_regions_map(source_region_id -> is_ready) A target peer must wait for all source peer to ready before applying snapshot.

destroyed_region_for_snap: HashMap<u64, bool>

source_region_id -> need_atomic Used for reminding the source peer to switch to ready in atomic_snap_regions.

region_read_progress: HashMap<u64, Arc<RegionReadProgress>>

Implementations

impl StoreMeta[src]

pub fn new(vote_capacity: usize) -> StoreMeta[src]

pub fn set_region<EK: KvEngine, ER: RaftEngine>(
    &mut self,
    host: &CoprocessorHost<EK>,
    region: Region,
    peer: &mut Peer<EK, ER>
)
[src]

Auto Trait Implementations

impl RefUnwindSafe for StoreMeta

impl Send for StoreMeta

impl Sync for StoreMeta

impl Unpin for StoreMeta

impl UnwindSafe for StoreMeta

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> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?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]