Struct raftstore::store::read_queue::ReadIndexQueue[][src]

pub struct ReadIndexQueue<S> where
    S: Snapshot
{ reads: VecDeque<ReadIndexRequest<S>>, ready_cnt: usize, handled_cnt: usize, contexts: HashMap<Uuid, usize>, retry_countdown: usize, }

Fields

reads: VecDeque<ReadIndexRequest<S>>ready_cnt: usizehandled_cnt: usizecontexts: HashMap<Uuid, usize>retry_countdown: usize

Implementations

impl<S> ReadIndexQueue<S> where
    S: Snapshot
[src]

pub fn check_needs_retry(&mut self, cfg: &Config) -> bool[src]

Check it’s necessary to retry pending read requests or not. Return true if all such conditions are satisfied:

  1. more than an election timeout elapsed from the last request push;
  2. more than an election timeout elapsed from the last retry;
  3. there are still unresolved requests in the queue.

pub fn has_unresolved(&self) -> bool[src]

pub fn clear_all(&mut self, notify_removed: Option<u64>)[src]

Clear all commands in the queue. if notify_removed contains an region_id, notify the request’s callback that the region is removed.

pub fn clear_uncommitted_on_role_change(&mut self, term: u64)[src]

pub fn push_back(&mut self, read: ReadIndexRequest<S>, is_leader: bool)[src]

pub fn back_mut(&mut self) -> Option<&mut ReadIndexRequest<S>>[src]

pub fn last_ready(&self) -> Option<&ReadIndexRequest<S>>[src]

pub fn advance_leader_reads<T>(&mut self, states: T) where
    T: IntoIterator<Item = (Uuid, Option<LockInfo>, u64)>, 
[src]

pub fn advance_replica_reads<T>(&mut self, states: T) where
    T: IntoIterator<Item = (Uuid, Option<LockInfo>, u64)>, 
[src]

update the read index of the requests that before the specified id.

pub fn fold(&mut self, min_changed_offset: usize, max_changed_offset: usize)[src]

pub fn gc(&mut self)[src]

pub fn pop_front(&mut self) -> Option<ReadIndexRequest<S>>[src]

pub fn push_front(&mut self, read: ReadIndexRequest<S>)[src]

Raft could have not been ready to handle the poped task. So put it back into the queue.

Trait Implementations

impl<S> Default for ReadIndexQueue<S> where
    S: Snapshot
[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for ReadIndexQueue<S>

impl<S> Send for ReadIndexQueue<S>

impl<S> !Sync for ReadIndexQueue<S>

impl<S> Unpin for ReadIndexQueue<S>

impl<S> !UnwindSafe for ReadIndexQueue<S>

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]