Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::DatabaseHeader Struct Reference

#include <duckdb.hpp>

Public Member Functions

void Write (WriteStream &ser)

Static Public Member Functions

static DatabaseHeader Read (const MainHeader &header, ReadStream &source)

Public Attributes

uint64_t iteration = 0
 The iteration count, increases by 1 every time the storage is checkpointed.
idx_t meta_block = 0
 A pointer to the initial meta block.
idx_t free_list = 0
 A pointer to the block containing the free list.
uint64_t block_count = 0
idx_t block_alloc_size = 0
 The allocation size of blocks in this database file. Defaults to default_block_alloc_size (DBConfig).
idx_t vector_size = 0
 The vector size of the database file.
idx_t serialization_compatibility = 0
 The serialization compatibility version.

Detailed Description

The DatabaseHeader contains information about the current state of the database. Every storage file has two DatabaseHeaders. On startup, the DatabaseHeader with the highest iteration count is used as the active header. When a checkpoint is performed, the active DatabaseHeader is switched by increasing the iteration count of the DatabaseHeader.

Member Function Documentation

◆ Write()

void duckdb::DatabaseHeader::Write ( WriteStream & ser)
420500 {
420501 ser.Write<uint64_t>(iteration);
420502 ser.Write<idx_t>(meta_block);
420503 ser.Write<idx_t>(free_list);
420504 ser.Write<uint64_t>(block_count);
420505 ser.Write<idx_t>(block_alloc_size);
420506 ser.Write<idx_t>(vector_size);
420508}
::uint64_t uint64_t
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
idx_t meta_block
A pointer to the initial meta block.
Definition duckdb.hpp:9874
idx_t serialization_compatibility
The serialization compatibility version.
Definition duckdb.hpp:9885
uint64_t iteration
The iteration count, increases by 1 every time the storage is checkpointed.
Definition duckdb.hpp:9872
idx_t free_list
A pointer to the block containing the free list.
Definition duckdb.hpp:9876
idx_t vector_size
The vector size of the database file.
Definition duckdb.hpp:9883
idx_t block_alloc_size
The allocation size of blocks in this database file. Defaults to default_block_alloc_size (DBConfig).
Definition duckdb.hpp:9881
uint64_t block_count
Definition duckdb.hpp:9879

◆ Read()

DatabaseHeader duckdb::DatabaseHeader::Read ( const MainHeader & header,
ReadStream & source )
static
420510 {
420511 DatabaseHeader header;
420512 header.iteration = source.Read<uint64_t>();
420513 header.meta_block = source.Read<idx_t>();
420514 header.free_list = source.Read<idx_t>();
420515 header.block_count = source.Read<uint64_t>();
420516 header.block_alloc_size = source.Read<idx_t>();
420517
420518 // backwards compatibility
420519 if (!header.block_alloc_size) {
420520 header.block_alloc_size = DEFAULT_BLOCK_ALLOC_SIZE;
420521 }
420522
420523 header.vector_size = source.Read<idx_t>();
420524 if (!header.vector_size) {
420525 // backwards compatibility
420526 header.vector_size = DEFAULT_STANDARD_VECTOR_SIZE;
420527 }
420528 if (header.vector_size != STANDARD_VECTOR_SIZE) {
420529 throw IOException("Cannot read database file: DuckDB's compiled vector size is %llu bytes, but the file has a "
420530 "vector size of %llu bytes.",
420531 STANDARD_VECTOR_SIZE, header.vector_size);
420532 }
420533
420534 // Default to 1 for version 64, else read from file.
420535 header.serialization_compatibility = main_header.version_number == 64 ? 1 : source.Read<idx_t>();
420536
420537 return header;
420538}

Member Data Documentation

◆ block_count

uint64_t duckdb::DatabaseHeader::block_count = 0

The number of blocks that is in the file as of this database header. If the file is larger than BLOCK_SIZE * block_count any blocks appearing AFTER block_count are implicitly part of the free_list.


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