MySQL 8.0.40
Source Code Documentation
|
Read rows from the temporary file. More...
#include <ddl0impl-file-reader.h>
Public Types | |
using | Offsets = std::vector< ulint, ut::allocator< ulint > > |
Public Member Functions | |
File_reader (const Unique_os_file_descriptor &file, dict_index_t *index, size_t buffer_size, const Range &range) noexcept | |
Constructor. More... | |
~File_reader () noexcept | |
Destructor. More... | |
dberr_t | prepare () noexcept |
Prepare the file for reading. More... | |
dberr_t | get_tuple (Builder *builder, mem_heap_t *heap, dtuple_t *&dtuple) noexcept |
The current row as a tuple. More... | |
dberr_t | read (const Range &range) noexcept |
Set the start and end offsets to read from, to avoid the possibility of overlapping reads from the other ranges in subsequent reads. More... | |
bool | end_of_range () const noexcept |
uint64_t | get_n_rows_read () const noexcept |
Public Attributes | |
dict_index_t * | m_index {} |
Index that the records belong to. More... | |
const mrec_t * | m_mrec {} |
Pointer to current row. More... | |
Offsets | m_field_offsets {} |
Columns offsets. More... | |
const Unique_os_file_descriptor & | m_file |
File handle to read from. More... | |
Private Types | |
using | Bounds = std::pair< const byte *, const byte * > |
Private Member Functions | |
dberr_t | seek () noexcept |
Read the page in the file buffer from the start offset, and reset the cursor to the beginning of the file buffer. More... | |
dberr_t | read_next () noexcept |
Advance page number to the next and read in. More... | |
dberr_t | next () noexcept |
Advance the "cursor". More... | |
Private Member Functions inherited from ut::Non_copyable | |
Non_copyable (const Non_copyable &)=delete | |
Non_copyable & | operator= (const Non_copyable &)=delete |
Non_copyable ()=default | |
~Non_copyable ()=default | |
Private Attributes | |
Range | m_range {} |
const byte * | m_ptr {} |
Pointer current offset within file buffer. More... | |
Bounds | m_bounds {} |
File buffer bounds. More... | |
byte * | m_aux_buf {} |
Auxiliary buffer for records that span across pages. More... | |
size_t | m_buffer_size {} |
IO buffer size in bytes. More... | |
ut::unique_ptr_aligned< byte[]> | m_aligned_buffer {} |
Aligned IO buffer. More... | |
IO_buffer | m_io_buffer {} |
File buffer for reading. More... | |
uint64_t | m_n_rows_read {} |
Number of rows read from the file. More... | |
friend | File_cursor |
Read rows from the temporary file.
Rows could be read in the from of chunks or ranges.
|
private |
using ddl::File_reader::Offsets = std::vector<ulint, ut::allocator<ulint> > |
|
inlinenoexcept |
Constructor.
[in] | file | Opened file. |
[in,out] | index | Index that the rows belong to. |
[in] | buffer_size | Size of file buffer for reading. |
[in] | range | Offsets of the chunk to read |
|
inlinenoexcept |
Destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
The current row as a tuple.
Note: the tuple only does a shallow copy.
[in,out] | builder | Index builder instance. |
[in,out] | heap | Heap to use for allocation. |
[out] | dtuple | Row converted to a tuple. |
|
privatenoexcept |
Advance the "cursor".
|
noexcept |
Prepare the file for reading.
Set the start and end offsets to read from, to avoid the possibility of overlapping reads from the other ranges in subsequent reads.
Seek to the start offset, read the page and, position to the first record on the page
[in] | range | Start and end offsets of the range to read from. |
|
privatenoexcept |
Advance page number to the next and read in.
|
privatenoexcept |
Read the page in the file buffer from the start offset, and reset the cursor to the beginning of the file buffer.
|
private |
|
private |
Aligned IO buffer.
|
private |
Auxiliary buffer for records that span across pages.
|
private |
File buffer bounds.
|
private |
IO buffer size in bytes.
Offsets ddl::File_reader::m_field_offsets {} |
Columns offsets.
const Unique_os_file_descriptor& ddl::File_reader::m_file |
File handle to read from.
dict_index_t* ddl::File_reader::m_index {} |
Index that the records belong to.
|
private |
File buffer for reading.
const mrec_t* ddl::File_reader::m_mrec {} |
Pointer to current row.
|
private |
Number of rows read from the file.
|
private |
Pointer current offset within file buffer.
|
private |