Struct raftstore::store::read_queue::ReadIndexQueue [−][src]
Fields
reads: VecDeque<ReadIndexRequest<S>>
ready_cnt: usize
handled_cnt: usize
contexts: HashMap<Uuid, usize>
retry_countdown: usize
Implementations
impl<S> ReadIndexQueue<S> where
S: Snapshot,
[src][−]
S: Snapshot,
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:
- more than an election timeout elapsed from the last request push;
- more than an election timeout elapsed from the last retry;
- 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]
T: IntoIterator<Item = (Uuid, Option<LockInfo>, u64)>,
pub fn advance_replica_reads<T>(&mut self, states: T) where
T: IntoIterator<Item = (Uuid, Option<LockInfo>, u64)>,
[src][−]
T: IntoIterator<Item = (Uuid, Option<LockInfo>, u64)>,
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][+]
S: Snapshot,
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][+]
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, 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>,