| 93 | } |
| 94 | |
| 95 | int 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 | |
| 120 | int FlatSparseBuilder::dump(const IndexDumper::Pointer &dumper) { |
| 121 | if (state_ != BUILD_STATE_BUILT || !holder_) { |
nothing calls this directly
no test coverage detected