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::BufferManager Class Referenceabstract

Public Member Functions

virtual shared_ptr< BlockHandleAllocateTemporaryMemory (MemoryTag tag, idx_t block_size, bool can_destroy=true)=0
 Allocate temporary memory of size block_size.
 
virtual shared_ptr< BlockHandleAllocateMemory (MemoryTag tag, BlockManager *block_manager, bool can_destroy=true)=0
 
virtual BufferHandle Allocate (MemoryTag tag, idx_t block_size, bool can_destroy=true)=0
 Allocate (temporary) memory of size block_size, and pin it.
 
virtual BufferHandle Allocate (MemoryTag tag, BlockManager *block_manager, bool can_destroy=true)=0
 Allocate block-based memory and pin it.
 
virtual BufferHandle Pin (shared_ptr< BlockHandle > &handle)=0
 Pin a block handle.
 
virtual BufferHandle Pin (const QueryContext &context, shared_ptr< BlockHandle > &handle)=0
 
virtual void Prefetch (vector< shared_ptr< BlockHandle > > &handles)=0
 
virtual void Unpin (shared_ptr< BlockHandle > &handle)=0
 Unpin a block handle.
 
virtual idx_t GetUsedMemory () const =0
 Returns the currently allocated memory.
 
virtual idx_t GetMaxMemory () const =0
 Returns the maximum available memory.
 
virtual idx_t GetUsedSwap () const =0
 Returns the currently used swap space.
 
virtual optional_idx GetMaxSwap () const =0
 Returns the maximum swap space that can be used.
 
virtual idx_t GetBlockAllocSize () const =0
 Returns the block allocation size for buffer-managed blocks.
 
virtual idx_t GetBlockSize () const =0
 Returns the block size for buffer-managed blocks.
 
virtual idx_t GetQueryMaxMemory () const =0
 Returns the maximum available memory for a given query.
 
virtual shared_ptr< BlockHandleRegisterTransientMemory (const idx_t size, BlockManager &block_manager)
 Returns a newly registered block of transient memory.
 
virtual shared_ptr< BlockHandleRegisterSmallMemory (const idx_t size)
 Returns a newly registered block of memory that is smaller than the block size setting.
 
virtual shared_ptr< BlockHandleRegisterSmallMemory (MemoryTag tag, const idx_t size)
 Returns a newly registered block of memory that is smaller than the block size setting and has a memory tag.
 
virtual DUCKDB_API AllocatorGetBufferAllocator ()
 Get the buffer allocator.
 
virtual DUCKDB_API void ReserveMemory (idx_t size)
 Reserve memory.
 
virtual DUCKDB_API void FreeReservedMemory (idx_t size)
 Free reserved memory.
 
virtual vector< MemoryInformationGetMemoryUsageInfo () const =0
 GetMemoryUsageInfo returns MemoryInformation for each memory tag.
 
virtual void SetMemoryLimit (idx_t limit=(idx_t) -1)
 
virtual void SetSwapLimit (optional_idx limit=optional_idx())
 Set a new swap limit.
 
virtual BlockManagerGetTemporaryBlockManager ()=0
 Get the block manager used for in-memory data.
 
virtual vector< TemporaryFileInformationGetTemporaryFiles ()
 Get the temporary file information of each temporary file.
 
virtual const string & GetTemporaryDirectory () const
 Get the path to the temporary file directory.
 
virtual void SetTemporaryDirectory (const string &new_dir)
 Set the path to the temporary file directory.
 
virtual bool HasTemporaryDirectory () const
 Returns true, if the path to the temporary file directory is not empty.
 
virtual bool HasFilesInTemporaryDirectory () const
 Returns true if there are files found in the temporary directory.
 
virtual unique_ptr< FileBufferConstructManagedBuffer (idx_t size, idx_t block_header_size, unique_ptr< FileBuffer > &&source, FileBufferType type=FileBufferType::MANAGED_BUFFER)
 Construct a managed buffer.
 
virtual BufferPool & GetBufferPool () const
 Get the buffer pool.
 
virtual const DatabaseInstanceGetDatabase () const =0
 Get the const database.
 
virtual DatabaseInstanceGetDatabase ()=0
 Get the database.
 
virtual TemporaryMemoryManagerGetTemporaryMemoryManager ()
 Get the manager assigning reservations for temporary memory, e.g., for query intermediates.
 
virtual void PurgeQueue (const BlockHandle &handle)=0
 Purge the eviction queue of the block handle.
 
virtual void AddToEvictionQueue (shared_ptr< BlockHandle > &handle)
 Add the block handle to the eviction queue.
 
virtual void WriteTemporaryBuffer (MemoryTag tag, block_id_t block_id, FileBuffer &buffer)
 Write a temporary file buffer.
 
virtual unique_ptr< FileBufferReadTemporaryBuffer (QueryContext context, MemoryTag tag, BlockHandle &block, unique_ptr< FileBuffer > buffer)
 Read a temporary buffer.
 
virtual void DeleteTemporaryFile (BlockMemory &memory)
 Delete the temporary file containing the block memory.
 

Static Public Member Functions

static DUCKDB_API BufferManagerGetBufferManager (DatabaseInstance &db)
 
static DUCKDB_API const BufferManagerGetBufferManager (const DatabaseInstance &db)
 
static DUCKDB_API BufferManagerGetBufferManager (ClientContext &context)
 
static DUCKDB_API const BufferManagerGetBufferManager (const ClientContext &context)
 
static DUCKDB_API BufferManagerGetBufferManager (AttachedDatabase &db)
 
static DUCKDB_API idx_t GetAllocSize (const idx_t alloc_size)
 

Friends

class BufferHandle
 
class BlockHandle
 
class BlockManager
 

Constructor & Destructor Documentation

◆ BufferManager()

duckdb::BufferManager::BufferManager ( )
inline
45440 {
45441 }

◆ ~BufferManager()

virtual duckdb::BufferManager::~BufferManager ( )
inlinevirtual
45442 {
45443 }

Member Function Documentation

◆ AllocateMemory()

virtual shared_ptr< BlockHandle > duckdb::BufferManager::AllocateMemory ( MemoryTag  tag,
BlockManager block_manager,
bool  can_destroy = true 
)
pure virtual

Allocate block-based memory. The block manager provides the block size, and the block header size. Returns the BlockHandle managing the registered memory.

◆ Prefetch()

virtual void duckdb::BufferManager::Prefetch ( vector< shared_ptr< BlockHandle > > &  handles)
pure virtual

Pre-fetch a series of blocks. Using this function is a performance suggestion.

◆ SetMemoryLimit()

virtual void duckdb::BufferManager::SetMemoryLimit ( idx_t  limit = (idx_t) -1)
virtual

Set a new memory limit. Throws an exception, if the new limit is too low, meaning not enough blocks can be evicted.


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