MCPcopy Create free account
hub / github.com/alibaba/graph-learn / BuildLocalCount

Method BuildLocalCount

graphlearn/src/core/graph/graph_store.cc:305–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305void GraphStore::BuildLocalCount() {
306 local_count_.reserve(e_types_.size() + n_types_.size());
307 for (auto it = e_types_.begin(); it != e_types_.end(); ++it) {
308 Graph* graph = graphs_->LookupOrCreate(it->first);
309 ::graphlearn::io::GraphStorage* storage = graph->GetLocalStorage();
310 local_count_.push_back(storage->GetEdgeCount() * it->second);
311 }
312 for (auto it = n_types_.begin(); it != n_types_.end(); ++it) {
313 Noder* noder = noders_->LookupOrCreate(it->first);
314 ::graphlearn::io::NodeStorage* storage = noder->GetLocalStorage();
315 local_count_.push_back(storage->GetIds().Size() * it->second);
316 }
317}
318
319Graph* GraphStore::GetGraph(const std::string& edge_type) {
320 return graphs_->LookupOrCreate(edge_type);

Callers

nothing calls this directly

Calls 8

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
LookupOrCreateMethod · 0.45
GetLocalStorageMethod · 0.45
GetEdgeCountMethod · 0.45
SizeMethod · 0.45
GetIdsMethod · 0.45

Tested by

no test coverage detected