Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyun-sj committed Aug 7, 2024
1 parent 8fca246 commit f71b0ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/include/storage/store/rel_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ struct RelTableScanState : TableScanState {
}
}

void resetState() override {
nodeGroupScanState->resetState();
}
void resetState() override { nodeGroupScanState->resetState(); }
};

class LocalRelTable;
Expand Down
6 changes: 3 additions & 3 deletions src/storage/local_storage/local_rel_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void LocalRelTable::initializeScan(TableScanState& state) {
auto& nodeSelVector = relScanState.boundNodeIDVector->state->getSelVector();
auto& index = relScanState.direction == RelDataDirection::FWD ? fwdIndex : bwdIndex;
offset_t nodeOffset =
relScanState.boundNodeIDVector->readNodeOffset(nodeSelVector[relScanState.endNodeIdx++]);
relScanState.boundNodeIDVector->readNodeOffset(nodeSelVector[relScanState.endNodeIdx++]);
if (index.contains(nodeOffset)) {
relScanState.rowIndices = index[nodeOffset];
KU_ASSERT(std::is_sorted(relScanState.rowIndices.begin(), relScanState.rowIndices.end()));
Expand Down Expand Up @@ -180,8 +180,8 @@ bool LocalRelTable::scan(Transaction* transaction, TableScanState& state) const
KU_ASSERT(relScanState.localTableScanState);
auto& localScanState = *relScanState.localTableScanState;
KU_ASSERT(localScanState.rowIndices.size() >= localScanState.nextRowToScan);
relScanState.batchSize = std::min(localScanState.rowIndices.size() - localScanState.nextRowToScan,
DEFAULT_VECTOR_CAPACITY);
relScanState.batchSize = std::min(
localScanState.rowIndices.size() - localScanState.nextRowToScan, DEFAULT_VECTOR_CAPACITY);
if (relScanState.batchSize == 0) {
return false;
}
Expand Down
21 changes: 12 additions & 9 deletions src/storage/store/csr_node_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ void CSRNodeGroup::initializeScanState(Transaction* transaction, TableScanState&
initializePersistentCSRHeader(transaction, relScanState, nodeGroupScanState);
// Queue persistent nodes to be scanned in the node group.
while (relScanState.endNodeIdx < relScanState.totalNodeIdx) {
auto nodeOffset =
relScanState.boundNodeIDVector->readNodeOffset(nodeSelVector[relScanState.endNodeIdx]);
auto nodeOffset = relScanState.boundNodeIDVector->readNodeOffset(
nodeSelVector[relScanState.endNodeIdx]);
if (nodeOffset >= StorageConstants::MAX_NUM_ROWS_IN_TABLE) {
break;
}
Expand Down Expand Up @@ -56,15 +56,17 @@ void CSRNodeGroup::initializeInMemScanState(TableScanState& state) {
KU_ASSERT(relScanState.nodeGroupScanState);
auto& nodeGroupScanState = relScanState.nodeGroupScanState->cast<CSRNodeGroupScanState>();
const auto startNodeOffset = StorageUtils::getStartOffsetOfNodeGroup(nodeGroupIdx);
const auto offsetInGroup = relScanState.boundNodeIDVector->readNodeOffset(
nodeSelVector[relScanState.endNodeIdx++]) - startNodeOffset;
const auto offsetInGroup =
relScanState.boundNodeIDVector->readNodeOffset(nodeSelVector[relScanState.endNodeIdx++]) -
startNodeOffset;
nodeGroupScanState.inMemCSRList = csrIndex->indices[offsetInGroup];
if (!nodeGroupScanState.inMemCSRList.isSequential) {
KU_ASSERT(std::is_sorted(nodeGroupScanState.inMemCSRList.rowIndices.begin(),
KU_ASSERT(std::is_sorted(nodeGroupScanState.inMemCSRList.rowIndices.begin(),
nodeGroupScanState.inMemCSRList.rowIndices.end()));
}
nodeGroupScanState.source = nodeGroupScanState.inMemCSRList.rowIndices.size() > 0 ?
CSRNodeGroupScanSource::COMMITTED_IN_MEMORY : CSRNodeGroupScanSource::NONE;
CSRNodeGroupScanSource::COMMITTED_IN_MEMORY :
CSRNodeGroupScanSource::NONE;
}

void CSRNodeGroup::initializePersistentCSRHeader(Transaction* transaction,
Expand Down Expand Up @@ -130,9 +132,10 @@ NodeGroupScanResult CSRNodeGroup::scan(Transaction* transaction, TableScanState&
return result;
}
case CSRNodeGroupScanSource::COMMITTED_IN_MEMORY: {
const auto result = nodeGroupScanState.inMemCSRList.isSequential ?
scanCommittedInMemSequential(transaction, relScanState, nodeGroupScanState) :
scanCommittedInMemRandom(transaction, relScanState, nodeGroupScanState);
const auto result =
nodeGroupScanState.inMemCSRList.isSequential ?
scanCommittedInMemSequential(transaction, relScanState, nodeGroupScanState) :
scanCommittedInMemRandom(transaction, relScanState, nodeGroupScanState);
if (result == NODE_GROUP_SCAN_EMMPTY_RESULT) {
relScanState.IDVector->state->getSelVectorUnsafe().setSelSize(0);
return NODE_GROUP_SCAN_EMMPTY_RESULT;
Expand Down
2 changes: 1 addition & 1 deletion src/storage/store/rel_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void RelTable::initializeScanState(Transaction* transaction, TableScanState& sca
KU_ASSERT(relScanState.totalNodeIdx > 0);
KU_ASSERT(relScanState.endNodeIdx == relScanState.currNodeIdx);
KU_ASSERT(relScanState.endNodeIdx < relScanState.totalNodeIdx);
offset_t nodeOffset =
offset_t nodeOffset =
relScanState.boundNodeIDVector->readNodeOffset(nodeSelVector[relScanState.currNodeIdx]);
if (nodeOffset >= StorageConstants::MAX_NUM_ROWS_IN_TABLE) {
// No more to read from committed
Expand Down

0 comments on commit f71b0ab

Please sign in to comment.