MCPcopy Create free account
hub / github.com/alibaba/zvec / LoadIndex

Function LoadIndex

tests/core/algorithm/flat/flat_builder_test.cc:444–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444static void LoadIndex(const std::string &path,
445 IndexSearcher::Pointer &searcher) {
446 searcher = IndexFactory::CreateSearcher("FlatSearcher");
447 auto storage = IndexFactory::CreateStorage("MMapFileReadStorage");
448 ASSERT_NE(nullptr, searcher);
449 ASSERT_NE(nullptr, storage);
450
451 Params params;
452 ASSERT_EQ(0, searcher->init(params));
453 ASSERT_EQ(0, storage->open(path, false));
454 ASSERT_EQ(0, searcher->load(storage, IndexMetric::Pointer()));
455}
456
457namespace {
458class ThresholdContext : public IndexContext {

Callers 1

TEST_FFunction · 0.70

Calls 3

initMethod · 0.45
openMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected