15struct TableAddColumnState;
32 chunkState.resetState();
36 template<
class TARGET>
40 template<
class TARGETT>
49 std::vector<std::unique_ptr<Column>>
columns;
54 std::vector<std::unique_ptr<Column>>
columns, BMFileHandle&
dataFH, MemoryManager*
mm)
82static auto NODE_GROUP_SCAN_EMMPTY_RESULT = NodeGroupScanResult{};
88 std::vector<common::LogicalType>
dataTypes,
94 std::unique_ptr<ChunkedNodeGroup> chunkedNodeGroup,
99 for (
auto i = 0u; i < chunkedNodeGroup->getNumColumns(); i++) {
100 dataTypes.push_back(chunkedNodeGroup->getColumnChunk(i).getDataType().copy());
103 chunkedGroups.appendGroup(lock, std::move(chunkedNodeGroup));
131 std::unique_ptr<ChunkedNodeGroup> chunkedGroup);
169 template<
class TARGET>
173 template<
class TARGETT>
189 std::unique_ptr<ChunkedNodeGroup> checkpointInMemOnly(
const common::UniqLock& lock,
191 std::unique_ptr<ChunkedNodeGroup> checkpointInMemAndOnDisk(
const common::UniqLock& lock,
193 std::unique_ptr<VersionInfo> checkpointVersionInfo(
const common::UniqLock& lock,
196 template<Res
idencyState SCAN_RESIDENCY_STATE>
198 template<Res
idencyState SCAN_RESIDENCY_STATE>
199 std::unique_ptr<ChunkedNodeGroup> scanAllInsertedAndVersions(
const common::UniqLock& lock,
200 const std::vector<common::column_id_t>& columnIDs,
const std::vector<Column*>& columns);
Definition deserializer.h:15
Definition serializer.h:15
Definition value_vector.h:20
Definition chunked_node_group.h:30
Definition group_collection.h:14
Definition node_group.h:85
uint64_t getEstimatedMemoryUsage()
virtual void initializeScanState(transaction::Transaction *transaction, TableScanState &state)
bool isFull() const
Definition node_group.h:117
const TARGETT & cast() const
Definition node_group.h:174
bool delete_(const transaction::Transaction *transaction, common::row_idx_t rowIdxInGroup)
ChunkedNodeGroup * getChunkedNodeGroup(common::node_group_idx_t groupIdx)
Definition node_group.h:164
void moveNextRowToAppend(common::row_idx_t numRowsToAppend)
Definition node_group.h:113
common::row_idx_t capacity
Definition node_group.h:215
common::row_idx_t getNumRowsLeftToAppend() const
Definition node_group.h:116
common::row_idx_t getNumDeletedRows(const transaction::Transaction *transaction)
common::row_idx_t nextRowToAppend
Definition node_group.h:214
void update(transaction::Transaction *transaction, common::row_idx_t rowIdxInGroup, common::column_id_t columnID, const common::ValueVector &propertyVector)
std::atomic< common::row_idx_t > numRows
Definition node_group.h:209
common::row_idx_t append(const transaction::Transaction *transaction, const std::vector< ColumnChunk * > &chunkedGroup, common::row_idx_t startRowIdx, common::row_idx_t numRowsToAppend)
NodeGroup(const common::node_group_idx_t nodeGroupIdx, const bool enableCompression, common::row_idx_t capacity, NodeGroupDataFormat format)
Definition node_group.h:105
common::node_group_idx_t nodeGroupIdx
Definition node_group.h:206
GroupCollection< ChunkedNodeGroup > chunkedGroups
Definition node_group.h:217
bool isDeleted(const transaction::Transaction *transaction, common::offset_t offsetInGroup)
virtual NodeGroupScanResult scan(transaction::Transaction *transaction, TableScanState &state)
common::row_idx_t append(const transaction::Transaction *transaction, ChunkedNodeGroup &chunkedGroup, common::row_idx_t startRowIdx, common::row_idx_t numRowsToAppend)
bool isVisible(const transaction::Transaction *transaction, common::row_idx_t rowIdxInGroup)
virtual void serialize(common::Serializer &serializer)
NodeGroup(const common::node_group_idx_t nodeGroupIdx, const bool enableCompression, std::vector< common::LogicalType > dataTypes, common::row_idx_t capacity=common::StorageConstants::NODE_GROUP_SIZE, NodeGroupDataFormat format=NodeGroupDataFormat::REGULAR)
Definition node_group.h:87
virtual ~NodeGroup()=default
std::vector< common::LogicalType > dataTypes
Definition node_group.h:216
bool isInserted(const transaction::Transaction *transaction, common::offset_t offsetInGroup)
virtual bool isEmpty() const
Definition node_group.h:111
void flush(BMFileHandle &dataFH)
bool lookup(transaction::Transaction *transaction, const TableScanState &state)
virtual common::row_idx_t getNumRows() const
Definition node_group.h:112
NodeGroupDataFormat format
Definition node_group.h:207
bool enableCompression
Definition node_group.h:208
const std::vector< common::LogicalType > & getDataTypes() const
Definition node_group.h:118
TARGET & cast()
Definition node_group.h:170
bool lookup(const common::UniqLock &lock, transaction::Transaction *transaction, const TableScanState &state)
virtual void checkpoint(NodeGroupCheckpointState &state)
void merge(transaction::Transaction *transaction, std::unique_ptr< ChunkedNodeGroup > chunkedGroup)
NodeGroupDataFormat getFormat() const
Definition node_group.h:119
virtual void addColumn(transaction::Transaction *transaction, TableAddColumnState &addColumnState, BMFileHandle *dataFH)
void initializeScanState(transaction::Transaction *transaction, const common::UniqLock &lock, TableScanState &state)
NodeGroup(const common::node_group_idx_t nodeGroupIdx, const bool enableCompression, std::unique_ptr< ChunkedNodeGroup > chunkedNodeGroup, common::row_idx_t capacity=common::StorageConstants::NODE_GROUP_SIZE, NodeGroupDataFormat format=NodeGroupDataFormat::REGULAR)
Definition node_group.h:93
common::node_group_idx_t getNumChunkedGroups()
Definition node_group.h:160
static std::unique_ptr< NodeGroup > deserialize(common::Deserializer &deSer)
void append(const transaction::Transaction *transaction, const std::vector< common::ValueVector * > &vectors, common::row_idx_t startRowIdx, common::row_idx_t numRowsToAppend)
Definition transaction.h:28
uint32_t idx_t
Definition types.h:39
uint64_t node_group_idx_t
Definition types.h:49
property_id_t column_id_t
Definition types.h:36
constexpr row_idx_t INVALID_ROW_IDX
Definition types.h:47
uint64_t table_id_t
Definition internal_id_t.h:14
TO ku_dynamic_cast(FROM old)
Definition cast.h:11
uint64_t offset_t
Definition internal_id_t.h:22
uint64_t row_idx_t
Definition types.h:46
NodeGroupDataFormat
Definition chunked_node_group.h:28
Definition alter_type.h:5
static constexpr uint64_t NODE_GROUP_SIZE
Definition constants.h:103
Definition node_group.h:47
BMFileHandle & dataFH
Definition node_group.h:50
NodeGroupCheckpointState(std::vector< common::column_id_t > columnIDs, std::vector< std::unique_ptr< Column > > columns, BMFileHandle &dataFH, MemoryManager *mm)
Definition node_group.h:53
const T & cast() const
Definition node_group.h:59
virtual ~NodeGroupCheckpointState()=default
MemoryManager * mm
Definition node_group.h:51
T & cast()
Definition node_group.h:63
std::vector< std::unique_ptr< Column > > columns
Definition node_group.h:49
std::vector< common::column_id_t > columnIDs
Definition node_group.h:48
Definition node_group.h:68
common::row_idx_t startRow
Definition node_group.h:70
common::row_idx_t numRows
Definition node_group.h:71
constexpr NodeGroupScanResult() noexcept=default
bool operator==(const NodeGroupScanResult &other) const
Definition node_group.h:77
Definition node_group.h:17
TARGET & cast()
Definition node_group.h:37
NodeGroupScanState(common::idx_t numChunks)
Definition node_group.h:24
std::vector< ChunkState > chunkStates
Definition node_group.h:22
common::idx_t chunkedGroupIdx
Definition node_group.h:19
DELETE_COPY_DEFAULT_MOVE(NodeGroupScanState)
common::row_idx_t nextRowToScan
Definition node_group.h:20
virtual ~NodeGroupScanState()=default
virtual void resetState()
Definition node_group.h:28
const TARGETT & constCast()
Definition node_group.h:41