From 62ddb01da56825b5b095753df6a06e2da2d6adeb Mon Sep 17 00:00:00 2001 From: Nikolai Golub Date: Wed, 8 May 2024 13:19:51 +0200 Subject: [PATCH] Public "get" for schema batch --- src/cache/change_set.rs | 5 +---- src/schema_batch.rs | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/cache/change_set.rs b/src/cache/change_set.rs index ee79363..9da375e 100644 --- a/src/cache/change_set.rs +++ b/src/cache/change_set.rs @@ -27,10 +27,7 @@ impl ChangeSet { /// Create new `ChangeSet pub fn new_with_operations(id: SnapshotId, operations: SchemaBatch) -> Self { - Self { - id, operations - } - + Self { id, operations } } /// Get value from its own cache diff --git a/src/schema_batch.rs b/src/schema_batch.rs index f47b716..0fca7d5 100644 --- a/src/schema_batch.rs +++ b/src/schema_batch.rs @@ -19,6 +19,7 @@ impl SchemaBatch { } /// Adds an insert/update operation to the batch. + // TODO: made this pub(crate) ??? pub fn put( &mut self, key: &impl KeyCodec, @@ -38,6 +39,7 @@ impl SchemaBatch { } /// Adds a delete operation to the batch. + // TODO: Make this pub(crate) pub fn delete(&mut self, key: &impl KeyCodec) -> anyhow::Result<()> { let key = key.encode_key()?; self.insert_operation::(key, Operation::Delete); @@ -50,10 +52,8 @@ impl SchemaBatch { column_writes.insert(key, operation); } - pub(crate) fn get( - &self, - key: &impl KeyCodec, - ) -> anyhow::Result> { + /// Getting the + pub fn get(&self, key: &impl KeyCodec) -> anyhow::Result> { let key = key.encode_key()?; if let Some(column_writes) = self.last_writes.get(&S::COLUMN_FAMILY_NAME) {