-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Partitioner to use ChunkedNodeGroupCollection (#3123)
- Loading branch information
Showing
21 changed files
with
191 additions
and
161 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#pragma once | ||
|
||
#include "storage/store/chunked_node_group.h" | ||
|
||
namespace kuzu { | ||
namespace storage { | ||
|
||
class ChunkedNodeGroupCollection { | ||
public: | ||
static constexpr uint64_t CHUNK_CAPACITY = 2048; | ||
|
||
explicit ChunkedNodeGroupCollection(std::vector<common::LogicalType> types) | ||
: types{std::move(types)} {} | ||
DELETE_COPY_DEFAULT_MOVE(ChunkedNodeGroupCollection); | ||
|
||
inline const std::vector<std::unique_ptr<ChunkedNodeGroup>>& getChunkedGroups() const { | ||
return chunkedGroups; | ||
} | ||
inline const ChunkedNodeGroup* getChunkedGroup(uint64_t groupIdx) const { | ||
KU_ASSERT(groupIdx < chunkedGroups.size()); | ||
return chunkedGroups[groupIdx].get(); | ||
} | ||
inline ChunkedNodeGroup* getChunkedGroupUnsafe(uint64_t groupIdx) { | ||
KU_ASSERT(groupIdx < chunkedGroups.size()); | ||
return chunkedGroups[groupIdx].get(); | ||
} | ||
inline uint64_t getNumChunks() const { return chunkedGroups.size(); } | ||
|
||
void append( | ||
const std::vector<common::ValueVector*>& vectors, const common::SelectionVector& selVector); | ||
void append(std::unique_ptr<ChunkedNodeGroup> chunkedGroup); | ||
void merge(ChunkedNodeGroupCollection& chunkedGroupCollection); | ||
|
||
private: | ||
std::vector<common::LogicalType> types; | ||
std::vector<std::unique_ptr<ChunkedNodeGroup>> chunkedGroups; | ||
}; | ||
|
||
} // 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
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
Oops, something went wrong.