Skip to content

Commit

Permalink
Implement append
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketkedia committed Nov 9, 2024
1 parent 2b3388f commit f7b4553
Show file tree
Hide file tree
Showing 8 changed files with 325 additions and 34 deletions.
2 changes: 1 addition & 1 deletion rust/blockstore/src/arrow/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub trait ArrowWriteableKey: Key + Default {
) -> BlockKeyArrowBuilder;
}

pub(crate) trait ArrowWriteableValue: Value {
pub trait ArrowWriteableValue: Value {
type ReadableValue<'referred_data>: ArrowReadableValue<'referred_data>;
type OwnedReadableValue;

Expand Down
16 changes: 16 additions & 0 deletions rust/blockstore/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,22 @@ impl BlockfileWriter {
}
}

pub async fn get_clone<
K: Key + Into<KeyWrapper> + ArrowWriteableKey,
V: Value + Writeable + ArrowWriteableValue,
>(
&self,
prefix: &str,
key: K,
) -> Result<Option<V::OwnedReadableValue>, Box<dyn ChromaError>> {
match self {
BlockfileWriter::MemoryBlockfileWriter(_) => todo!(),
BlockfileWriter::ArrowBlockfileWriter(writer) => {
writer.get_clone::<K, V>(prefix, key).await
}
}
}

pub fn id(&self) -> uuid::Uuid {
match self {
BlockfileWriter::MemoryBlockfileWriter(writer) => writer.id(),
Expand Down
Loading

0 comments on commit f7b4553

Please sign in to comment.