MySQL 8.4.2
Source Code Documentation
ddl::FTS::Inserter Struct Reference

Classes

struct  Handler
 Data structures for building an index. More...
 

Public Types

using Handlers = std::array< Handler, FTS_NUM_AUX_INDEX >
 

Public Member Functions

 Inserter (Context &ctx, Dup *dup, bool doc_id_32_bit) noexcept
 Constructor. More...
 
 ~Inserter () noexcept
 Destructor. More...
 
dberr_t insert (Builder *builder, Handler *handler) noexcept
 Read sorted file(s) containing index data tuples and insert these data tuples to the index. More...
 
dberr_t add_file (size_t id, file_t file) noexcept
 Add a file to the handler for merging and inserting. More...
 
dberr_t write_node (const Insert *ins_ctx, const fts_string_t *word, const fts_node_t *node) noexcept
 Write out a single word's data as new entry/entries in the INDEX table. More...
 
dberr_t write_word (Insert *ins_ctx, fts_tokenizer_word_t *word) noexcept
 Insert processed FTS data to auxiliary index tables. More...
 
void insert_tuple (Insert *ins_ctx, fts_tokenizer_word_t *word, ib_vector_t *positions, doc_id_t *in_doc_id, const dtuple_t *dtuple) noexcept
 Read sorted FTS data files and insert data tuples to auxiliary tables. More...
 

Public Attributes

Dupm_dup {}
 For duplicate reporting. More...
 
Contextm_ctx
 DDL context. More...
 
bool m_doc_id_32_bit {}
 32 or 64 bit doc id. More...
 
Handlers m_handlers {}
 There is one handler per parser. More...
 

Member Typedef Documentation

◆ Handlers

Constructor & Destructor Documentation

◆ Inserter()

ddl::FTS::Inserter::Inserter ( Context ctx,
Dup dup,
bool  doc_id_32_bit 
)
noexcept

Constructor.

Parameters
[in,out]ctxDDL context.
[in,out]dupDescriptor of FTS index being created.
[in]doc_id_32_bitSize of the doc ID column to use for sort.

◆ ~Inserter()

ddl::FTS::Inserter::~Inserter ( )
inlinenoexcept

Destructor.

Member Function Documentation

◆ add_file()

dberr_t ddl::FTS::Inserter::add_file ( size_t  id,
file_t  file 
)
inlinenoexcept

Add a file to the handler for merging and inserting.

Parameters
[in]idAux index ID.
[in]fileFile to merge and insert.
Returns
DB_SUCCESS or error code.

◆ insert()

dberr_t ddl::FTS::Inserter::insert ( Builder builder,
Inserter::Handler handler 
)
noexcept

Read sorted file(s) containing index data tuples and insert these data tuples to the index.

Parameters
[in,out]builderIndex builder.
[in,out]handlerInsert handler.
Returns
DB_SUCCESS or error number

◆ insert_tuple()

void ddl::FTS::Inserter::insert_tuple ( Insert ins_ctx,
fts_tokenizer_word_t word,
ib_vector_t positions,
doc_id_t in_doc_id,
const dtuple_t dtuple 
)
noexcept

Read sorted FTS data files and insert data tuples to auxiliary tables.

Parameters
[in]ins_ctxInsert context.
[in]wordLast processed tokenized word.
[in]positionsWord position.
[in]in_doc_idLast item doc id.
[in]dtupleEntry to insert or nullptr on end.

◆ write_node()

dberr_t ddl::FTS::Inserter::write_node ( const Insert ins_ctx,
const fts_string_t word,
const fts_node_t node 
)
noexcept

Write out a single word's data as new entry/entries in the INDEX table.

Parameters
[in]ins_ctxInsert context.
[in]wordWord string.
[in]nodeNode columns.
Returns
DB_SUCCUESS if insertion runs fine, otherwise error code

◆ write_word()

dberr_t ddl::FTS::Inserter::write_word ( Insert ins_ctx,
fts_tokenizer_word_t word 
)
noexcept

Insert processed FTS data to auxiliary index tables.

Parameters
[in]ins_ctxInsert context.
[in]wordSorted and tokenized word.
Returns
DB_SUCCESS if insertion runs fine

Member Data Documentation

◆ m_ctx

Context& ddl::FTS::Inserter::m_ctx

DDL context.

◆ m_doc_id_32_bit

bool ddl::FTS::Inserter::m_doc_id_32_bit {}

32 or 64 bit doc id.

◆ m_dup

Dup* ddl::FTS::Inserter::m_dup {}

For duplicate reporting.

◆ m_handlers

Handlers ddl::FTS::Inserter::m_handlers {}

There is one handler per parser.


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