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,
fn default() -> ReadIndexQueue<S>
[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]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src]
W: ConvertTo<V>,
pub fn convert_from(ctx: &mut EvalContext, from: W) -> Result<V, Error>
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[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>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,