krishvishal commented on code in PR #2916:
URL: https://github.com/apache/iggy/pull/2916#discussion_r2989725374
##########
core/journal/src/lib.rs:
##########
@@ -30,19 +34,45 @@ where
fn header(&self, idx: usize) -> Option<Self::HeaderRef<'_>>;
fn previous_header(&self, header: &Self::Header) ->
Option<Self::HeaderRef<'_>>;
- fn append(&self, entry: Self::Entry) -> impl Future<Output = ()>;
+ fn append(&self, entry: Self::Entry) -> impl Future<Output =
io::Result<()>>;
fn entry(&self, header: &Self::Header) -> impl Future<Output =
Option<Self::Entry>>;
+
+ /// Number of entries that can be appended before the journal would need
+ /// to evict un-snapshotted slots. Returns `None` for journals that don't
persist to disk.
+ fn remaining_capacity(&self) -> Option<usize> {
+ None
+ }
+
+ /// Remove entries with ops in `[start_op, end_op]` from the journal,
+ /// returning the removed entries sorted by op.
+ ///
+ /// Implementations that persist to disk should rewrite the underlying
+ /// storage to reclaim space. The default is a no-op for journals that
+ /// do not persist to disk.
+ ///
+ /// # Errors
+ /// Returns an I/O error if the drain fails.
+ fn drain(
+ &self,
+ _start_op: u64,
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]