19 , offsets_(new uint32_t[table.num_attrs() + 1])
39 for (uint32_t pos = 0; pos != num_attrs; ++pos)
40 attrs[pos] = &
table()[pos];
43 std::stable_sort(attrs, attrs + num_attrs, [](
const Attribute *first,
const Attribute *second) {
49 uint64_t alignment = 8;
50 for (uint32_t pos = 0; pos != num_attrs; ++pos) {
60 off += (alignment - off % alignment);
70 <<
" rows, " <<
row_size_ <<
" bits per row, offsets [";
71 for (uint32_t i = 0, end =
table().num_attrs(); i != end; ++i) {
72 if (i != 0) out <<
", ";
75 out <<
']' << std::endl;
80static
void register_store()
__attribute__((constructor(202))) static void register_interpreter()
const PrimitiveType * type
the type of the attribute
std::size_t id
the internal identifier of the attribute, unique within its table
The catalog contains all Databases and keeps track of all meta information of the database system.
ThreadSafePooledString pool(const char *str) const
Creates an internalized copy of the string str by adding it to the internal StringPool.
static Catalog & Get()
Return a reference to the single Catalog instance.
void register_store(ThreadSafePooledString name, const char *description=nullptr)
Registers a new Store with the given name.
This class implements a row store.
memory::Memory data_
the underlying memory containing the data
std::size_t num_rows_
the number of rows in use
uint32_t * offsets_
the offsets from the first column, in bits, of all columns
memory::LinearAllocator allocator_
the memory allocator
std::size_t capacity_
the number of available rows
uint32_t row_size_
the size of a row, in bits; includes NULL bitmap and other meta data
static constexpr std::size_t ALLOCATION_SIZE
1 GiB
void compute_offsets()
Computes the offsets of the attributes within a row.
RowStore(const Table &table)
Defines a generic store interface.
const Table & table() const
A table is a sorted set of attributes.
virtual const ThreadSafePooledString & name() const =0
Returns the name of the Table.
virtual std::size_t num_attrs() const =0
Returns the number of attributes in this table.
virtual uint64_t alignment() const
Compute the alignment requirement in bits of an instance of this type.
virtual uint64_t size() const
Compute the size in bits of an instance of this type.
Memory allocate(std::size_t size) override
Creates a new memory object with size bytes of freshly allocated memory.
void * addr() const
Returns a pointer to the beginning of the virtual address space where this allocation is mapped to.