Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge development updates #26

Merged
merged 32 commits into from
May 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
434d3bf
chore: remove redundant doc links
arindas Dec 24, 2023
e3061d5
doc: adds documentation for top-level modules under crate::storage
arindas Dec 24, 2023
99d7e22
doc: adds documentation for the commit-log module
arindas Dec 29, 2023
3cdae60
doc: adds documentation for the index module
arindas Jan 13, 2024
0d2f3fb
style: rewrites SegmentedLog::new to reduce Segment::new calls
arindas Feb 7, 2024
0af1217
chore: updates generational-cache dep version
arindas Feb 7, 2024
ed3faf2
chore: updates generational-cache dep version
arindas Feb 8, 2024
0084f4a
style: conforms common::split module structure to follow repository s…
arindas Feb 8, 2024
1d994b2
doc: adds documentation for Index struct
arindas Feb 8, 2024
b1de935
doc: updates README and Index documentation
arindas Feb 9, 2024
b70ba84
doc: documents segmented_log::MetaWithIdx
arindas Feb 26, 2024
f95fb55
chore: adds documentation for SegmentedLogError
arindas Feb 27, 2024
95732bd
style: remove redundant unit return from unit closure
arindas Feb 27, 2024
ff8b4d8
doc: adds documentation for the SegmentedLog struct
arindas Feb 27, 2024
78f038e
doc: adds an example for SegmentedLog
arindas Feb 27, 2024
52d2ee4
doc: documents SegmentedLog::new
arindas Feb 28, 2024
a9e2017
doc: adds documentation for convenience macros
arindas Feb 28, 2024
61b83ef
doc: adds documentation for various read() APIs
arindas Feb 28, 2024
0d452c2
chore: corrects typo
arindas Feb 28, 2024
47f92d6
style: refactor CacheOp and CacheOpKind to single sum type SegmentInd…
arindas Mar 2, 2024
9bfbea3
doc: adds documentation for stream_* and seq_read APIs
arindas Mar 2, 2024
c3d2e13
chore: fix typos
arindas Mar 6, 2024
3c4d0ba
doc: documents remaining methods for SegmentedLog
arindas Mar 6, 2024
a139f28
doc: adds documentation for IndexError and Index::* functions
arindas Mar 16, 2024
89e863c
doc: adds missing documenatation for Index::* functions
arindas May 1, 2024
ec7874f
doc: documents RecordHeader and Store in segmented_log::store
arindas May 24, 2024
09f67d2
doc: documents store::StoreError
arindas May 24, 2024
e4900cd
doc: documents segmented_log::segment::Segment
arindas May 24, 2024
c16dbe1
chore: update crate version
arindas May 24, 2024
d363e69
chore: update examples path in README
arindas May 24, 2024
32dadc3
Merge pull request #25 from arindas/docs/0.0.5
arindas May 24, 2024
828864f
Merge branch 'main' into develop
arindas May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: documents remaining methods for SegmentedLog
Documents append_record_with_contiguous_bytes, remove_expired_segments, rotate_new_write_segment and flush
  • Loading branch information
arindas committed Mar 6, 2024
commit 3c4d0baad3b5fc5b969e4574d5b3acab08bc675b
18 changes: 18 additions & 0 deletions src/storage/commit_log/segmented_log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,16 @@ where
C: Cache<usize, ()>,
C::Error: Debug,
{
/// Rotates the current _write_ [`Segment`] to a _read_ [`Segment`], creating a new _write_
/// [`Segment`] in its place.
///
/// Closes the current _write_ [`Segment`], reopens it as a new _read_ [`Segment`] and appends
/// it the the collection of _read_ [`Segment`] instances. Next, a new _write_ [`Segment`] is
/// created for this [`SegmentedLog`] with it's `base_index` set to the `highest_index` of the
/// previous _write_ [`Segment`].
///
/// This operations is used when the _write_ [`Segment`] exceeds the confiured [`Segment`]
/// storage size limit and needs to be rotated.
pub async fn rotate_new_write_segment(&mut self) -> Result<(), LogError<S, SERP, C>> {
self.flush().await?;

Expand All @@ -1021,6 +1031,7 @@ where
Ok(())
}

/// Flushes all writes in the current _write_ [`Segment`] to persistent [`Storage`].
pub async fn flush(&mut self) -> Result<(), LogError<S, SERP, C>> {
let write_segment = take_write_segment!(self)?;

Expand All @@ -1034,6 +1045,10 @@ where
Ok(())
}

/// Removes all [`Segment`] instances that are older than the given `expiry_duration`.
///
/// Returns the total number of [`Record`] instances removed from removing the [`Segment`]
/// instances.
pub async fn remove_expired_segments(
&mut self,
expiry_duration: Duration,
Expand Down Expand Up @@ -1095,6 +1110,9 @@ where
C: Cache<usize, ()>,
C::Error: Debug,
{
/// Appends a new [`Record`] containing value bytes laid out in a contiguous fashion.
///
/// Returns the index of the newly appended [`Record`].
pub async fn append_record_with_contiguous_bytes<X>(
&mut self,
record: &Record<M, Idx, X>,
Expand Down
Loading