pub trait LogStore:
Send
+ Sync
+ 'static
+ Debug {
type Error: ErrorExt + Send + Sync + 'static;
// Required methods
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn append_batch<'life0, 'async_trait>(
&'life0 self,
entries: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
id: EntryId,
index: Option<WalIndex>,
) -> Pin<Box<dyn Future<Output = Result<SendableEntryStream<'static, Entry, Self::Error>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_namespace<'life0, 'life1, 'async_trait>(
&'life0 self,
ns: &'life1 Provider,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_namespace<'life0, 'life1, 'async_trait>(
&'life0 self,
ns: &'life1 Provider,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_namespaces<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn obsolete<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
region_id: RegionId,
entry_id: EntryId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn obsolete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
region_id: RegionId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn entry(
&self,
data: Vec<u8>,
entry_id: EntryId,
region_id: RegionId,
provider: &Provider,
) -> Result<Entry, Self::Error>;
fn latest_entry_id(
&self,
provider: &Provider,
) -> Result<EntryId, Self::Error>;
}Expand description
LogStore serves as a Write-Ahead-Log for storage engine.
Required Associated Types§
Required Methods§
Sourcefn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stops components of the logstore.
Sourcefn append_batch<'life0, 'async_trait>(
&'life0 self,
entries: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_batch<'life0, 'async_trait>(
&'life0 self,
entries: Vec<Entry>,
) -> Pin<Box<dyn Future<Output = Result<AppendBatchResponse, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Appends a batch of entries and returns a response containing a map where the key is a region id while the value is the id of the last successfully written entry of the region.
Sourcefn read<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
id: EntryId,
index: Option<WalIndex>,
) -> Pin<Box<dyn Future<Output = Result<SendableEntryStream<'static, Entry, Self::Error>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
id: EntryId,
index: Option<WalIndex>,
) -> Pin<Box<dyn Future<Output = Result<SendableEntryStream<'static, Entry, Self::Error>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new EntryStream to asynchronously generates Entry with ids
starting from id.
Sourcefn create_namespace<'life0, 'life1, 'async_trait>(
&'life0 self,
ns: &'life1 Provider,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_namespace<'life0, 'life1, 'async_trait>(
&'life0 self,
ns: &'life1 Provider,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new Namespace from the given ref.
Sourcefn delete_namespace<'life0, 'life1, 'async_trait>(
&'life0 self,
ns: &'life1 Provider,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_namespace<'life0, 'life1, 'async_trait>(
&'life0 self,
ns: &'life1 Provider,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes an existing Namespace specified by the given ref.
Sourcefn list_namespaces<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_namespaces<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Provider>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists all existing namespaces.
Sourcefn obsolete<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
region_id: RegionId,
entry_id: EntryId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn obsolete<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
region_id: RegionId,
entry_id: EntryId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Marks all entries with ids <=entry_id of the given namespace as obsolete,
so that the log store can safely delete those entries. This method does not guarantee
that the obsolete entries are deleted immediately.
Sourcefn obsolete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
region_id: RegionId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn obsolete_all<'life0, 'life1, 'async_trait>(
&'life0 self,
provider: &'life1 Provider,
region_id: RegionId,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Marks all entries of a region as obsolete and removes its dedicated namespace when supported by the backend.