feat: introduce snapshot manager#103
Conversation
fcb0d61 to
a54fdd8
Compare
|
|
||
| /// Get the latest snapshot, or None if LATEST does not exist. | ||
| /// Returns an error if LATEST exists but the snapshot file (snapshot-{id}) does not exist. | ||
| pub async fn get_latest_snapshot(&self) -> crate::Result<Option<Snapshot>> { |
There was a problem hiding this comment.
Suggest adding unit tests for get_latest_snapshot
There was a problem hiding this comment.
I was intending to add, but found it's not a simple work since it'll require write to tables. I think we can add when we support write to tables.
|
|
||
| /// Path to the snapshot directory (e.g. `table_path/snapshot`). | ||
| pub fn snapshot_dir(&self) -> String { | ||
| format!("{}/{}", self.table_path, SNAPSHOT_DIR) |
There was a problem hiding this comment.
Does this work well in Windows?
There was a problem hiding this comment.
I should(but i can't give a try) since rust's Path will handle the path across different operator systems. See
https://doc.rust-lang.org/std/path/struct.Path.html
This type supports a number of operations for inspecting a path, including breaking the path into its components (separated by / on Unix and by either / or \ on Windows), extracting the file name, determining whether the path is absolute, and so on.
|
+1 |
|
+1 |
Purpose
Linked issue: close #30
Brief change log
Tests
API and Format
Documentation