MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BatchCommit

Method BatchCommit

tensorflow/core/framework/embedding/leveldb_kv.h:127–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 Status BatchCommit(const std::vector<K>& keys,
128 const std::vector<void*>& value_ptrs) override {
129 WriteBatch batch;
130 for (int i = 0; i < keys.size(); i++) {
131 std::string value_res((char*)value_ptrs[i],
132 feat_desc_->data_bytes());
133 leveldb::Slice db_key((char*)(&keys[i]), sizeof(void*));
134 batch.Put(db_key, value_res);
135 delete value_ptrs[i];
136 }
137 db_->Write(WriteOptions(),&batch);
138 return Status::OK();
139 }
140
141 Status Commit(K key, const void* value_ptr) override {
142 std::string value_res((char*)value_ptr,

Callers 2

BatchEvictionMethod · 0.45
BatchEvictionMethod · 0.45

Calls 4

sizeMethod · 0.45
data_bytesMethod · 0.45
PutMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected