MySQL 9.1.0
Source Code Documentation
ddl::File_cursor Struct Reference

For loading a Btree index from a file. More...

Inheritance diagram for ddl::File_cursor:
[legend]

Public Member Functions

 File_cursor (Builder *builder, const Unique_os_file_descriptor &file, size_t buffer_size, const Range &range, Alter_stage *stage) noexcept
 Constructor. More...
 
 ~File_cursor () override
 Destructor. More...
 
dberr_t open () noexcept
 Open the cursor. More...
 
dberr_t fetch (dtuple_t *&dtuple) noexcept override
 Fetch the current row as a tuple. More...
 
dberr_t fetch (const mrec_t *&mrec, ulint *&offsets) noexcept
 Fetch the current row. More...
 
dberr_t next () noexcept override
 Move to the next record. More...
 
- Public Member Functions inherited from ddl::Load_cursor
 Load_cursor (Builder *builder, Dup *dup) noexcept
 Default constructor. More...
 
virtual ~Load_cursor () override=default
 Default destructor. More...
 
dberr_t get_err () const noexcept
 
bool duplicates_detected () const noexcept override
 
- Public Member Functions inherited from Btree_load::Cursor
 Cursor ()=default
 Constructor. More...
 
virtual ~Cursor ()=default
 Destructor. More...
 

Private Member Functions

dberr_t fetch () noexcept
 Prepare to fetch the current row. More...
 

Private Attributes

size_t m_id {}
 Instance ID. More...
 
File_reader m_reader
 File reader. More...
 
uint64_t m_n_rows {}
 Number of rows read the file. More...
 
Alter_stagem_stage {}
 PFS monitoring. More...
 
uint64_t m_processed_rows_to_report {}
 Number of rows that were fetched but not yet reported to the PFS. More...
 

Friends

struct Merge_cursor
 

Additional Inherited Members

- Public Attributes inherited from ddl::Load_cursor
Dupm_dup {}
 Duplicate checking and reporting. More...
 
dberr_t m_err {DB_SUCCESS}
 Operation error code. More...
 
Builderm_builder {}
 Index meta data. More...
 
Scoped_heap m_tuple_heap {}
 Heap for the raw row to dtuple_t conversion. More...
 

Detailed Description

For loading a Btree index from a file.

Constructor & Destructor Documentation

◆ File_cursor()

ddl::File_cursor::File_cursor ( Builder builder,
const Unique_os_file_descriptor file,
size_t  buffer_size,
const Range range,
Alter_stage stage 
)
noexcept

Constructor.

Parameters
[in]builderThe index build driver.
[in]fileFile to read from.
[in]buffer_sizeIO buffer size to use for reads.
[in]rangeOffsets of the chunk to read from the file
[in,out]stagePFS observability.

◆ ~File_cursor()

ddl::File_cursor::~File_cursor ( )
override

Destructor.

Member Function Documentation

◆ fetch() [1/3]

dberr_t ddl::File_cursor::fetch ( )
privatenoexcept

Prepare to fetch the current row.

Returns
DB_SUCCESS, DB_END_OF_INDEX or error code.

◆ fetch() [2/3]

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

Fetch the current row.

Parameters
[out]mrecCurrent row.
[out]offsetsColumn offsets inside mrec.
Returns
DB_SUCCESS, DB_END_OF_INDEX or error code.

◆ fetch() [3/3]

dberr_t ddl::File_cursor::fetch ( dtuple_t *&  dtuple)
overridevirtualnoexcept

Fetch the current row as a tuple.

Note: Tuple columns are shallow copies.

Parameters
[out]dtupleRow represented as a tuple.
Returns
DB_SUCCESS, DB_END_OF_INDEX or error code.

Implements Btree_load::Cursor.

◆ next()

dberr_t ddl::File_cursor::next ( void  )
overridevirtualnoexcept

Move to the next record.

Returns
DB_SUCCESS, DB_END_OF_INDEX or error code.

Implements Btree_load::Cursor.

◆ open()

dberr_t ddl::File_cursor::open ( )
noexcept

Open the cursor.

Returns
DB_SUCCESS or error code.

Friends And Related Function Documentation

◆ Merge_cursor

friend struct Merge_cursor
friend

Member Data Documentation

◆ m_id

size_t ddl::File_cursor::m_id {}
private

Instance ID.

◆ m_n_rows

uint64_t ddl::File_cursor::m_n_rows {}
private

Number of rows read the file.

◆ m_processed_rows_to_report

uint64_t ddl::File_cursor::m_processed_rows_to_report {}
private

Number of rows that were fetched but not yet reported to the PFS.

◆ m_reader

File_reader ddl::File_cursor::m_reader
private

File reader.

◆ m_stage

Alter_stage* ddl::File_cursor::m_stage {}
private

PFS monitoring.


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