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.
| 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. |
| 206 | std::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 | |
| 219 | Graph::EdgeIterator OnDiskGraph::scanFwd(nodeID_t nodeID, NbrScanState& state) { |
| 220 | auto& onDiskScanState = dynamic_cast_checked<OnDiskGraphNbrScanState&>(state); |