1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/storage/meta_block_reader.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/common/common.hpp" |
12 | #include "duckdb/common/serializer.hpp" |
13 | #include "duckdb/storage/block.hpp" |
14 | #include "duckdb/storage/buffer_manager.hpp" |
15 | |
16 | namespace duckdb { |
17 | //! This struct is responsible for reading meta data from disk |
18 | class MetaBlockReader : public Deserializer { |
19 | public: |
20 | MetaBlockReader(BufferManager &manager, block_id_t block); |
21 | |
22 | BufferManager &manager; |
23 | unique_ptr<BufferHandle> handle; |
24 | idx_t offset; |
25 | block_id_t next_block; |
26 | |
27 | public: |
28 | //! Read content of size read_size into the buffer |
29 | void ReadData(data_ptr_t buffer, idx_t read_size) override; |
30 | |
31 | private: |
32 | void ReadNewBlock(block_id_t id); |
33 | }; |
34 | } // namespace duckdb |
35 |