Skip to content

Commit

Permalink
Fix syntax to clang-format-11
Browse files Browse the repository at this point in the history
  • Loading branch information
rfdavid committed Mar 2, 2023
1 parent e9bc2bc commit 1912e13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/include/storage/storage_structure/disk_overflow_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ class DiskOverflowFile : public StorageStructure {
}

struct OverflowCache {
FileHandle* fileHandle = nullptr;
common::page_idx_t pageIdx = UINT32_MAX;
uint8_t* frame = nullptr;
FileHandle* fileHandle = nullptr;
common::page_idx_t pageIdx = UINT32_MAX;
uint8_t* frame = nullptr;
};

void readStringsToVector(
Expand Down
26 changes: 12 additions & 14 deletions src/storage/storage_structure/disk_overflow_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ namespace kuzu {
namespace storage {

void DiskOverflowFile::unpinOverflowCache(OverflowCache& overflowCache) {
if (overflowCache.pageIdx != UINT32_MAX) {
bufferManager.unpin(*overflowCache.fileHandle, overflowCache.pageIdx);
}
if (overflowCache.pageIdx != UINT32_MAX) {
bufferManager.unpin(*overflowCache.fileHandle, overflowCache.pageIdx);
}
}

void DiskOverflowFile::readStringsToVector(TransactionType trxType, ValueVector& valueVector) {
Expand All @@ -25,16 +25,14 @@ void DiskOverflowFile::readStringsToVector(TransactionType trxType, ValueVector&
if (valueVector.isNull(pos)) {
continue;
}
readStringToVector(
trxType, ((ku_string_t*)valueVector.getData())[pos],
readStringToVector(trxType, ((ku_string_t*)valueVector.getData())[pos],
valueVector.getOverflowBuffer(), overflowCache);
}
unpinOverflowCache(overflowCache);
}

void DiskOverflowFile::readStringToVector(
TransactionType trxType, ku_string_t& kuStr, InMemOverflowBuffer& inMemOverflowBuffer,
OverflowCache& overflowCache) {
void DiskOverflowFile::readStringToVector(TransactionType trxType, ku_string_t& kuStr,
InMemOverflowBuffer& inMemOverflowBuffer, OverflowCache& overflowCache) {
if (ku_string_t::isShortString(kuStr.len)) {
return;
}
Expand All @@ -44,12 +42,12 @@ void DiskOverflowFile::readStringToVector(
StorageStructureUtils::getFileHandleAndPhysicalPageIdxToPin(
fileHandle, cursor.pageIdx, *wal, trxType);
if (pageIdxToPin != overflowCache.pageIdx) { // cache miss
if (overflowCache.pageIdx != UINT32_MAX) {
bufferManager.unpin(*overflowCache.fileHandle, overflowCache.pageIdx);
}
overflowCache.frame = bufferManager.pin(*fileHandleToPin, pageIdxToPin);
overflowCache.fileHandle = fileHandleToPin;
overflowCache.pageIdx = pageIdxToPin;
if (overflowCache.pageIdx != UINT32_MAX) {
bufferManager.unpin(*overflowCache.fileHandle, overflowCache.pageIdx);
}
overflowCache.frame = bufferManager.pin(*fileHandleToPin, pageIdxToPin);
overflowCache.fileHandle = fileHandleToPin;
overflowCache.pageIdx = pageIdxToPin;
}
InMemOverflowBufferUtils::copyString(
(char*)(overflowCache.frame + cursor.offsetInPage), kuStr.len, kuStr, inMemOverflowBuffer);
Expand Down

0 comments on commit 1912e13

Please sign in to comment.