Skip to content

Commit

Permalink
[ENH] implement append, commit and flush for spann segment and index (#…
Browse files Browse the repository at this point in the history
…3084)

## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
	 - Implement append, commit and flush for spann segment and index. Current implementation does split and/or reassign. They will be followed up in the next PR.

## Test plan
*How are these changes tested?*
- [x] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust

## Documentation Changes
None
  • Loading branch information
sanketkedia authored Dec 4, 2024
1 parent 435f7d0 commit 0df312a
Show file tree
Hide file tree
Showing 7 changed files with 868 additions and 88 deletions.
17 changes: 17 additions & 0 deletions rust/blockstore/src/types/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ impl BlockfileWriter {
}
}

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

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

0 comments on commit 0df312a

Please sign in to comment.