![]() |
mutable
A Database System for Research and Fast Prototyping
|
This class implements a column store. More...
#include <ColumnStore.hpp>
Public Member Functions | |
ColumnStore (const Table &table) | |
~ColumnStore () | |
virtual std::size_t | num_rows () const override |
Return the number of rows in this store. | |
std::size_t | row_size () const |
Returns the effective size of a row, in bits. | |
void | append () override |
Append a row to the store. | |
void | drop () override |
Drop the most recently appended row. | |
const memory::Memory & | memory () const override |
Returns the memory of the store. | |
void * | memory (std::size_t attr_id) const |
Returns the memory address where the column assigned to the attribute with id attr_id starts. | |
void | dump (std::ostream &out) const override |
virtual void | dump (std::ostream &out) const=0 |
void | dump () const |
const Table & | table () const |
Static Public Attributes | |
static constexpr std::size_t | ALLOCATION_SIZE = 1UL << 30 |
1 GiB | |
Private Attributes | |
memory::LinearAllocator | allocator_ |
the memory allocator | |
memory::Memory | data_ |
std::size_t | num_rows_ = 0 |
std::size_t | capacity_ |
std::size_t | row_size_ = 0 |
const Table & | table_ |
the table defining this store's schema | |
This class implements a column store.
Definition at line 11 of file ColumnStore.hpp.
ColumnStore::ColumnStore | ( | const Table & | table | ) |
Definition at line 11 of file ColumnStore.cpp.
References m::memory::LinearAllocator::allocate(), ALLOCATION_SIZE, allocator_, m::Table::begin_all(), capacity_, data_, m::Table::end_all(), m::Table::num_attrs(), row_size_, m::memory::Memory::size(), and m::Store::table().
ColumnStore::~ColumnStore | ( | ) |
Definition at line 33 of file ColumnStore.cpp.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Drop the most recently appended row.
Implements m::Store.
Definition at line 41 of file ColumnStore.hpp.
M_LCOV_EXCL_START void Store::dump | ( | ) | const |
|
overridevirtual |
Implements m::Store.
Definition at line 36 of file ColumnStore.cpp.
References capacity_, m::Table::name(), num_rows_, row_size_, and m::Store::table().
|
virtual |
Implements m::Store.
|
inlineoverridevirtual |
Returns the memory of the store.
Implements m::Store.
Definition at line 47 of file ColumnStore.hpp.
References data_.
|
inline |
Returns the memory address where the column assigned to the attribute with id attr_id
starts.
Return the address of the NULL bitmap column if attr_id == table().size()
.
Definition at line 50 of file ColumnStore.hpp.
References m::memory::Memory::addr(), ALLOCATION_SIZE, data_, M_insist, and m::Store::table().
|
inlineoverridevirtual |
Return the number of rows in this store.
Implements m::Store.
Definition at line 30 of file ColumnStore.hpp.
References num_rows_.
|
inline |
Returns the effective size of a row, in bits.
Definition at line 33 of file ColumnStore.hpp.
References row_size_.
|
inlineinherited |
Definition at line 36 of file Store.hpp.
Referenced by ColumnStore(), m::PaxStore::compute_block_offsets(), m::RowStore::compute_offsets(), dump(), m::PaxStore::dump(), m::RowStore::dump(), memory(), m::PaxStore::offset(), m::RowStore::offset(), and m::ScanOperator::ScanOperator().
|
staticconstexpr |
|
private |
|
private |
Definition at line 23 of file ColumnStore.hpp.
Referenced by append(), ColumnStore(), and dump().
|
private |
Definition at line 21 of file ColumnStore.hpp.
Referenced by ColumnStore(), and memory().
|
private |
Definition at line 22 of file ColumnStore.hpp.
Referenced by append(), drop(), dump(), and num_rows().
|
private |
Definition at line 24 of file ColumnStore.hpp.
Referenced by ColumnStore(), dump(), and row_size().
|
privateinherited |