Description. This method can be used to compute a distribution hash value, given a table and its keys.
computeHash() can be used only for tables
that use native
static int computeHash ( Uint32* hashvalueptr, const NdbDictionary::Table* table, const struct Key_part_ptr* keyData, void* xfrmbuf = 0, Uint32 xfrmbuflen = 0 )
Parameters. This method takes the following parameters:
If the method call is successful,
hashvalueptris set to the computed hash value.
A pointer to a
table(see Section 2.3.37, “The Table Class”).
keyDatais a null-terminated array of pointers to the key parts that are part of the table's distribution key. The length of each key part is read from metadata and checked against the passed value (see Section 2.3.15, “The Key_part_ptr Structure”).
xfrmbufis a pointer to temporary buffer used to calculate the hash value.
xfrmbuflenis the length of this buffer.Note
NULL(the default), then a call to
free()is made automatically, as appropriate.
xfrmbuflenis too small.
Previously, it was assumed that the memory returned by the
malloc()call would always be suitably aligned, which is not always the case. Beginning with NDB 7.3.2, when
malloc()provides a buffer to this method, the buffer is explicitly aligned after it is allocated, and before it is actually used. (Bug #16484617)
0 on success, an error code on failure. (If the method call
succeeds, the computed hash value is made available via