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

Method pre_commit

src/models/collection_transaction.rs:42–60  ·  view source on GitHub ↗
(self, collection: &Collection, config: &Config)

Source from the content-addressed store, hash-verified

40 }
41
42 pub fn pre_commit(self, collection: &Collection, config: &Config) -> Result<(), WaCustomError> {
43 if let Some(hnsw_index) = &*collection.hnsw_index.read() {
44 hnsw_index.pre_commit_transaction(collection, self.version, config)?;
45 }
46 if let Some(inverted_index) = &*collection.inverted_index.read() {
47 inverted_index.pre_commit_transaction(collection, self.version, config)?;
48 }
49 if let Some(tf_idf_index) = &*collection.tf_idf_index.read() {
50 tf_idf_index.pre_commit_transaction(collection, self.version, config)?;
51 }
52 if let Some(key_value_index) = &*collection.key_value_index.read() {
53 key_value_index.pre_commit_transaction(collection, self.version, config)?;
54 }
55 if let Some(usv_index) = &*collection.usv_index.read() {
56 usv_index.pre_commit_transaction(collection, self.version, config)?;
57 }
58 collection.flush()?;
59 Ok(())
60 }
61}
62
63#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

Callers 6

commit_transactionFunction · 0.80
newMethod · 0.80
index_explicit_txnMethod · 0.80
index_implicit_txnMethod · 0.80
newMethod · 0.80

Calls 9

get_pathMethod · 0.80
readMethod · 0.45
flushMethod · 0.45
records_upsertedMethod · 0.45
records_deletedMethod · 0.45
total_operationsMethod · 0.45

Tested by

no test coverage detected