MCPcopy Create free account
hub / github.com/alibaba/proxima / LoadFromVecsFile

Function LoadFromVecsFile

tools/index_builder.cc:184–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184static bool LoadFromVecsFile(aitheta2::IndexThreads::TaskGroup *group,
185 index::Collection *collection) {
186 tools::VecsReader reader;
187 if (!reader.load(FLAGS_file)) {
188 LOG_ERROR("Load vecs file failed.");
189 return false;
190 }
191
192 for (uint32_t i = 0; i < reader.num_vecs(); i++) {
193 Record record;
194 uint64_t key = reader.get_key(i);
195 const char *feature = (const char *)reader.get_vector(i);
196
197 record.key = key;
198 record.vector.append(feature, reader.index_meta().element_size());
199 record.dimension = reader.index_meta().dimension();
200 group->submit(ailego::Closure::New(DoInsertCollection, collection, record));
201 }
202 return true;
203}
204
205static bool LoadFromTextFile(aitheta2::IndexThreads::TaskGroup *group,
206 index::Collection *collection) {

Callers 1

BuildIndexFunction · 0.70

Calls 8

num_vecsMethod · 0.80
get_keyMethod · 0.80
get_vectorMethod · 0.80
loadMethod · 0.45
appendMethod · 0.45
element_sizeMethod · 0.45
dimensionMethod · 0.45
submitMethod · 0.45

Tested by

no test coverage detected