diff --git a/rust/worker/src/segment/mod.rs b/rust/worker/src/segment/mod.rs index 5b56f40422f..14237847e29 100644 --- a/rust/worker/src/segment/mod.rs +++ b/rust/worker/src/segment/mod.rs @@ -2,6 +2,7 @@ pub(crate) mod config; mod distributed_hnsw_segment; mod segment_ingestor; mod segment_manager; +mod types; pub(crate) use segment_ingestor::*; pub(crate) use segment_manager::*; diff --git a/rust/worker/src/segment/types.rs b/rust/worker/src/segment/types.rs new file mode 100644 index 00000000000..27fae95d6c7 --- /dev/null +++ b/rust/worker/src/segment/types.rs @@ -0,0 +1,12 @@ +use crate::types::EmbeddingRecord; + +trait SegmentWriter { + fn begin_transaction(&self); + fn write_records(&self, records: Vec>, offset_ids: Vec); + fn commit_transaction(&self); + fn rollback_transaction(&self); +} + +trait OffsetIdAssigner: SegmentWriter { + fn assign_offset_ids(&self, records: Vec>) -> Vec; +}