MySQL 8.4.0
Source Code Documentation
ddl::Merge_file_sort::Cursor Struct Reference

Cursor for merging blocks from the same file. More...

Inheritance diagram for ddl::Merge_file_sort::Cursor:
[legend]

Public Member Functions

 Cursor (Builder *builder, file_t *file, Dup *dup, Alter_stage *stage) noexcept
 Constructor. More...
 
dberr_t prepare (Range range, size_t buffer_size) noexcept
 Prepare the cursor for reading. More...
 
dberr_t fetch (const mrec_t *&mrec, ulint *&offsets) noexcept
 Fetch the next record. More...
 
dberr_t next () noexcept
 Move to the next record. More...
 
dberr_t seek (const file_t *file, Range range) noexcept
 Move the cursor to the start of the new records lists to merge. More...
 
size_t size () const noexcept
 

Private Attributes

file_tm_file {}
 File to iterate over. More...
 
Merge_cursor m_cursor
 Cursor to use for the merge. More...
 

Additional Inherited Members

- Private Member Functions inherited from ut::Non_copyable
 Non_copyable (const Non_copyable &)=delete
 
Non_copyableoperator= (const Non_copyable &)=delete
 
 Non_copyable ()=default
 
 ~Non_copyable ()=default
 

Detailed Description

Cursor for merging blocks from the same file.

Constructor & Destructor Documentation

◆ Cursor()

ddl::Merge_file_sort::Cursor::Cursor ( Builder builder,
file_t file,
Dup dup,
Alter_stage stage 
)
inlinenoexcept

Constructor.

Parameters
[in,out]builderIndex builder instance.
[in]fileFile to iterate over.
[in,out]dupFor reporting duplicates.
[in,out]stagePFS staging.

Member Function Documentation

◆ fetch()

dberr_t ddl::Merge_file_sort::Cursor::fetch ( const mrec_t *&  mrec,
ulint *&  offsets 
)
noexcept

Fetch the next record.

Parameters
[out]mrecRow read from the file.
[out]offsetsColumn offsets inside mrec.
Returns
DB_SUCCESS or error code.

◆ next()

dberr_t ddl::Merge_file_sort::Cursor::next ( void  )
noexcept

Move to the next record.

Returns
DB_SUCCESS, DB_END_OF_INDEX or error code.

◆ prepare()

dberr_t ddl::Merge_file_sort::Cursor::prepare ( Range  range,
size_t  buffer_size 
)
noexcept

Prepare the cursor for reading.

Parameters
[in]rangeRanges to merge in a pass.
[in]buffer_sizeIO Buffer size to use for reading.
Returns
DB_SUCCESS or error code.

◆ seek()

dberr_t ddl::Merge_file_sort::Cursor::seek ( const file_t file,
Range  range 
)
noexcept

Move the cursor to the start of the new records lists to merge.

Parameters
[in]fileFile being scanned.
[in]rangeSeek to these offsets.
Returns
DB_SUCCESS or error code.

◆ size()

size_t ddl::Merge_file_sort::Cursor::size ( ) const
inlinenoexcept
Returns
the number of active readers.

Member Data Documentation

◆ m_cursor

Merge_cursor ddl::Merge_file_sort::Cursor::m_cursor
private

Cursor to use for the merge.

◆ m_file

file_t* ddl::Merge_file_sort::Cursor::m_file {}
private

File to iterate over.


The documentation for this struct was generated from the following file: