MySQL 8.0.40
Source Code Documentation
|
Full text search index builder. More...
#include <ddl0fts.h>
Classes | |
struct | Doc_item |
Information about temporary files used in merge sort. More... | |
struct | Inserter |
struct | Parser |
For parsing and sorting the documents. More... | |
Public Member Functions | |
FTS (Context &ctx, dict_index_t *index, dict_table_t *table) noexcept | |
Constructor. More... | |
~FTS () noexcept | |
~Destructor. More... | |
dberr_t | init (size_t n_threads) noexcept |
Create the internal data structures. More... | |
dict_index_t * | index () noexcept |
dict_index_t * | sort_index () noexcept |
dberr_t | start_parse_threads (Builder *builder) noexcept |
Start the parsing, create the threads. More... | |
dberr_t | enqueue (Doc_item *doc_item) noexcept |
For sending the documents to parse to the parsing threads. More... | |
dberr_t | check_for_errors () noexcept |
Check for error status after the parsing has finished. More... | |
dberr_t | insert (Builder *builder) noexcept |
Start the merging and insert threads. More... | |
dberr_t | scan_finished (dberr_t err) noexcept |
Inform the parser threads that the scanning phase is complete so that they can shutdown after emptying the doc item queue. More... | |
Private Types | |
using | Threads = std::vector< std::thread > |
using | Parsers = std::vector< Parser *, ut::allocator< Parser * > > |
Private Member Functions | |
dberr_t | create (size_t n_threads) noexcept |
Create the data structures required to build the FTS index. More... | |
size_t | get_n_parsers () const noexcept |
void | destroy () noexcept |
Destroy the data structures and clean up. More... | |
dberr_t | setup_insert_phase () noexcept |
Setup the insert phase inoput files generated by the parsers. More... | |
Static Private Member Functions | |
static dict_index_t * | create_index (dict_index_t *index, dict_table_t *table, bool *doc_id_32_bit) noexcept |
Create a temporary "fts sort index" used to merge sort the tokenized doc string. More... | |
Private Attributes | |
Parsers | m_parsers {} |
For parsing the documents, there is one per thread. More... | |
Inserter * | m_inserter {} |
For inserting the rows parsed by the m_parsers. More... | |
Context & | m_ctx |
DDL context. More... | |
Dup | m_dup |
Duplicate key reporting. More... | |
bool | m_doc_id_32_bit {} |
true if document ID should be stored as a 32 bit instead of a 64 bit. More... | |
dict_index_t * | m_index {} |
DDL index instance. More... | |
dict_table_t * | m_table {} |
DDL table instance. More... | |
dict_index_t * | m_sort_index {} |
Temporary index instance with relevant FTS columns. More... | |
Threads | m_threads {} |
For tracking parser threads. More... | |
Full text search index builder.
|
private |
|
private |
|
noexcept |
Constructor.
[in,out] | ctx | DDL context. |
[in,out] | index | DDL index. |
[in,out] | table | DDL table. |
|
noexcept |
~Destructor.
|
noexcept |
Check for error status after the parsing has finished.
|
privatenoexcept |
Create the data structures required to build the FTS index.
[in] | n_threads | Number of parser threads. |
|
staticprivatenoexcept |
Create a temporary "fts sort index" used to merge sort the tokenized doc string.
The index has three "fields":
[in,out] | index | Index to sort. |
[in,out] | table | Table that the FTS index is created on. |
[out] | doc_id_32_bit | Whether to use 4 bytes instead of 7 bytes integer to store the DOC ID during sort. |
|
privatenoexcept |
Destroy the data structures and clean up.
|
noexcept |
For sending the documents to parse to the parsing threads.
[in,out] | doc_item | Document to parse, takes ownership. |
|
inlineprivatenoexcept |
|
inlinenoexcept |
|
noexcept |
Create the internal data structures.
[in] | n_threads | Number of parse threads to create. |
Start the merging and insert threads.
[in,out] | builder | Builder instance to use. |
Inform the parser threads that the scanning phase is complete so that they can shutdown after emptying the doc item queue.
[in] | err | Error status of the scanning thread(s). |
|
privatenoexcept |
Setup the insert phase inoput files generated by the parsers.
|
inlinenoexcept |
Start the parsing, create the threads.
|
private |
DDL context.
|
private |
true if document ID should be stored as a 32 bit instead of a 64 bit.
|
private |
Duplicate key reporting.
|
private |
DDL index instance.
|
private |
For inserting the rows parsed by the m_parsers.
|
private |
For parsing the documents, there is one per thread.
|
private |
Temporary index instance with relevant FTS columns.
|
private |
DDL table instance.
|
private |
For tracking parser threads.