Nebula
Loading...
Searching...
No Matches
MemDb::Table::Partition Class Reference

#include <table.h>

Public Attributes

Tabletable = nullptr
 
Partitionnext = nullptr
 
Partitionprevious = nullptr
 
uint16_t partitionId = 0xFFFF
 
uint32_t numRows = 0
 number of rows
 
uint64_t version = 0
 
Util::Array< uint16_t > freeIds
 
Util::Array< ColumnBuffercolumns
 holds all the column buffers. This excludes non-typed attributes
 
Util::BitField< CAPACITYmodifiedRows
 check a bit if the row has been modified, and you need to track it.
 
Util::BitField< CAPACITYvalidRows
 bits are set if the row is occupied.
 

Static Public Attributes

static constexpr uint CAPACITY = 256
 

Private Member Functions

 Partition ()=default
 
 ~Partition ()
 
uint16_t AllocateRowIndex ()
 recycle free row or allocate new row
 
void FreeIndex (uint16_t instance)
 Free an index.
 
void EraseSwapIndex (uint16_t instance)
 erase row by swapping with last row and reducing number of rows in table
 

Private Attributes

friend Table
 

Constructor & Destructor Documentation

◆ Partition()

MemDb::Table::Partition::Partition ( )
privatedefault

◆ ~Partition()

MemDb::Table::Partition::~Partition ( )
private

Member Function Documentation

◆ AllocateRowIndex()

uint16_t MemDb::Table::Partition::AllocateRowIndex ( )
private

recycle free row or allocate new row

◆ EraseSwapIndex()

void MemDb::Table::Partition::EraseSwapIndex ( uint16_t instance)
private

erase row by swapping with last row and reducing number of rows in table

◆ FreeIndex()

void MemDb::Table::Partition::FreeIndex ( uint16_t instance)
private

Free an index.

Member Data Documentation

◆ CAPACITY

constexpr uint MemDb::Table::Partition::CAPACITY = 256
staticconstexpr

◆ columns

Util::Array<ColumnBuffer> MemDb::Table::Partition::columns

holds all the column buffers. This excludes non-typed attributes

◆ freeIds

Util::Array<uint16_t> MemDb::Table::Partition::freeIds

◆ modifiedRows

Util::BitField<CAPACITY> MemDb::Table::Partition::modifiedRows

check a bit if the row has been modified, and you need to track it.

bits are reset when partition is defragged

◆ next

Partition* MemDb::Table::Partition::next = nullptr

◆ numRows

uint32_t MemDb::Table::Partition::numRows = 0

number of rows

◆ partitionId

uint16_t MemDb::Table::Partition::partitionId = 0xFFFF

◆ previous

Partition* MemDb::Table::Partition::previous = nullptr

◆ table

Table* MemDb::Table::Partition::table = nullptr

◆ Table

friend MemDb::Table::Partition::Table
private

◆ validRows

Util::BitField<CAPACITY> MemDb::Table::Partition::validRows

bits are set if the row is occupied.

If the row is removed, the bit is set to zero. this is kept up to date if defragging the partition.

◆ version

uint64_t MemDb::Table::Partition::version = 0

The documentation for this class was generated from the following files: