|
|
| 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 |
| |
| virtual void | IncreaseBlockReferenceCount (block_id_t block_id)=0 |
| |
|
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) |
| |
|
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) |
| |
| void | SetBlockHeaderSize (const optional_idx block_header_size_p) |
| |
| 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 |
| |
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.