MySQL 8.0.40
Source Code Documentation
|
#include <rpl_utility.h>
Public Member Functions | |
HASH_ROW_ENTRY * | make_entry () |
Allocates an empty entry to be added to the hash table. More... | |
HASH_ROW_ENTRY * | make_entry (const uchar *bi_start, const uchar *bi_ends) |
Allocates an entry to be added to the hash table. More... | |
bool | put (TABLE *table, MY_BITMAP *cols, HASH_ROW_ENTRY *entry) |
Puts data into the hash table. More... | |
HASH_ROW_ENTRY * | get (TABLE *table, MY_BITMAP *cols) |
Gets the entry, from the hash table, that matches the data in table->record[0] and signaled using cols. More... | |
bool | next (HASH_ROW_ENTRY **entry) |
Gets the entry that stands next to the one pointed to by entry. More... | |
bool | del (HASH_ROW_ENTRY *entry) |
Deletes the entry pointed by entry. More... | |
bool | init (void) |
Initializes the hash table. More... | |
bool | deinit (void) |
De-initializes the hash table. More... | |
bool | is_empty (void) |
Checks if the hash table is empty or not. More... | |
int | size () |
Returns the number of entries in the hash table. More... | |
Private Member Functions | |
uint | make_hash_key (TABLE *table, MY_BITMAP *cols) |
Auxiliary and internal method used to create an hash key, based on the data in table->record[0] buffer and signaled as used in cols. More... | |
Private Attributes | |
malloc_unordered_multimap< uint, std::unique_ptr< HASH_ROW_ENTRY, hash_slave_rows_free_entry > > | m_hash {key_memory_HASH_ROW_ENTRY} |
The hashtable itself. More... | |
bool Hash_slave_rows::deinit | ( | void | ) |
De-initializes the hash table.
bool Hash_slave_rows::del | ( | HASH_ROW_ENTRY * | entry | ) |
Deletes the entry pointed by entry.
It also frees memory used holding entry contents. This is the way to release memory used for entry, freeing it explicitly with my_free will cause undefined behavior.
entry | Pointer to the entry to be deleted. |
HASH_ROW_ENTRY * Hash_slave_rows::get | ( | TABLE * | table, |
MY_BITMAP * | cols | ||
) |
Gets the entry, from the hash table, that matches the data in table->record[0] and signaled using cols.
table | The table holding the buffer containing data used to make the entry lookup. |
cols | Bitmap signaling which columns, from table->record[0], should be used. |
Save the search state in case we need to go through entries for the given key.
bool Hash_slave_rows::init | ( | void | ) |
Initializes the hash table.
Hashing commodity structures and functions.
bool Hash_slave_rows::is_empty | ( | void | ) |
Checks if the hash table is empty or not.
HASH_ROW_ENTRY * Hash_slave_rows::make_entry | ( | ) |
Allocates an empty entry to be added to the hash table.
It should be called before calling member function put
.
HASH_ROW_ENTRY * Hash_slave_rows::make_entry | ( | const uchar * | bi_start, |
const uchar * | bi_ends | ||
) |
Allocates an entry to be added to the hash table.
It should be called before calling member function put
.
bi_start | the position to where in the rows buffer the before image begins. |
bi_ends | the position to where in the rows buffer the before image ends. |
Filling in the preamble.
Filling in the positions.
Filling in the entry
Auxiliary and internal method used to create an hash key, based on the data in table->record[0] buffer and signaled as used in cols.
table | The table that is being scanned |
cols | The read_set bitmap signaling which columns are used. |
bool Hash_slave_rows::next | ( | HASH_ROW_ENTRY ** | entry | ) |
Gets the entry that stands next to the one pointed to by entry.
Before calling this member function, the entry that one uses as parameter must have: 1. been obtained through get() or next() invocations; and 2. must have not been used before in a next() operation.
[in,out] | entry | contains a pointer to an entry that we can use to search for another adjacent entry (ie, that shares the same key). |
Save the search state for next iteration (if any).
bool Hash_slave_rows::put | ( | TABLE * | table, |
MY_BITMAP * | cols, | ||
HASH_ROW_ENTRY * | entry | ||
) |
Puts data into the hash table.
It calculates the key taking the data on TABLE::record
as the input for hash computation.
table | The table holding the buffer used to calculate the key, ie, table->record[0]. |
cols | The read_set bitmap signaling which columns are used. |
entry | The entry with the values to store. |
Skip blobs and BIT fields from key calculation. Handle X bits. Handle nulled fields. Handled fields not signaled.
int Hash_slave_rows::size | ( | ) |
Returns the number of entries in the hash table.
|
private |
The hashtable itself.