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::InMemoryCheckpointer Class Referencefinal
Inheritance diagram for duckdb::InMemoryCheckpointer:
Collaboration diagram for duckdb::InMemoryCheckpointer:

Public Member Functions

 InMemoryCheckpointer (QueryContext context, AttachedDatabase &db, BlockManager &block_manager, StorageManager &storage_manager, CheckpointOptions options)
void CreateCheckpoint () override
MetadataWriter & GetMetadataWriter () override
MetadataManager & GetMetadataManager () override
unique_ptr< TableDataWriter > GetTableDataWriter (TableCatalogEntry &table) override
optional_ptr< ClientContext > GetClientContext () const
CheckpointOptions GetCheckpointOptions () const
PartialBlockManager & GetPartialBlockManager ()
void WriteTable (TableCatalogEntry &table, Serializer &serializer) override
Public Member Functions inherited from duckdb::CheckpointWriter
 CheckpointWriter (AttachedDatabase &db)

Private Attributes

optional_ptr< ClientContext > context
PartialBlockManager partial_block_manager
StorageManager & storage_manager
CheckpointOptions options

Additional Inherited Members

Public Attributes inherited from duckdb::CheckpointWriter
AttachedDatabase & db
 The database.
Protected Member Functions inherited from duckdb::CheckpointWriter
virtual void WriteEntry (CatalogEntry &entry, Serializer &serializer)
virtual void WriteSchema (SchemaCatalogEntry &schema, Serializer &serializer)
virtual void WriteView (ViewCatalogEntry &table, Serializer &serializer)
virtual void WriteSequence (SequenceCatalogEntry &table, Serializer &serializer)
virtual void WriteMacro (ScalarMacroCatalogEntry &table, Serializer &serializer)
virtual void WriteTableMacro (TableMacroCatalogEntry &table, Serializer &serializer)
virtual void WriteIndex (IndexCatalogEntry &index_catalog_entry, Serializer &serializer)
virtual void WriteType (TypeCatalogEntry &type, Serializer &serializer)

Constructor & Destructor Documentation

◆ InMemoryCheckpointer()

duckdb::InMemoryCheckpointer::InMemoryCheckpointer ( QueryContext context,
AttachedDatabase & db,
BlockManager & block_manager,
StorageManager & storage_manager,
CheckpointOptions options )
432246 : CheckpointWriter(db), context(context.GetClientContext()),
432247 partial_block_manager(context, block_manager, PartialBlockType::IN_MEMORY_CHECKPOINT),
432248 storage_manager(storage_manager), options(options_p) {
432249}
AttachedDatabase & db
The database.
Definition duckdb.cpp:388889

Member Function Documentation

◆ CreateCheckpoint()

void duckdb::InMemoryCheckpointer::CreateCheckpoint ( )
overridevirtual

Implements duckdb::CheckpointWriter.

432251 {
432252 vector<reference<SchemaCatalogEntry>> schemas;
432253 // we scan the set of committed schemas
432254 auto &catalog = Catalog::GetCatalog(db).Cast<DuckCatalog>();
432255 catalog.ScanSchemas([&](SchemaCatalogEntry &entry) { schemas.push_back(entry); });
432256
432257 vector<reference<TableCatalogEntry>> tables;
432258 for (const auto &schema_ref : schemas) {
432259 auto &schema = schema_ref.get();
432260 schema.Scan(CatalogType::TABLE_ENTRY, [&](CatalogEntry &entry) {
432261 if (entry.type == CatalogType::TABLE_ENTRY) {
432262 tables.push_back(entry.Cast<TableCatalogEntry>());
432263 }
432264 });
432265 }
432266
432267 for (auto &table : tables) {
432268 MemoryStream write_stream;
432269 BinarySerializer serializer(write_stream);
432270
432271 WriteTable(table, serializer);
432272 }
432273 storage_manager.SetWALSize(0);
432274}
static DUCKDB_API Catalog & GetCatalog(ClientContext &context, const string &catalog_name)
Get the specified Catalog from the ClientContext.
Definition duckdb.cpp:7211

◆ GetMetadataWriter()

MetadataWriter & duckdb::InMemoryCheckpointer::GetMetadataWriter ( )
overridevirtual

Implements duckdb::CheckpointWriter.

432276 {
432277 throw InternalException("Unsupported method GetMetadataWriter for InMemoryCheckpointer");
432278}

◆ GetMetadataManager()

MetadataManager & duckdb::InMemoryCheckpointer::GetMetadataManager ( )
overridevirtual

Implements duckdb::CheckpointWriter.

432279 {
432280 throw InternalException("Unsupported method GetMetadataManager for InMemoryCheckpointer");
432281}

◆ GetTableDataWriter()

unique_ptr< TableDataWriter > duckdb::InMemoryCheckpointer::GetTableDataWriter ( TableCatalogEntry & table)
overridevirtual

Implements duckdb::CheckpointWriter.

432282 {
432283 throw InternalException("Unsupported method GetTableDataWriter for InMemoryCheckpointer");
432284}

◆ GetClientContext()

optional_ptr< ClientContext > duckdb::InMemoryCheckpointer::GetClientContext ( ) const
inline
415251 {
415252 return context;
415253 }

◆ GetCheckpointOptions()

CheckpointOptions duckdb::InMemoryCheckpointer::GetCheckpointOptions ( ) const
inline
415254 {
415255 return options;
415256 }

◆ GetPartialBlockManager()

PartialBlockManager & duckdb::InMemoryCheckpointer::GetPartialBlockManager ( )
inline
415257 {
415258 return partial_block_manager;
415259 }

◆ WriteTable()

void duckdb::InMemoryCheckpointer::WriteTable ( TableCatalogEntry & table,
Serializer & serializer )
overridevirtual

Implements duckdb::CheckpointWriter.

432286 {
432287 InMemoryTableDataWriter data_writer(*this, table);
432288
432289 // Write the table data
432290 auto table_lock = table.GetStorage().GetCheckpointLock();
432291 table.GetStorage().Checkpoint(data_writer, serializer);
432292 // flush any partial blocks BEFORE releasing the table lock
432293 // flushing partial blocks updates where data lives and is not thread-safe
432294 partial_block_manager.FlushPartialBlocks();
432295}

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