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

Method dump

src/core/algorithm/flat/flat_builder.cc:125–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124template <size_t BATCH_SIZE>
125int FlatBuilder<BATCH_SIZE>::dump(const IndexDumper::Pointer &dumper) {
126 ailego::ElapsedTime stamp;
127 if (!holder_) {
128 return IndexError_NoReady;
129 }
130
131 std::vector<uint64_t> keys;
132 if (meta_.major_order() == IndexMeta::MO_COLUMN) {
133 int error_code = this->write_column_index(dumper.get(), &keys);
134 if (error_code != 0) {
135 return error_code;
136 }
137 } else {
138 int error_code = this->write_row_index(dumper.get(), &keys);
139 if (error_code != 0) {
140 return error_code;
141 }
142 }
143
144 int error_code = this->write_keys(keys, dumper.get());
145 if (error_code != 0) {
146 return error_code;
147 }
148
149 error_code = this->write_mapping(keys, dumper.get());
150 if (error_code != 0) {
151 return error_code;
152 }
153
154 error_code = IndexHelper::SerializeToDumper(meta_, dumper.get());
155 if (error_code != 0) {
156 return error_code;
157 }
158
159 stats_.set_dumped_count(keys.size());
160 stats_.set_dumped_costtime(stamp.milli_seconds());
161 return 0;
162}
163
164template <size_t BATCH_SIZE>
165int FlatBuilder<BATCH_SIZE>::write_keys(const std::vector<uint64_t> &keys,

Callers

nothing calls this directly

Calls 9

write_column_indexMethod · 0.95
write_row_indexMethod · 0.95
write_keysMethod · 0.95
write_mappingMethod · 0.95
major_orderMethod · 0.45
getMethod · 0.45
set_dumped_countMethod · 0.45
sizeMethod · 0.45
set_dumped_costtimeMethod · 0.45

Tested by

no test coverage detected