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

Introducing DeltaReader #7

Merged
merged 32 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
667d026
Introduce struct `DeltaDb`
citizen-stig May 6, 2024
8275e7a
Move `PaginatedResponse` to lib
citizen-stig May 6, 2024
d532ef8
[no ci] Adding public methods
citizen-stig May 6, 2024
f3cfad8
[no ci] Add reading support
citizen-stig May 6, 2024
badca2b
[no ci] Start shaping iterator
citizen-stig May 6, 2024
cc393be
[no ci] Adding code for iterator without test
citizen-stig May 6, 2024
4eab32a
[no ci] This is why it won't work
citizen-stig May 6, 2024
3b9a387
Simplified version of CacheDb
citizen-stig May 14, 2024
facdc88
It compiles!
citizen-stig May 14, 2024
1a99491
Add simple test, that will be extended with proptest
citizen-stig May 30, 2024
9ed4dc0
Add proptest to new `DeltaReader`
citizen-stig May 30, 2024
50a0db0
Fix snapshots ordering, finally
citizen-stig May 30, 2024
3cb90b0
Get largest test and tests simplifications
citizen-stig May 30, 2024
c540613
More tests and more renaming
citizen-stig May 30, 2024
620d167
Get prev!
citizen-stig May 30, 2024
094d95c
Implement the rest without testing
citizen-stig May 30, 2024
1c3553f
Clean up
citizen-stig May 31, 2024
93daa26
Minor comments clean up
citizen-stig May 31, 2024
b3601b8
Add tests for get
citizen-stig May 31, 2024
47a351b
More test for empty delta reader
citizen-stig May 31, 2024
45518f6
More tests and use own type alias
citizen-stig May 31, 2024
84ea637
Update comments
citizen-stig May 31, 2024
431e5ec
We have a bug for range iterator!
citizen-stig May 31, 2024
9723136
Still bug, but with good formatting
citizen-stig May 31, 2024
44110fe
Bug with wrong range order has been fixed!
citizen-stig May 31, 2024
e6dcc68
More test for iterators
citizen-stig May 31, 2024
7e1e06e
Adding more tests for collect in range
citizen-stig May 31, 2024
f16c414
Start converting "simple tests" to prop
citizen-stig May 31, 2024
43265c7
Adding proptest for more iterator related things
citizen-stig May 31, 2024
f0e4498
Move `dead_code` to more granular place
citizen-stig May 31, 2024
8d55b3a
Move PaginatedResponse from lib to cache
citizen-stig Jun 4, 2024
a761d7f
Fix docs
citizen-stig Jun 4, 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
12 changes: 1 addition & 11 deletions src/cache/cache_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Mutex;

use crate::cache::cache_container::CacheContainer;
use crate::cache::change_set::ChangeSet;
use crate::cache::SnapshotId;
use crate::cache::{PaginatedResponse, SnapshotId};
use crate::iterator::ScanDirection;
use crate::schema::KeyDecoder;
use crate::{
Expand All @@ -19,16 +19,6 @@ pub struct CacheDb {
db: ReadOnlyLock<CacheContainer>,
}

/// Response for a paginated query which also includes the "next" key to pass
#[derive(Debug)]
pub struct PaginatedResponse<S: Schema> {
/// A vector of storage keys and their values
pub key_value: Vec<(S::Key, S::Value)>,
/// Key indicating the first key after the final pair from key_value.
/// Meant to be passed in in subsequent queries
pub next: Option<S::Key>,
}

impl CacheDb {
/// Create new [`CacheDb`] pointing to given [`CacheContainer`]
pub fn new(id: SnapshotId, cache_container: ReadOnlyLock<CacheContainer>) -> Self {
Expand Down
Loading
Loading