31#ifndef ddl0impl_file_reader_h
32#define ddl0impl_file_reader_h
123 using Bounds = std::pair<const byte *, const byte *>;
Captures ownership and manages lifetime of an already opened OS file descriptor.
Definition: ddl0ddl.h:160
bool is_open() const
Definition: ddl0ddl.h:178
A utility class which, if inherited from, prevents the descendant class from being copied,...
Definition: ut0class_life_cycle.h:40
dberr_t
Definition: db0err.h:38
DDL buffer infrastrucure.
The general architecture is that the work is done in two phases, roughly the read and write phase.
Definition: btr0load.cc:41
byte mrec_t
Merge record in Aligned_buffer.
Definition: ddl0ddl.h:77
std::pair< byte *, os_offset_t > IO_buffer
Block size for DDL I/O operations.
Definition: ddl0impl.h:46
size_t buffer_size(const ConstBufferSequence &buffers) noexcept
Definition: buffer.h:314
Definition: varlen_sort.h:183
This file contains a set of libraries providing overloads for regular dynamic allocation routines whi...
Definition: aligned_alloc.h:47
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2872
void delete_arr(T *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::new_arr*() variants.
Definition: ut0new.h:1107
uint64_t os_offset_t
File offset in bytes.
Definition: os0file.h:83
Buffer used for reading and writing to the temporary files.
Definition: ddl0impl-buffer.h:82
For loading indexes.
Definition: ddl0impl-builder.h:47
Read rows from the temporary file.
Definition: ddl0impl-file-reader.h:42
std::vector< ulint, ut::allocator< ulint > > Offsets
Definition: ddl0impl-file-reader.h:108
uint64_t m_n_rows_read
Number of rows read from the file.
Definition: ddl0impl-file-reader.h:150
void set_offset(os_offset_t offset) noexcept
Set the range or rows to traverse.
Definition: ddl0impl-file-reader.h:83
Bounds m_bounds
File buffer bounds.
Definition: ddl0impl-file-reader.h:135
size_t m_buffer_size
IO buffer size in bytes.
Definition: ddl0impl-file-reader.h:141
os_offset_t m_offset
Offset to read.
Definition: ddl0impl-file-reader.h:129
uint64_t get_n_rows_read() const noexcept
Definition: ddl0impl-file-reader.h:89
dberr_t read(os_offset_t offset) noexcept
Seek to the offset and read the page in.
Definition: ddl0file-reader.cc:106
const byte * m_ptr
Pointer current offset within file buffer.
Definition: ddl0impl-file-reader.h:132
const Unique_os_file_descriptor & m_file
File handle to read from.
Definition: ddl0impl-file-reader.h:120
dberr_t seek(os_offset_t offset) noexcept
Seek to the start of the range and load load the page.
Definition: ddl0file-reader.cc:93
byte * m_aux_buf
Auxiliary buffer for records that span across pages.
Definition: ddl0impl-file-reader.h:138
dict_index_t * m_index
Index that the records belong to.
Definition: ddl0impl-file-reader.h:111
bool eof() const noexcept
Definition: ddl0impl-file-reader.h:86
Aligned_buffer m_aligned_buffer
Aligned IO buffer.
Definition: ddl0impl-file-reader.h:144
friend File_cursor
Definition: ddl0impl-file-reader.h:152
const mrec_t * m_mrec
Pointer to current row.
Definition: ddl0impl-file-reader.h:114
dberr_t next() noexcept
Advance the "cursor".
Definition: ddl0file-reader.cc:122
dberr_t get_tuple(Builder *builder, mem_heap_t *heap, dtuple_t *&dtuple) noexcept
The current row as a tuple.
Definition: ddl0builder.cc:234
IO_buffer m_io_buffer
File buffer for reading.
Definition: ddl0impl-file-reader.h:147
~File_reader() noexcept
Destructor.
Definition: ddl0impl-file-reader.h:58
dberr_t read_next() noexcept
Advance page number to the next and read in.
Definition: ddl0file-reader.cc:117
os_offset_t m_size
Size of the file in bytes.
Definition: ddl0impl-file-reader.h:126
Offsets m_offsets
Columns offsets.
Definition: ddl0impl-file-reader.h:117
File_reader(const Unique_os_file_descriptor &file, dict_index_t *index, size_t buffer_size, os_offset_t size) noexcept
Constructor.
Definition: ddl0impl-file-reader.h:48
std::pair< const byte *, const byte * > Bounds
Definition: ddl0impl-file-reader.h:123
dberr_t prepare() noexcept
Prepare the file for reading.
Definition: ddl0file-reader.cc:38
Data structure for an index.
Definition: dict0mem.h:1045
Structure for an SQL data tuple of fields (logical record)
Definition: data0data.h:681
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:301
unsigned long int ulint
Definition: univ.i:405
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:56