pub struct AstraLogStore { /* private fields */ }Implementations§
Source§impl AstraLogStore
impl AstraLogStore
pub async fn open( data_dir: &Path, cfg: WalBatchConfig, ) -> Result<Self, StorageError<u64>>
pub async fn wal_queue_snapshot(&self) -> (usize, usize)
Trait Implementations§
Source§impl RaftLogReader<AstraTypeConfig> for AstraLogStore
impl RaftLogReader<AstraTypeConfig> for AstraLogStore
Source§async fn try_get_log_entries<RB: RangeBounds<u64> + Clone + Debug + OptionalSend>(
&mut self,
range: RB,
) -> Result<Vec<Entry<AstraTypeConfig>>, StorageError<u64>>
async fn try_get_log_entries<RB: RangeBounds<u64> + Clone + Debug + OptionalSend>( &mut self, range: RB, ) -> Result<Vec<Entry<AstraTypeConfig>>, StorageError<u64>>
Get a series of log entries from storage. Read more
Source§fn limited_get_log_entries(
&mut self,
start: u64,
end: u64,
) -> impl Future<Output = Result<Vec<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
fn limited_get_log_entries( &mut self, start: u64, end: u64, ) -> impl Future<Output = Result<Vec<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
Returns log entries within range
[start, end), end is exclusive,
potentially limited by implementation-defined constraints. Read moreSource§impl RaftLogStorage<AstraTypeConfig> for AstraLogStore
impl RaftLogStorage<AstraTypeConfig> for AstraLogStore
Source§type LogReader = AstraLogReader
type LogReader = AstraLogReader
Log reader type. Read more
Source§async fn get_log_state(
&mut self,
) -> Result<LogState<AstraTypeConfig>, StorageError<u64>>
async fn get_log_state( &mut self, ) -> Result<LogState<AstraTypeConfig>, StorageError<u64>>
Returns the last deleted log id and the last log id. Read more
Source§async fn get_log_reader(&mut self) -> Self::LogReader
async fn get_log_reader(&mut self) -> Self::LogReader
Get the log reader. Read more
Source§async fn save_vote(&mut self, vote: &Vote<u64>) -> Result<(), StorageError<u64>>
async fn save_vote(&mut self, vote: &Vote<u64>) -> Result<(), StorageError<u64>>
Save vote to storage. Read more
Source§async fn read_vote(&mut self) -> Result<Option<Vote<u64>>, StorageError<u64>>
async fn read_vote(&mut self) -> Result<Option<Vote<u64>>, StorageError<u64>>
Return the last saved vote by
Self::save_vote.Source§async fn save_committed(
&mut self,
committed: Option<LogId<u64>>,
) -> Result<(), StorageError<u64>>
async fn save_committed( &mut self, committed: Option<LogId<u64>>, ) -> Result<(), StorageError<u64>>
Saves the last committed log id to storage. Read more
Source§async fn read_committed(
&mut self,
) -> Result<Option<LogId<u64>>, StorageError<u64>>
async fn read_committed( &mut self, ) -> Result<Option<LogId<u64>>, StorageError<u64>>
Return the last saved committed log id by
Self::save_committed.Source§async fn append<I>(
&mut self,
entries: I,
callback: LogFlushed<AstraTypeConfig>,
) -> Result<(), StorageError<u64>>
async fn append<I>( &mut self, entries: I, callback: LogFlushed<AstraTypeConfig>, ) -> Result<(), StorageError<u64>>
Append log entries and call the
callback once logs are persisted on disk. Read moreAuto Trait Implementations§
impl Freeze for AstraLogStore
impl !RefUnwindSafe for AstraLogStore
impl Send for AstraLogStore
impl Sync for AstraLogStore
impl Unpin for AstraLogStore
impl UnsafeUnpin for AstraLogStore
impl !UnwindSafe for AstraLogStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.
Source§impl<C, LR> RaftLogReaderExt<C> for LRwhere
C: RaftTypeConfig,
LR: RaftLogReader<C>,
impl<C, LR> RaftLogReaderExt<C> for LRwhere
C: RaftTypeConfig,
LR: RaftLogReader<C>,
Source§fn try_get_log_entry(
&mut self,
log_index: u64,
) -> impl Future<Output = Result<Option<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
fn try_get_log_entry( &mut self, log_index: u64, ) -> impl Future<Output = Result<Option<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
Try to get an log entry. Read more
Source§fn get_log_entries<RB>(
&mut self,
range: RB,
) -> impl Future<Output = Result<Vec<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
fn get_log_entries<RB>( &mut self, range: RB, ) -> impl Future<Output = Result<Vec<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
Get a series of log entries from storage. Read more
Source§fn get_log_id(
&mut self,
log_index: u64,
) -> impl Future<Output = Result<LogId<<C as RaftTypeConfig>::NodeId>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
fn get_log_id( &mut self, log_index: u64, ) -> impl Future<Output = Result<LogId<<C as RaftTypeConfig>::NodeId>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
Get the log id of the entry at
index.Source§impl<C, T> RaftLogStorageExt<C> for Twhere
T: RaftLogStorage<C>,
C: RaftTypeConfig,
impl<C, T> RaftLogStorageExt<C> for Twhere
T: RaftLogStorage<C>,
C: RaftTypeConfig,
Source§fn blocking_append<I>(
&mut self,
entries: I,
) -> impl Future<Output = Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>> + Sendwhere
I: IntoIterator<Item = <C as RaftTypeConfig>::Entry> + OptionalSend,
<I as IntoIterator>::IntoIter: OptionalSend,
fn blocking_append<I>(
&mut self,
entries: I,
) -> impl Future<Output = Result<(), StorageError<<C as RaftTypeConfig>::NodeId>>> + Sendwhere
I: IntoIterator<Item = <C as RaftTypeConfig>::Entry> + OptionalSend,
<I as IntoIterator>::IntoIter: OptionalSend,
Blocking mode append log entries to the storage. Read more