![]() |
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.
|

Classes | |
| struct | EvictionResult |
| struct | MemoryUsage |
Public Member Functions | |
| BufferPool (BlockAllocator &block_allocator, idx_t maximum_memory, bool track_eviction_timestamps, idx_t allocator_bulk_deallocation_flush_threshold) | |
| void | SetLimit (idx_t limit, const char *exception_postscript) |
| void | SetAllocatorBulkDeallocationFlushThreshold (idx_t threshold) |
| If bulk deallocation larger than this occurs, flush outstanding allocations. | |
| idx_t | GetAllocatorBulkDeallocationFlushThreshold () |
| void | UpdateUsedMemory (MemoryTag tag, int64_t size) |
| idx_t | GetUsedMemory (bool flush=true) const |
| idx_t | GetMaxMemory () const |
| virtual idx_t | GetQueryMaxMemory () const |
| TemporaryMemoryManager & | GetTemporaryMemoryManager () |
| void | SetObjectCache (ObjectCache *object_cache_p) |
Protected Types | |
| enum class | MemoryUsageCaches { FLUSH , NO_FLUSH } |
Protected Member Functions | |
| virtual EvictionResult | EvictBlocks (MemoryTag tag, idx_t extra_memory, idx_t memory_limit, unique_ptr< FileBuffer > *buffer=nullptr) |
| virtual EvictionResult | EvictBlocksInternal (EvictionQueue &queue, MemoryTag tag, idx_t extra_memory, idx_t memory_limit, unique_ptr< FileBuffer > *buffer=nullptr) |
| EvictionResult | EvictObjectCacheEntries (MemoryTag tag, idx_t extra_memory, idx_t memory_limit) |
| Evict object cache entries if needed. | |
| idx_t | PurgeAgedBlocks (uint32_t max_age_sec) |
| Purge all blocks that haven't been pinned within the last N seconds. | |
| idx_t | PurgeAgedBlocksInternal (EvictionQueue &queue, uint32_t max_age_sec, int64_t now, int64_t limit) |
| void | PurgeQueue (const BlockHandle &handle) |
| Garbage collect dead nodes in the eviction queue. | |
| bool | AddToEvictionQueue (shared_ptr< BlockHandle > &handle) |
| EvictionQueue & | GetEvictionQueueForBlockMemory (const BlockMemory &memory) |
| Gets the eviction queue for the specified type. | |
| void | IncrementDeadNodes (const BlockMemory &memory) |
| Increments the dead nodes for the queue with specified type. | |
Protected Attributes | |
| const array< idx_t, EVICTION_QUEUE_TYPES > | eviction_queue_sizes |
| Mapping and priority order for the eviction queues. | |
| mutex | limit_lock |
| The lock for changing the memory limit. | |
| atomic< idx_t > | maximum_memory |
| The maximum amount of memory that the buffer manager can keep (in bytes). | |
| atomic< idx_t > | allocator_bulk_deallocation_flush_threshold |
| If bulk deallocation larger than this occurs, flush outstanding allocations. | |
| bool | track_eviction_timestamps |
| Record timestamps of buffer manager unpin() events. Usable by custom eviction policies. | |
| vector< unique_ptr< EvictionQueue > > | queues |
| Eviction queues. | |
| unique_ptr< TemporaryMemoryManager > | temporary_memory_manager |
| Memory manager for concurrently used temporary memory, e.g., for physical operators. | |
| MemoryUsage | memory_usage |
| BlockAllocator & | block_allocator |
| The block allocator. | |
| optional_ptr< ObjectCache > | object_cache = nullptr |
| Per-database singleton object cache managed by buffer pool. | |
Static Protected Attributes | |
| static constexpr idx_t | EVICTION_QUEUE_TYPES = FILE_BUFFER_TYPE_COUNT - 1 |
| How many eviction queue types we have (BLOCK and EXTERNAL_FILE go into same queue). | |
| static constexpr idx_t | BLOCK_AND_EXTERNAL_FILE_QUEUE_SIZE = 1 |
| How many eviction queues we have for the different FileBufferTypes. | |
| static constexpr idx_t | MANAGED_BUFFER_QUEUE_SIZE = 6 |
| static constexpr idx_t | TINY_BUFFER_QUEUE_SIZE = 1 |
Friends | |
| class | BlockMemory |
| class | BlockHandle |
| class | BlockManager |
| class | BufferManager |
| class | StandardBufferManager |
The BufferPool is in charge of handling memory management for one or more databases. It defines memory limits and implements priority eviction among all users of the pool.
|
strongprotected |
| duckdb::BufferPool::BufferPool | ( | BlockAllocator & | block_allocator, |
| idx_t | maximum_memory, | ||
| bool | track_eviction_timestamps, | ||
| idx_t | allocator_bulk_deallocation_flush_threshold ) |
|
virtual |
| void duckdb::BufferPool::SetLimit | ( | idx_t | limit, |
| const char * | exception_postscript ) |
Set a new memory limit to the buffer pool, throws an exception if the new limit is too low and not enough blocks can be evicted
| void duckdb::BufferPool::SetAllocatorBulkDeallocationFlushThreshold | ( | idx_t | threshold | ) |
If bulk deallocation larger than this occurs, flush outstanding allocations.
| idx_t duckdb::BufferPool::GetAllocatorBulkDeallocationFlushThreshold | ( | ) |
| void duckdb::BufferPool::UpdateUsedMemory | ( | MemoryTag | tag, |
| int64_t | size ) |
| idx_t duckdb::BufferPool::GetUsedMemory | ( | bool | flush = true | ) | const |
| idx_t duckdb::BufferPool::GetMaxMemory | ( | ) | const |
|
virtual |
| TemporaryMemoryManager & duckdb::BufferPool::GetTemporaryMemoryManager | ( | ) |
|
inline |
Take per-database ObjectCache under buffer pool's memory management. Notice, object cache should be registered for at most once, otherwise InvalidInput exception is thrown.
|
protectedvirtual |
|
protectedvirtual |
|
protected |
Evict object cache entries if needed.
Purge all blocks that haven't been pinned within the last N seconds.
Do not remove this method. There are extensions that rely on time-based purging of blocks, that uses the method.
|
protected |
|
protected |
Garbage collect dead nodes in the eviction queue.

|
protected |
Add a buffer handle to the eviction queue. Returns true, if the queue is ready to be purged, and false otherwise.

|
protected |
Gets the eviction queue for the specified type.


|
protected |
Increments the dead nodes for the queue with specified type.

|
mutableprotected |
To improve performance, MemoryUsage maintains counter caches based on current cpu or thread id, and only updates the global counter when the cache value exceeds a threshold. Therefore, the statistics may have slight differences from the actual memory usage.