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

Method build

src/core/algorithm/flat_sparse/flat_sparse_builder.cc:95–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95int FlatSparseBuilder::build(IndexThreads::Pointer,
96 IndexSparseHolder::Pointer holder) {
97 LOG_INFO("Begin FlatSparseBuilder::build");
98
99 ailego::ElapsedTime stamp;
100 if (!holder) {
101 LOG_ERROR("Input holder is nullptr while building index");
102 return IndexError_InvalidArgument;
103 }
104
105 if (!holder->is_matched(meta_)) {
106 LOG_ERROR("Input holder doesn't match index meta while building index");
107 return IndexError_Mismatch;
108 }
109
110 holder_ = std::move(holder);
111
112 stats_.set_built_count(holder_->count());
113 stats_.set_built_costtime(stamp.milli_seconds());
114 state_ = BUILD_STATE_BUILT;
115
116 LOG_INFO("End FlatSparseBuilder::build");
117 return 0;
118}
119
120int FlatSparseBuilder::dump(const IndexDumper::Pointer &dumper) {
121 if (state_ != BUILD_STATE_BUILT || !holder_) {

Callers

nothing calls this directly

Calls 4

set_built_countMethod · 0.80
set_built_costtimeMethod · 0.80
is_matchedMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected