My Project
|
Public Member Functions | |
HASH_ROW_ENTRY * | make_entry () |
HASH_ROW_ENTRY * | make_entry (const uchar *bi_start, const uchar *bi_ends) |
bool | put (TABLE *table, MY_BITMAP *cols, HASH_ROW_ENTRY *entry) |
HASH_ROW_ENTRY * | get (TABLE *table, MY_BITMAP *cols) |
bool | next (HASH_ROW_ENTRY **entry) |
bool | del (HASH_ROW_ENTRY *entry) |
bool | init (void) |
bool | deinit (void) |
bool | is_empty (void) |
int | size () |
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 memeory 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.
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
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.
entry[IN/OUT] | contains a pointer to an entry that we can use to search for another adjacent entry (ie, that shares the same key). |
Do the actual search in the hash table.
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.