forked from kuzudb/kuzu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spill partitioner data to disk during Rel table copies (kuzudb#4188)
(cherry picked from commit 4ba09ea)
- Loading branch information
1 parent
88b0b84
commit 15b09b6
Showing
37 changed files
with
516 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
|
||
#include "storage/file_handle.h" | ||
|
||
namespace kuzu { | ||
namespace common { | ||
class VirtualFileSystem; | ||
}; | ||
namespace storage { | ||
class ChunkedNodeGroup; | ||
|
||
class BufferManager; | ||
class ColumnChunkData; | ||
class Spiller { | ||
public: | ||
Spiller(const std::string& tmpFilePath, BufferManager& bufferManager, | ||
common::VirtualFileSystem* vfs); | ||
void addUnusedChunk(ChunkedNodeGroup* nodeGroup); | ||
void clearUnusedChunk(ChunkedNodeGroup* nodeGroup); | ||
uint64_t spillToDisk(ColumnChunkData& chunk) const; | ||
void loadFromDisk(ColumnChunkData& chunk) const; | ||
// reclaims memory from the next full partitioner group in the set | ||
// and returns the amount of memory reclaimed | ||
// If the set is empty, returns zero | ||
uint64_t claimNextGroup(); | ||
// Must only be used once all chunks have been loaded from disk. | ||
void clearFile(); | ||
~Spiller(); | ||
|
||
private: | ||
std::mutex partitionerGroupsMtx; | ||
std::unordered_set<ChunkedNodeGroup*> fullPartitionerGroups; | ||
FileHandle* dataFH; | ||
}; | ||
|
||
} // namespace storage | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.