|
| unique_ptr< Block > | ConvertBlock (block_id_t block_id, FileBuffer &source_buffer) override |
| | Creates a new block inside the block manager.
|
| unique_ptr< Block > | CreateBlock (block_id_t block_id, FileBuffer *source_buffer) override |
| block_id_t | GetFreeBlockId () override |
| | Return the next free block id.
|
| block_id_t | GetFreeBlockIdForCheckpoint () override |
| | Returns the next free block id and immediately include it in the checkpoint.
|
| block_id_t | PeekFreeBlockId () override |
| bool | IsRootBlock (MetaBlockPointer root) override |
| | Returns whether or not a specified block is the root block.
|
| void | MarkBlockAsCheckpointed (block_id_t block_id) override |
| | Mark a block as included in the next checkpoint.
|
| void | MarkBlockAsUsed (block_id_t block_id) override |
| | Mark a block as "used"; either the block is removed from the free list, or the reference count is incremented.
|
| void | MarkBlockAsModified (block_id_t block_id) override |
| | 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).
|
| void | IncreaseBlockReferenceCount (block_id_t block_id) override |
| | Increase the reference count of a block. The block should hold at least one reference before this method is called.
|
| idx_t | GetMetaBlock () override |
| | Get the first meta block id.
|
| void | Read (QueryContext context, Block &block) override |
| | Read the content of the block from disk.
|
| void | ReadBlocks (FileBuffer &buffer, block_id_t start_block, idx_t block_count) override |
| | Read the content of the block from disk.
|
| void | Write (FileBuffer &block, block_id_t block_id) override |
| | Writes the block to disk.
|
| void | Write (QueryContext context, FileBuffer &block, block_id_t block_id) override |
| void | WriteHeader (QueryContext context, DatabaseHeader header) override |
| | Write the header; should be the final step of a checkpoint.
|
| bool | InMemory () override |
| | Whether or not the attached database is in-memory.
|
| void | FileSync () override |
| | Sync changes made to the block manager.
|
| idx_t | TotalBlocks () override |
| | Returns the number of total blocks.
|
| idx_t | FreeBlocks () override |
| | Returns the number of free blocks.
|
|
| BlockManager ()=delete |
| | BlockManager (BufferManager &buffer_manager, const optional_idx block_alloc_size_p, const optional_idx block_header_size_p) |
| | BlockManager (BufferManager &buffer_manager, const optional_idx block_alloc_size_p, const optional_idx block_header_size_p) |
| BufferManager & | GetBufferManager () const |
| void | Write (Block &block) |
| | Writes the block to disk.
|
| virtual bool | IsRemote () |
| | Whether or not the attached database is a remote file (e.g. attached over s3/https).
|
| virtual bool | Prefetch () |
| | Whether or not to prefetch.
|
| 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 |