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::MaxTempDirectorySizeSetting Struct Reference

Public Types

using RETURN_TYPE = string

Static Public Member Functions

static void SetGlobal (DatabaseInstance *db, DBConfig &config, const Value &parameter)
static void ResetGlobal (DatabaseInstance *db, DBConfig &config)
static Value GetSetting (const ClientContext &context)

Static Public Attributes

static constexpr const char * Name = "max_temp_directory_size"
static constexpr const char * Description
static constexpr const char * InputType = "VARCHAR"

Member Function Documentation

◆ SetGlobal()

void duckdb::MaxTempDirectorySizeSetting::SetGlobal ( DatabaseInstance * db,
DBConfig & config,
const Value & parameter )
static
302631 {
302632 if (input == "90% of available disk space") {
302633 ResetGlobal(db, config);
302634 return;
302635 }
302636 auto maximum_swap_space = DBConfig::ParseMemoryLimit(input.ToString());
302637 if (maximum_swap_space == DConstants::INVALID_INDEX) {
302638 // We use INVALID_INDEX to indicate that the value is not set by the user
302639 // use one lower to indicate 'unlimited'
302640 maximum_swap_space--;
302641 }
302642 if (!db) {
302643 config.options.maximum_swap_space = maximum_swap_space;
302644 return;
302645 }
302646 auto &buffer_manager = BufferManager::GetBufferManager(*db);
302647 buffer_manager.SetSwapLimit(maximum_swap_space);
302648 config.options.maximum_swap_space = maximum_swap_space;
302649}
idx_t maximum_swap_space
The maximum size of the 'temp_directory' folder when set (in bytes). Default: 90% of available disk s...
Definition duckdb.hpp:40002
DBConfigOptions options
Database configuration options.
Definition duckdb.hpp:40090
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117

◆ ResetGlobal()

void duckdb::MaxTempDirectorySizeSetting::ResetGlobal ( DatabaseInstance * db,
DBConfig & config )
static
302651 {
302653 if (!db) {
302654 return;
302655 }
302656 auto &buffer_manager = BufferManager::GetBufferManager(*db);
302657 buffer_manager.SetSwapLimit();
302658}

◆ GetSetting()

Value duckdb::MaxTempDirectorySizeSetting::GetSetting ( const ClientContext & context)
static
302660 {
302661 auto &config = DBConfig::GetConfig(context);
302662 if (config.options.maximum_swap_space != DConstants::INVALID_INDEX) {
302663 // Explicitly set by the user
302664 return Value(StringUtil::BytesToHumanReadableString(config.options.maximum_swap_space));
302665 }
302666 auto &buffer_manager = BufferManager::GetBufferManager(context);
302667 // Database is initialized, use the setting from the temporary directory
302668 auto max_swap = buffer_manager.GetMaxSwap();
302669 if (max_swap.IsValid()) {
302670 return Value(StringUtil::BytesToHumanReadableString(max_swap.GetIndex()));
302671 } else {
302672 // The temp directory has not been used yet
302673 return Value("90% of available disk space");
302674 }
302675}
static DUCKDB_API string BytesToHumanReadableString(idx_t bytes, idx_t multiplier=1024)
Return a string that formats the give number of bytes.
Definition duckdb.cpp:109517

Member Data Documentation

◆ Description

const char* duckdb::MaxTempDirectorySizeSetting::Description
staticconstexpr
Initial value:
=
"The maximum amount of data stored inside the 'temp_directory' (when set) (e.g. 1GB)"

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