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

Method dump

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

Source from the content-addressed store, hash-verified

118}
119
120int FlatSparseBuilder::dump(const IndexDumper::Pointer &dumper) {
121 if (state_ != BUILD_STATE_BUILT || !holder_) {
122 LOG_INFO("Build the index before FlatSparseBuilder::dump");
123 return IndexError_NoReady;
124 }
125
126 LOG_INFO("Begin FlatSparseBuilder::dump");
127
128 auto start_time = ailego::Monotime::MilliSeconds();
129
130 int ret = IndexHelper::SerializeToDumper(meta_, dumper.get());
131 if (ret != 0) {
132 LOG_ERROR("Failed to serialize meta into dumper.");
133 return ret;
134 }
135
136 uint32_t dump_count;
137 ret = do_dump(dumper, &dump_count);
138 if (ret != 0) {
139 LOG_ERROR("Failed to dump index");
140 return ret;
141 }
142
143 holder_ = nullptr;
144 stats_.set_dumped_count(dump_count);
145 stats_.set_dumped_costtime(ailego::Monotime::MilliSeconds() - start_time);
146
147 LOG_INFO("End FlatSparseBuilder::dump");
148 return 0;
149}
150
151int FlatSparseBuilder::do_dump(const IndexDumper::Pointer &dumper,
152 uint32_t *dump_count) {

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
set_dumped_countMethod · 0.45
set_dumped_costtimeMethod · 0.45

Tested by

no test coverage detected