Merge the sorted files.
More...
#include <ddl0impl-builder.h>
◆ File_cursors
File cursors to use for the scan.
◆ File_readers
File cursors to use for the scan.
◆ Queue
Priority queue for ordering the rows.
◆ Merge_cursor()
Constructor.
- Parameters
-
[in,out] | builder | Index builder. |
[in,out] | dup | If not nullptr, then report duplicates. |
[in,out] | stage | PFS stage monitoring. |
◆ ~Merge_cursor()
ddl::Merge_cursor::~Merge_cursor |
( |
| ) |
|
|
overridenoexcept |
◆ add_file() [1/2]
Add the cursor to use for merge load.
- Parameters
-
[in] | file | File to merge from. |
[in] | buffer_size | IO buffer size to use for reading. |
- Returns
- DB_SUCCESS or error code.
◆ add_file() [2/2]
Add the cursor to use for merge load.
- Parameters
-
[in] | file | File file to read. |
[in] | buffer_size | IO buffer size to use for reading. |
[in] | range | Range to read from |
- Returns
- DB_SUCCESS or error code.
◆ clear_eof()
void ddl::Merge_cursor::clear_eof |
( |
| ) |
|
|
noexcept |
Add the active cursors to the priority queue.
◆ fetch() [1/2]
Fetch the current row.
- Parameters
-
[out] | mrec | Current merge record. |
[out] | offsets | Columns offsets inside mrec. |
- Returns
- DB_SUCCESS, DB_END_OF_INDEX or error code.
◆ fetch() [2/2]
Fetch the current row as a tuple.
Note: Tuple columns are shallow copies.
- Parameters
-
[out] | dtuple | Row represented as a tuple. |
- Returns
- DB_SUCCESS, DB_END_OF_INDEX or error code.
Implements Btree_load::Cursor.
◆ file_readers()
- Returns
- the file reader instances.
◆ get_n_rows()
uint64_t ddl::Merge_cursor::get_n_rows |
( |
| ) |
const |
|
noexcept |
- Returns
- the number of rows read from the files.
◆ next()
dberr_t ddl::Merge_cursor::next |
( |
void |
| ) |
|
|
overridevirtualnoexcept |
Move to the next record.
- Returns
- DB_SUCCESS, DB_END_OF_INDEX or error code.
Implements Btree_load::Cursor.
◆ number_of_cursors()
size_t ddl::Merge_cursor::number_of_cursors |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- the number of cursors being merged.
◆ open()
dberr_t ddl::Merge_cursor::open |
( |
| ) |
|
|
noexcept |
Open the cursor.
- Returns
- DB_SUCCESS or error code.
◆ pop()
- Returns
- the current cursor at the head of the queue.
◆ size()
size_t ddl::Merge_cursor::size |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- the number of active readers.
◆ m_cursor
◆ m_cursors
Cursors to use for parallel loading of the index.
◆ m_pq
Queue ddl::Merge_cursor::m_pq {} |
|
private |
Priority queue for merging the file cursors.
◆ m_stage
The documentation for this struct was generated from the following files: