MySQL 8.4.2
Source Code Documentation
|
For parsing and sorting the documents. More...
Classes | |
struct | Handler |
Data structures for building an index. More... | |
Public Member Functions | |
Parser (size_t id, Context &ctx, Dup *dup, bool doc_id_32_bit) noexcept | |
Constructor. More... | |
~Parser () noexcept | |
Destructor. More... | |
size_t | id () const noexcept |
dberr_t | init (size_t n_threads) noexcept |
Initialize the data structures. More... | |
file_t | release_file (size_t id) noexcept |
Releases ownership of the i'th file used. More... | |
dberr_t | get_error () const noexcept |
void | set_error (dberr_t err) noexcept |
Set the error code. More... | |
dberr_t | enqueue (FTS::Doc_item *doc_item) noexcept |
Enqueue a document to parse. More... | |
void | parse (Builder *builder) noexcept |
Function performs parallel tokenization of the incoming doc strings. More... | |
void | set_parent_state (Thread_state state) noexcept |
Set the parent thread state. More... | |
Public Attributes | |
Diagnostics_area | da {false} |
Private Types | |
using | Docq = mpmc_bq< FTS::Doc_item * > |
using | Docq_ptr = std::unique_ptr< Docq, std::function< void(Docq *)> > |
using | Handler_ptr = std::unique_ptr< Handler, std::function< void(Handler *)> > |
using | Handlers = std::array< Handler_ptr, FTS_NUM_AUX_INDEX > |
Private Member Functions | |
bool | doc_tokenize (doc_id_t doc_id, fts_doc_t *doc, dtype_t *word_dtype, Tokenize_ctx *t_ctx) noexcept |
Tokenize incoming text data and add to the sort buffer. More... | |
void | get_next_doc_item (FTS::Doc_item *&doc_item) noexcept |
Get next doc item from fts_doc_lis. More... | |
void | tokenize (fts_doc_t *doc, st_mysql_ftparser *parser, Tokenize_ctx *t_ctx) noexcept |
Tokenize by fts plugin parser. More... | |
Static Private Member Functions | |
static int | add_word (MYSQL_FTPARSER_PARAM *param, char *word, int word_len, MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info) noexcept |
FTS plugin parser 'myql_add_word' callback function for row merge. More... | |
Private Attributes | |
size_t | m_id {} |
Parallel sort ID. More... | |
Dup * | m_dup {} |
Descriptor of FTS index. More... | |
Context & | m_ctx |
DDL context. More... | |
Handlers | m_handlers {} |
Buffers etc. More... | |
bool | m_doc_id_32_bit {} |
Whether to use 4 bytes instead of 8 bytes integer to store Doc ID during sort, if Doc ID will not be big enough to use 8 bytes value. More... | |
Docq_ptr | m_docq {} |
Doc queue to process. More... | |
std::atomic_size_t | m_memory_used {} |
Memory used by fts_doc_list. More... | |
Thread_state | m_parent_state {Thread_state::UNKNOWN} |
Parent thread state. More... | |
For parsing and sorting the documents.
|
private |
|
private |
|
private |
|
private |
Constructor.
[in] | id | Parser ID. |
[in,out] | ctx | DDL context. |
[in,out] | dup | Descriptor of FTS index being created. |
[in] | doc_id_32_bit | Size of the doc ID column to use for sort. |
|
noexcept |
Destructor.
|
staticprivatenoexcept |
FTS plugin parser 'myql_add_word' callback function for row merge.
Refer to 'MYSQL_FTPARSER_PARAM' for more detail.
[in] | param | Parser parameter. |
[in] | word | Token word. |
[in] | word_len | Word len. |
[in] | boolean_info | Boolean info. |
|
privatenoexcept |
Tokenize incoming text data and add to the sort buffer.
[in] | doc_id | Doc ID. |
[in] | doc | Doc to be tokenized. |
[in] | word_dtype | Data structure for word col. |
[in,out] | t_ctx | Tokenize context. |
|
noexcept |
Enqueue a document to parse.
[in,out] | doc_item | Document to parse. |
|
inlinenoexcept |
|
privatenoexcept |
Get next doc item from fts_doc_lis.
[in,out] | doc_item | Doc item. |
|
inlinenoexcept |
|
noexcept |
Initialize the data structures.
[in] | n_threads | Number of parsing threads. |
|
noexcept |
Function performs parallel tokenization of the incoming doc strings.
[in,out] | builder | Index builder instance. |
|
inlinenoexcept |
Releases ownership of the i'th file used.
|
inlinenoexcept |
Set the error code.
[in] | err | Error code to set. |
|
inlinenoexcept |
Set the parent thread state.
[in] | state | The parent state. |
|
privatenoexcept |
Tokenize by fts plugin parser.
[in] | doc | To tokenize |
[in] | parser | Plugin parser instance. |
[in,out] | t_ctx | Tokenize ctx instance. |
Diagnostics_area ddl::FTS::Parser::da {false} |
|
private |
DDL context.
|
private |
Whether to use 4 bytes instead of 8 bytes integer to store Doc ID during sort, if Doc ID will not be big enough to use 8 bytes value.
|
private |
Doc queue to process.
|
private |
Descriptor of FTS index.
|
private |
Buffers etc.
|
private |
Parallel sort ID.
|
private |
Memory used by fts_doc_list.
|
private |
Parent thread state.