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

BlockManager is an abstract representation to manage blocks. When writing or reading blocks, the BlockManager creates and accesses them. The concrete types implement specific block storage strategies. More...

#include <duckdb.hpp>

Inheritance diagram for duckdb::BlockManager:
Collaboration diagram for duckdb::BlockManager:

Public Member Functions

 BlockManager (BufferManager &buffer_manager, const optional_idx block_alloc_size_p, const optional_idx block_header_size_p)
BufferManager & GetBufferManager () const
virtual unique_ptr< Block > ConvertBlock (block_id_t block_id, FileBuffer &source_buffer)=0
 Creates a new block inside the block manager.
virtual unique_ptr< Block > CreateBlock (block_id_t block_id, FileBuffer *source_buffer)=0
virtual block_id_t GetFreeBlockId ()=0
 Return the next free block id.
virtual block_id_t PeekFreeBlockId ()=0
virtual block_id_t GetFreeBlockIdForCheckpoint ()=0
 Returns the next free block id and immediately include it in the checkpoint.
virtual bool IsRootBlock (MetaBlockPointer root)=0
 Returns whether or not a specified block is the root block.
virtual void MarkBlockAsCheckpointed (block_id_t block_id)=0
 Mark a block as included in the next checkpoint.
virtual void MarkBlockAsUsed (block_id_t block_id)=0
 Mark a block as "used"; either the block is removed from the free list, or the reference count is incremented.
virtual void MarkBlockAsModified (block_id_t block_id)=0
 Mark a block as "modified"; modified blocks are added to the free list after a checkpoint (i.e. their data is assumed to be rewritten).
virtual void IncreaseBlockReferenceCount (block_id_t block_id)=0
 Increase the reference count of a block. The block should hold at least one reference before this method is called.
virtual idx_t GetMetaBlock ()=0
 Get the first meta block id.
virtual void Read (QueryContext context, Block &block)=0
 Read the content of the block from disk.
virtual void ReadBlocks (FileBuffer &buffer, block_id_t start_block, idx_t block_count)=0
 Read the content of the block from disk.
virtual void Write (FileBuffer &block, block_id_t block_id)=0
 Writes the block to disk.
virtual void Write (QueryContext context, FileBuffer &block, block_id_t block_id)
void Write (Block &block)
 Writes the block to disk.
virtual void WriteHeader (QueryContext context, DatabaseHeader header)=0
 Write the header; should be the final step of a checkpoint.
virtual idx_t TotalBlocks ()=0
 Returns the number of total blocks.
virtual idx_t FreeBlocks ()=0
 Returns the number of free blocks.
virtual bool IsRemote ()
 Whether or not the attached database is a remote file (e.g. attached over s3/https).
virtual bool InMemory ()=0
 Whether or not the attached database is in-memory.
virtual bool Prefetch ()
 Whether or not to prefetch.
virtual void FileSync ()=0
 Sync changes made to the block manager.
virtual void Truncate ()
 Truncate the underlying database file after a checkpoint.
shared_ptr< BlockHandle > RegisterBlock (block_id_t block_id)
 Register a block with the given block id in the base file.
shared_ptr< BlockHandle > ConvertToPersistent (QueryContext context, block_id_t block_id, shared_ptr< BlockHandle > old_block, BufferHandle old_handle, ConvertToPersistentMode mode=ConvertToPersistentMode::DESTRUCTIVE)
 Convert an existing in-memory buffer into a persistent disk-backed block If mode is set to destructive (default) - the old_block will be destroyed as part of this method This can only be safely used when there is no other (lingering) usage of old_block If there is concurrent usage of the block elsewhere - use the THREAD_SAFE mode which creates an extra copy.
shared_ptr< BlockHandle > ConvertToPersistent (QueryContext context, block_id_t block_id, shared_ptr< BlockHandle > old_block, ConvertToPersistentMode mode=ConvertToPersistentMode::DESTRUCTIVE)
void UnregisterPersistentBlock (BlockHandle &block)
virtual void UnregisterBlock (block_id_t id)
 UnregisterBlock, only accepts non-temporary block ids.
MetadataManager & GetMetadataManager ()
 Returns a reference to the metadata manager of this block manager.
idx_t GetBlockAllocSize () const
 Returns the block allocation size of this block manager.
optional_idx GetOptionalBlockAllocSize () const
 Returns the possibly invalid block allocation size of this block manager.
optional_idx GetOptionalBlockHeaderSize () const
 Returns the possibly invalid block header size of this block manager.
idx_t GetBlockHeaderSize () const
 Returns the block header size including the 8-byte checksum of this block manager.
idx_t GetBlockSize () const
 Returns the size of the block that is available for usage.
void SetBlockAllocSize (const optional_idx block_alloc_size_p)
 Sets the block allocation size. This should only happen when initializing an existing database. When initializing an existing database, we construct the block manager before reading the file header, which contains the file's actual block allocation size.
void SetBlockHeaderSize (const optional_idx block_header_size_p)
 Sets the block header size. Idem as above. This is only set once upon initialization of the database For now this method is unused.
virtual void VerifyBlocks (const unordered_map< block_id_t, idx_t > &block_usage_count)
 Verify the block usage count.
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

BufferManager & buffer_manager
 The buffer manager.

Protected Member Functions

bool BlockIsRegistered (block_id_t block_id)
shared_ptr< BlockHandle > TryGetBlock (block_id_t block_id)

Protected Attributes

bool in_destruction = false
 A flag to be flipped in the destructor of the subclass, which is called first. Relevant for some Windows edge cases.

Private Attributes

mutex blocks_lock
 The lock for the set of blocks.
unordered_map< block_id_t, weak_ptr< BlockHandle > > blocks
 A mapping of block id -> BlockHandle.
unique_ptr< MetadataManager > metadata_manager
 The metadata manager.
optional_idx block_alloc_size
 The allocation size of blocks managed by this block manager. Defaults to DEFAULT_BLOCK_ALLOC_SIZE for in-memory block managers. Default to default_block_alloc_size for file-backed block managers. This is NOT the actual memory available on a block (block_size).
optional_idx block_header_size
 The size of the block headers (including checksum) in this block manager. Defaults to DEFAULT_BLOCK_HEADER_SIZE for in-memory block managers. Defaults to default_block_header_size for file-backed block managers.

Detailed Description

BlockManager is an abstract representation to manage blocks. When writing or reading blocks, the BlockManager creates and accesses them. The concrete types implement specific block storage strategies.

Constructor & Destructor Documentation

◆ BlockManager()

duckdb::BlockManager::BlockManager ( BufferManager & buffer_manager,
const optional_idx block_alloc_size_p,
const optional_idx block_header_size_p )
387029 : buffer_manager(buffer_manager), metadata_manager(make_uniq<MetadataManager>(*this, buffer_manager)),
387030 block_alloc_size(block_alloc_size_p), block_header_size(block_header_size_p) {
387031}
optional_idx block_alloc_size
The allocation size of blocks managed by this block manager. Defaults to DEFAULT_BLOCK_ALLOC_SIZE for...
Definition duckdb.hpp:45375
optional_idx block_header_size
The size of the block headers (including checksum) in this block manager. Defaults to DEFAULT_BLOCK_H...
Definition duckdb.hpp:45379
BufferManager & buffer_manager
The buffer manager.
Definition duckdb.hpp:45214
unique_ptr< MetadataManager > metadata_manager
The metadata manager.
Definition duckdb.hpp:45371

Member Function Documentation

◆ GetBufferManager()

BufferManager & duckdb::BlockManager::GetBufferManager ( ) const
inline
45217 {
45218 return buffer_manager;
45219 }

◆ ConvertBlock()

virtual unique_ptr< Block > duckdb::BlockManager::ConvertBlock ( block_id_t block_id,
FileBuffer & source_buffer )
pure virtual

Creates a new block inside the block manager.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

Here is the caller graph for this function:

◆ GetFreeBlockId()

virtual block_id_t duckdb::BlockManager::GetFreeBlockId ( )
pure virtual

Return the next free block id.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ PeekFreeBlockId()

virtual block_id_t duckdb::BlockManager::PeekFreeBlockId ( )
pure virtual

◆ GetFreeBlockIdForCheckpoint()

virtual block_id_t duckdb::BlockManager::GetFreeBlockIdForCheckpoint ( )
pure virtual

Returns the next free block id and immediately include it in the checkpoint.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ IsRootBlock()

virtual bool duckdb::BlockManager::IsRootBlock ( MetaBlockPointer root)
pure virtual

Returns whether or not a specified block is the root block.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ MarkBlockAsCheckpointed()

virtual void duckdb::BlockManager::MarkBlockAsCheckpointed ( block_id_t block_id)
pure virtual

Mark a block as included in the next checkpoint.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ MarkBlockAsUsed()

virtual void duckdb::BlockManager::MarkBlockAsUsed ( block_id_t block_id)
pure virtual

Mark a block as "used"; either the block is removed from the free list, or the reference count is incremented.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ MarkBlockAsModified()

virtual void duckdb::BlockManager::MarkBlockAsModified ( block_id_t block_id)
pure virtual

Mark a block as "modified"; modified blocks are added to the free list after a checkpoint (i.e. their data is assumed to be rewritten).

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ IncreaseBlockReferenceCount()

virtual void duckdb::BlockManager::IncreaseBlockReferenceCount ( block_id_t block_id)
pure virtual

Increase the reference count of a block. The block should hold at least one reference before this method is called.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ GetMetaBlock()

virtual idx_t duckdb::BlockManager::GetMetaBlock ( )
pure virtual

Get the first meta block id.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ Read()

virtual void duckdb::BlockManager::Read ( QueryContext context,
Block & block )
pure virtual

Read the content of the block from disk.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ ReadBlocks()

virtual void duckdb::BlockManager::ReadBlocks ( FileBuffer & buffer,
block_id_t start_block,
idx_t block_count )
pure virtual

Read the content of the block from disk.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ Write() [1/3]

virtual void duckdb::BlockManager::Write ( FileBuffer & block,
block_id_t block_id )
pure virtual

Writes the block to disk.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

Here is the caller graph for this function:

◆ Write() [2/3]

void duckdb::BlockManager::Write ( QueryContext context,
FileBuffer & block,
block_id_t block_id )
virtual

Reimplemented in duckdb::SingleFileBlockManager.

387159 {
387160 // Fallback to the old Write.
387161 Write(block, block_id);
387162}
virtual void Write(FileBuffer &block, block_id_t block_id)=0
Writes the block to disk.

◆ Write() [3/3]

void duckdb::BlockManager::Write ( Block & block)
inline

Writes the block to disk.

45253 {
45254 Write(block, block.id);
45255 }
Here is the call graph for this function:

◆ WriteHeader()

virtual void duckdb::BlockManager::WriteHeader ( QueryContext context,
DatabaseHeader header )
pure virtual

Write the header; should be the final step of a checkpoint.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ TotalBlocks()

virtual idx_t duckdb::BlockManager::TotalBlocks ( )
pure virtual

Returns the number of total blocks.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ FreeBlocks()

virtual idx_t duckdb::BlockManager::FreeBlocks ( )
pure virtual

Returns the number of free blocks.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ IsRemote()

virtual bool duckdb::BlockManager::IsRemote ( )
inlinevirtual

Whether or not the attached database is a remote file (e.g. attached over s3/https).

Reimplemented in duckdb::SingleFileBlockManager.

45264 {
45265 return false;
45266 }

◆ InMemory()

virtual bool duckdb::BlockManager::InMemory ( )
pure virtual

Whether or not the attached database is in-memory.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ Prefetch()

virtual bool duckdb::BlockManager::Prefetch ( )
inlinevirtual

Whether or not to prefetch.

Reimplemented in duckdb::SingleFileBlockManager.

45270 {
45271 return false;
45272 }

◆ FileSync()

virtual void duckdb::BlockManager::FileSync ( )
pure virtual

Sync changes made to the block manager.

Implemented in duckdb::InMemoryBlockManager, and duckdb::SingleFileBlockManager.

◆ Truncate()

void duckdb::BlockManager::Truncate ( )
virtual

Truncate the underlying database file after a checkpoint.

Reimplemented in duckdb::SingleFileBlockManager.

387164 {
387165}
Here is the caller graph for this function:

◆ RegisterBlock()

shared_ptr< BlockHandle > duckdb::BlockManager::RegisterBlock ( block_id_t block_id)

Register a block with the given block id in the base file.

it hasn't! return it

387056 {
387057 lock_guard<mutex> lock(blocks_lock);
387058 // check if the block already exists
387059 auto entry = blocks.find(block_id);
387060 if (entry != blocks.end()) {
387061 // already exists: check if it hasn't expired yet
387062 auto existing_ptr = entry->second.lock();
387063 if (existing_ptr) {
387065 return existing_ptr;
387066 }
387067 }
387068 // create a new block pointer for this block
387069 auto result = make_shared_ptr<BlockHandle>(*this, block_id, MemoryTag::BASE_TABLE);
387070 // register the block pointer in the set of blocks as a weak pointer
387071 blocks[block_id] = weak_ptr<BlockHandle>(result);
387072 return result;
387073}
unordered_map< block_id_t, weak_ptr< BlockHandle > > blocks
A mapping of block id -> BlockHandle.
Definition duckdb.hpp:45369
mutex blocks_lock
The lock for the set of blocks.
Definition duckdb.hpp:45367
Here is the caller graph for this function:

◆ ConvertToPersistent() [1/2]

shared_ptr< BlockHandle > duckdb::BlockManager::ConvertToPersistent ( QueryContext context,
block_id_t block_id,
shared_ptr< BlockHandle > old_block,
BufferHandle old_handle,
ConvertToPersistentMode mode = ConvertToPersistentMode::DESTRUCTIVE )

Convert an existing in-memory buffer into a persistent disk-backed block If mode is set to destructive (default) - the old_block will be destroyed as part of this method This can only be safely used when there is no other (lingering) usage of old_block If there is concurrent usage of the block elsewhere - use the THREAD_SAFE mode which creates an extra copy.

387077 {
387078 // register a block with the new block id
387079 auto new_block = RegisterBlock(block_id);
387080 D_ASSERT(new_block->GetMemory().GetState() == BlockState::BLOCK_UNLOADED);
387081 D_ASSERT(new_block->GetMemory().GetReaders() == 0);
387082
387083 if (mode == ConvertToPersistentMode::THREAD_SAFE) {
387084 // safe mode - create a copy of the old block and operate on that
387085 // this ensures we don't modify the old block - which allows other concurrent operations on the old block to
387086 // continue
387087 auto old_block_copy = buffer_manager.AllocateMemory(old_block->GetMemory().GetMemoryTag(), this, false);
387088 auto copy_pin = buffer_manager.Pin(old_block_copy);
387089 memcpy(copy_pin.Ptr(), old_handle.Ptr(), GetBlockSize());
387090 old_block = std::move(old_block_copy);
387091 old_handle = std::move(copy_pin);
387092 }
387093
387094 auto &old_block_memory = old_block->GetMemory();
387095 auto lock = old_block_memory.GetLock();
387096 D_ASSERT(old_block_memory.GetState() == BlockState::BLOCK_LOADED);
387097 D_ASSERT(old_block_memory.GetBuffer(lock));
387098 if (old_block_memory.GetReaders() > 1) {
387099 throw InternalException(
387100 "BlockManager::ConvertToPersistent in destructive mode - cannot be called for block %d as old_block has "
387101 "multiple readers active",
387102 block_id);
387103 }
387104
387105 // Temp buffers can be larger than the storage block size.
387106 // But persistent buffers cannot.
387107 D_ASSERT(old_block_memory.GetBuffer(lock)->AllocSize() <= GetBlockAllocSize());
387108
387109 // convert the buffer to a block
387110 auto converted_buffer = ConvertBlock(block_id, *old_block_memory.GetBuffer(lock));
387111
387112 // persist the new block to disk
387113 Write(context, *converted_buffer, block_id);
387114
387115 // now convert the actual block
387116 old_block_memory.ConvertToPersistent(lock, *new_block, std::move(converted_buffer));
387117
387118 // destroy the old buffer
387119 lock.unlock();
387120 old_handle.Destroy();
387121 old_block.reset();
387122
387123 // potentially purge the queue
387124 auto purge_queue = buffer_manager.GetBufferPool().AddToEvictionQueue(new_block);
387125 if (purge_queue) {
387126 buffer_manager.GetBufferPool().PurgeQueue(*new_block);
387127 }
387128 return new_block;
387129}
virtual unique_ptr< Block > ConvertBlock(block_id_t block_id, FileBuffer &source_buffer)=0
Creates a new block inside the block manager.
idx_t GetBlockAllocSize() const
Returns the block allocation size of this block manager.
Definition duckdb.hpp:45300
idx_t GetBlockSize() const
Returns the size of the block that is available for usage.
Definition duckdb.hpp:45319
shared_ptr< BlockHandle > RegisterBlock(block_id_t block_id)
Register a block with the given block id in the base file.
Definition duckdb.cpp:387056
Here is the call graph for this function:

◆ ConvertToPersistent() [2/2]

shared_ptr< BlockHandle > duckdb::BlockManager::ConvertToPersistent ( QueryContext context,
block_id_t block_id,
shared_ptr< BlockHandle > old_block,
ConvertToPersistentMode mode = ConvertToPersistentMode::DESTRUCTIVE )
387133 {
387134 // pin the old block to ensure we have it loaded in memory
387135 auto handle = buffer_manager.Pin(old_block);
387136 return ConvertToPersistent(context, block_id, std::move(old_block), std::move(handle), mode);
387137}
shared_ptr< BlockHandle > ConvertToPersistent(QueryContext context, block_id_t block_id, shared_ptr< BlockHandle > old_block, BufferHandle old_handle, ConvertToPersistentMode mode=ConvertToPersistentMode::DESTRUCTIVE)
Convert an existing in-memory buffer into a persistent disk-backed block If mode is set to destructiv...
Definition duckdb.cpp:387075

◆ UnregisterPersistentBlock()

void duckdb::BlockManager::UnregisterPersistentBlock ( BlockHandle & block)
387146 {
387147 if (in_destruction) {
387148 return;
387149 }
387150 auto id = block.BlockId();
387151 D_ASSERT(id < MAXIMUM_BLOCK);
387152 UnregisterBlock(id);
387153}
virtual void UnregisterBlock(block_id_t id)
UnregisterBlock, only accepts non-temporary block ids.
Definition duckdb.cpp:387139
bool in_destruction
A flag to be flipped in the destructor of the subclass, which is called first. Relevant for some Wind...
Definition duckdb.hpp:45363

◆ UnregisterBlock()

void duckdb::BlockManager::UnregisterBlock ( block_id_t id)
virtual

UnregisterBlock, only accepts non-temporary block ids.

Reimplemented in duckdb::SingleFileBlockManager.

387139 {
387140 D_ASSERT(id < MAXIMUM_BLOCK);
387141 lock_guard<mutex> lock(blocks_lock);
387142 // on-disk block: erase from list of blocks in manager
387143 blocks.erase(id);
387144}
Here is the caller graph for this function:

◆ GetMetadataManager()

MetadataManager & duckdb::BlockManager::GetMetadataManager ( )

Returns a reference to the metadata manager of this block manager.

387155 {
387156 return *metadata_manager;
387157}
Here is the caller graph for this function:

◆ GetBlockAllocSize()

idx_t duckdb::BlockManager::GetBlockAllocSize ( ) const
inline

Returns the block allocation size of this block manager.

45300 {
45301 return block_alloc_size.GetIndex();
45302 }
Here is the caller graph for this function:

◆ GetOptionalBlockAllocSize()

optional_idx duckdb::BlockManager::GetOptionalBlockAllocSize ( ) const
inline

Returns the possibly invalid block allocation size of this block manager.

45304 {
45305 return block_alloc_size;
45306 }
Here is the caller graph for this function:

◆ GetOptionalBlockHeaderSize()

optional_idx duckdb::BlockManager::GetOptionalBlockHeaderSize ( ) const
inline

Returns the possibly invalid block header size of this block manager.

45308 {
45309 return block_header_size;
45310 }

◆ GetBlockHeaderSize()

idx_t duckdb::BlockManager::GetBlockHeaderSize ( ) const
inline

Returns the block header size including the 8-byte checksum of this block manager.

45312 {
45313 if (!block_header_size.IsValid()) {
45315 }
45316 return block_header_size.GetIndex();
45317 }
static constexpr idx_t DEFAULT_BLOCK_HEADER_SIZE
The default block header size for blocks written to storage.
Definition duckdb.hpp:9716
Here is the caller graph for this function:

◆ GetBlockSize()

idx_t duckdb::BlockManager::GetBlockSize ( ) const
inline

Returns the size of the block that is available for usage.

45319 {
45320 return block_alloc_size.GetIndex() - block_header_size.GetIndex();
45321 }
Here is the caller graph for this function:

◆ SetBlockAllocSize()

void duckdb::BlockManager::SetBlockAllocSize ( const optional_idx block_alloc_size_p)
inline

Sets the block allocation size. This should only happen when initializing an existing database. When initializing an existing database, we construct the block manager before reading the file header, which contains the file's actual block allocation size.

45325 {
45326 if (block_alloc_size.IsValid()) {
45327 throw InternalException("the block allocation size must be set once");
45328 }
45329 block_alloc_size = block_alloc_size_p.GetIndex();
45330 }
Here is the caller graph for this function:

◆ SetBlockHeaderSize()

void duckdb::BlockManager::SetBlockHeaderSize ( const optional_idx block_header_size_p)
inline

Sets the block header size. Idem as above. This is only set once upon initialization of the database For now this method is unused.

45334 {
45335 if (block_header_size.IsValid()) {
45336 throw InternalException("block header size already set, must be set once");
45337 }
45338 block_header_size = block_header_size_p.GetIndex();
45339 }

◆ VerifyBlocks()

virtual void duckdb::BlockManager::VerifyBlocks ( const unordered_map< block_id_t, idx_t > & block_usage_count)
inlinevirtual

Verify the block usage count.

Reimplemented in duckdb::SingleFileBlockManager.

45341 {
45342 }

◆ BlockIsRegistered()

bool duckdb::BlockManager::BlockIsRegistered ( block_id_t block_id)
protected
387033 {
387034 lock_guard<mutex> lock(blocks_lock);
387035 // check if the block already exists
387036 auto entry = blocks.find(block_id);
387037 if (entry == blocks.end()) {
387038 return false;
387039 }
387040 // already exists: check if it hasn't expired yet
387041 return !entry->second.expired();
387042}

◆ TryGetBlock()

shared_ptr< BlockHandle > duckdb::BlockManager::TryGetBlock ( block_id_t block_id)
protected
387044 {
387045 lock_guard<mutex> lock(blocks_lock);
387046 // check if the block already exists
387047 auto entry = blocks.find(block_id);
387048 if (entry == blocks.end()) {
387049 // the block does not exist
387050 return nullptr;
387051 }
387052 // the block exists - try to lock it
387053 return entry->second.lock();
387054}

◆ Cast() [1/2]

template<class TARGET>
TARGET & duckdb::BlockManager::Cast ( )
inline
45350 {
45351 DynamicCastCheck<TARGET>(this);
45352 return reinterpret_cast<TARGET &>(*this);
45353 }

◆ Cast() [2/2]

template<class TARGET>
const TARGET & duckdb::BlockManager::Cast ( ) const
inline
45355 {
45356 DynamicCastCheck<TARGET>(this);
45357 return reinterpret_cast<const TARGET &>(*this);
45358 }

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