MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / prepareRelScan

Method prepareRelScan

src/graph/on_disk_graph.cpp:206–217  ·  view source on GitHub ↗

TODO(Xiyang): since now we need to provide nbr info at prepare stage. It no longer make sense to have scanFwd&scanBwd. The direction has already been decided in this function.

Source from the content-addressed store, hash-verified

204// TODO(Xiyang): since now we need to provide nbr info at prepare stage. It no longer make sense to
205// have scanFwd&scanBwd. The direction has already been decided in this function.
206std::unique_ptr<NbrScanState> OnDiskGraph::prepareRelScan(const TableCatalogEntry& entry,
207 oid_t relTableID, table_id_t nbrTableID, std::vector<std::string> relProperties,
208 bool randomLookup) {
209 auto& info = graphEntry.getRelInfo(entry.getTableID());
210 auto state = std::make_unique<OnDiskGraphNbrScanState>(context, entry, relTableID,
211 info.predicate, relProperties, randomLookup);
212 state->nbrNodeTable = nodeIDToNodeTable.at(nbrTableID);
213 if (nodeOffsetMaskMap != nullptr && nodeOffsetMaskMap->containsTableID(nbrTableID)) {
214 state->nbrNodeMask = nodeOffsetMaskMap->getOffsetMask(nbrTableID);
215 }
216 return state;
217}
218
219Graph::EdgeIterator OnDiskGraph::scanFwd(nodeID_t nodeID, NbrScanState& state) {
220 auto& onDiskScanState = dynamic_cast_checked<OnDiskGraphNbrScanState&>(state);

Callers 4

TEST_FFunction · 0.80
runMethod · 0.80
runSparseMethod · 0.80

Calls 2

containsTableIDMethod · 0.80
getOffsetMaskMethod · 0.80

Tested by 1

TEST_FFunction · 0.64