MCPcopy Create free account
hub / github.com/cosdata/cosdata / implicit_txn_upsert

Method implicit_txn_upsert

src/models/indexing_manager.rs:269–291  ·  view source on GitHub ↗
(
        collection: &Collection,
        transaction: &ImplicitTransaction,
        config: &Config,
        embeddings: Vec<RawVectorEmbedding>,
    )

Source from the content-addressed store, hash-verified

267 }
268
269 pub fn implicit_txn_upsert(
270 collection: &Collection,
271 transaction: &ImplicitTransaction,
272 config: &Config,
273 embeddings: Vec<RawVectorEmbedding>,
274 ) -> Result<(), WaCustomError> {
275 let version = transaction.version(collection)?;
276 transaction.append_to_wal(collection, VectorOp::Upsert(embeddings.clone()))?;
277 match config.indexing.mode {
278 VectorsIndexingMode::Sequential => {
279 collection.index_embeddings(embeddings, version, config)?;
280 }
281 VectorsIndexingMode::Batch { batch_size } => {
282 embeddings
283 .into_par_iter()
284 .chunks(batch_size)
285 .try_for_each(|embeddings| {
286 collection.index_embeddings(embeddings, version, config)
287 })?;
288 }
289 }
290 Ok(())
291 }
292
293 pub fn implicit_txn_delete(
294 collection: &Collection,

Callers

nothing calls this directly

Calls 4

versionMethod · 0.80
append_to_walMethod · 0.80
cloneMethod · 0.80
index_embeddingsMethod · 0.45

Tested by

no test coverage detected