| 76 | } |
| 77 | |
| 78 | void |
| 79 | IndexNode::Build(ODescent& odescent) { |
| 80 | std::unique_lock lock(mutex_); |
| 81 | // Build an index when the level corresponding to the current node requires indexing |
| 82 | if (not ids_.empty()) { |
| 83 | Init(); |
| 84 | } |
| 85 | if (status_ == Status::GRAPH) { |
| 86 | entry_point_ = ids_[0]; |
| 87 | odescent.SetMaxDegree(static_cast<int32_t>(graph_param_->max_degree_)); |
| 88 | odescent.Build(ids_); |
| 89 | odescent.SaveGraph(graph_); |
| 90 | Vector<InnerIdType>(allocator_).swap(ids_); |
| 91 | } |
| 92 | for (const auto& item : children_) { |
| 93 | item.second->Build(odescent); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | void |
| 98 | IndexNode::AddChild(const std::string& key) { |
no test coverage detected