Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Dec 23, 2024
1 parent a89bf4c commit 000fa08
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 43 deletions.
10 changes: 0 additions & 10 deletions src/abstract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,16 +566,6 @@ pub trait AbstractTree {
seqno: SeqNo,
) -> (u32, u32);

/// Inserts a key-value pair.
fn raw_insert_with_lock<K: Into<UserKey>, V: Into<UserValue>>(
&self,
lock: &RwLockWriteGuard<'_, Memtable>,
key: K,
value: V,
seqno: SeqNo,
r#type: ValueType,
) -> (u32, u32);

/// Removes an item from the tree.
///
/// Returns the added item's size and new size of the memtable.
Expand Down
21 changes: 0 additions & 21 deletions src/blob_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,27 +596,6 @@ impl AbstractTree for BlobTree {
)
}

fn raw_insert_with_lock<K: Into<UserKey>, V: Into<UserValue>>(
&self,
lock: &RwLockWriteGuard<'_, Memtable>,
key: K,
value: V,
seqno: SeqNo,
r#type: ValueType,
) -> (u32, u32) {
use value::MaybeInlineValue;

// NOTE: Initially, we always write an inline value
// On memtable flush, depending on the values' sizes, they will be separated
// into inline or indirect values
let item = MaybeInlineValue::Inline(value.into());

let value = item.encode_into_vec();

let value = InternalValue::from_components(key, value, seqno, r#type);
lock.insert(value)
}

fn insert<K: Into<UserKey>, V: Into<UserValue>>(
&self,
key: K,
Expand Down
12 changes: 0 additions & 12 deletions src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,18 +412,6 @@ impl AbstractTree for Tree {
self.append_entry(value)
}

fn raw_insert_with_lock<K: Into<UserKey>, V: Into<UserValue>>(
&self,
lock: &RwLockWriteGuard<'_, Memtable>,
key: K,
value: V,
seqno: SeqNo,
r#type: ValueType,
) -> (u32, u32) {
let value = InternalValue::from_components(key, value, seqno, r#type);
lock.insert(value)
}

fn remove<K: Into<UserKey>>(&self, key: K, seqno: SeqNo) -> (u32, u32) {
let value = InternalValue::new_tombstone(key, seqno);
self.append_entry(value)
Expand Down

0 comments on commit 000fa08

Please sign in to comment.