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::FileLogStorage Class Reference

#include <duckdb.hpp>

Inheritance diagram for duckdb::FileLogStorage:
Collaboration diagram for duckdb::FileLogStorage:

Classes

struct  TableWriter
 Writer for a table. More...
 

Public Member Functions

 FileLogStorage (DatabaseInstance &db)
 
const string GetStorageName () override
 
void Truncate () override
 Implement LogStorage interface.
 
unique_ptr< TableRefBindReplace (ClientContext &context, TableFunctionBindInput &input, LoggingTargetTable table) override
 Bind replace function to scan the different tables.
 
- Public Member Functions inherited from duckdb::CSVLogStorage
 CSVLogStorage (DatabaseInstance &db, bool normalize, idx_t buffer_size)
 
- Public Member Functions inherited from duckdb::BufferingLogStorage
 BufferingLogStorage (DatabaseInstance &db_p, idx_t buffer_size, bool normalize)
 
void WriteLogEntry (timestamp_t timestamp, LogLevel level, const string &log_type, const string &log_message, const RegisteredLoggingContext &context) final
 (Partially) Implements LogStorage API
 
void WriteLogEntries (DataChunk &chunk, const RegisteredLoggingContext &context) final
 Write out the chunk to the buffers.
 
void FlushAll () final
 Flushes buffers for all tables.
 
void Flush (LoggingTargetTable table) final
 Flushes buffer for a specific table.
 
void UpdateConfig (DatabaseInstance &db, case_insensitive_map_t< Value > &config) override
 Apply a new log storage configuration.
 
bool IsEnabled (LoggingTargetTable table) override
 Returns whether the table is enabled for this storage.
 
- Public Member Functions inherited from duckdb::LogStorage
virtual DUCKDB_API bool CanScan (LoggingTargetTable table)
 READING (OPTIONAL)
 
virtual DUCKDB_API unique_ptr< LogStorageScanStateCreateScanState (LoggingTargetTable table) const
 
virtual DUCKDB_API bool Scan (LogStorageScanState &state, DataChunk &result) const
 
virtual DUCKDB_API void InitializeScan (LogStorageScanState &state) const
 

Protected Member Functions

void UpdateConfigInternal (DatabaseInstance &db, case_insensitive_map_t< Value > &config) override
 Implement CSVLogStorage interface.
 
void BeforeFlush (LoggingTargetTable table, DataChunk &chunk) override
 Lazily initializes the CSV files before first flush.
 
void AfterFlush (LoggingTargetTable table, DataChunk &chunk) override
 Calls Sync on the FileWriters to ensure a LogStorage Flush is flushed to disk immediately.
 
- Protected Member Functions inherited from duckdb::CSVLogStorage
void FlushChunk (LoggingTargetTable table, DataChunk &chunk) final
 Implement the BufferingLogStorage interface.
 
void ResetAllBuffers () override
 Resets all buffers and state.
 
void RegisterWriter (LoggingTargetTable table, unique_ptr< CSVWriter > writer)
 Helper functions.
 
CSVWriterGetWriter (LoggingTargetTable table)
 Returns the writer for a table.
 
void SetWriterConfigs (CSVWriter &Writer, vector< string > column_names)
 Configure a CSV writer by initializing its settings with the writer_options and reader_options settings.
 
CSVWriterOptionsGetCSVWriterOptions ()
 Allows child classes to manipulate options.
 
CSVReaderOptionsGetCSVReaderOptions ()
 Allows child classes to manipulate options.
 
- Protected Member Functions inherited from duckdb::BufferingLogStorage
void FlushAllInternal ()
 Helper methods.
 
void FlushInternal (LoggingTargetTable table)
 Flushes one of the tables.
 
bool IsEnabledInternal (LoggingTargetTable table)
 Whether a specific table is available in the log storage.
 
idx_t GetBufferLimit () const
 

Private Member Functions

void InitializeFile (DatabaseInstance &db, LoggingTargetTable table)
 Intialize the csv file for table
 
void Initialize (LoggingTargetTable table)
 Ensures the table is initialized, used in lazy initialization. If already initialized this will NOP.
 
unique_ptr< TableRefBindReplaceInternal (ClientContext &context, TableFunctionBindInput &input, const string &path, const string &select_clause, const string &csv_columns)
 Internal helper function to handle the BindReplace generation.
 
void SetPaths (const string &base_path)
 

Static Private Member Functions

static unique_ptr< BufferedFileWriterInitializeFileWriter (DatabaseInstance &db, const string &path)
 Initialize the filewriter to be passed to the CSVWriter.
 

Private Attributes

DatabaseInstancedb
 DB reference to get the DB filesystem.
 
map< LoggingTargetTable, TableWritertables
 The table info per table.
 
string base_path
 Base path to generate the file paths from.
 

Additional Inherited Members

- Static Public Member Functions inherited from duckdb::LogStorage
static vector< LogicalTypeGetSchema (LoggingTargetTable table)
 
static vector< string > GetColumnNames (LoggingTargetTable table)
 
- Protected Attributes inherited from duckdb::BufferingLogStorage
mutex lock
 
bool normalize_contexts = true
 

Detailed Description

FileLogStorage implements a file-based logging system in CSV format. It implements CSVLogStorage to provide persistent log storage in CSV files. The FileLogStorage can operate in normalized (separate files for entries and contexts) or denormalized mode (single file)

Member Function Documentation

◆ GetStorageName()

const string duckdb::FileLogStorage::GetStorageName ( )
inlineoverridevirtual

Implements duckdb::LogStorage.

39700 {
39701 return "FileLogStorage";
39702 }

◆ Truncate()

void duckdb::FileLogStorage::Truncate ( )
overridevirtual

Implement LogStorage interface.

Truncates the csv files

Reimplemented from duckdb::BufferingLogStorage.

◆ BindReplace()

unique_ptr< TableRef > duckdb::FileLogStorage::BindReplace ( ClientContext context,
TableFunctionBindInput input,
LoggingTargetTable  table 
)
overridevirtual

Bind replace function to scan the different tables.

Reimplemented from duckdb::LogStorage.

◆ UpdateConfigInternal()

void duckdb::FileLogStorage::UpdateConfigInternal ( DatabaseInstance db,
case_insensitive_map_t< Value > &  config 
)
overrideprotectedvirtual

Implement CSVLogStorage interface.

Handles the config related to the FileLogStorage

Reimplemented from duckdb::CSVLogStorage.

◆ BeforeFlush()

void duckdb::FileLogStorage::BeforeFlush ( LoggingTargetTable  table,
DataChunk chunk 
)
overrideprotectedvirtual

Lazily initializes the CSV files before first flush.

Reimplemented from duckdb::CSVLogStorage.

◆ AfterFlush()

void duckdb::FileLogStorage::AfterFlush ( LoggingTargetTable  table,
DataChunk chunk 
)
overrideprotectedvirtual

Calls Sync on the FileWriters to ensure a LogStorage Flush is flushed to disk immediately.

Reimplemented from duckdb::CSVLogStorage.


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