yatmatsuda writes:
We use HashFunctions.fnv(Array[Byte]) (norbert code) for hash partitioning the graph data.
We serialize NodeId to a byte array, then this function scans the bytes and calculate the hash value.
HashFunctions.fnv is recursively defined. It takes one byte (key.head) to compute a intermediate value and creates a new array (key.drop(1)) of rest of the data and call recursively until all data are processed. It means we create an array per byte. Too expensive.
We can simply use a while-loop with the array index as the loop variable.
yatmatsuda writes: We use HashFunctions.fnv(Array[Byte]) (norbert code) for hash partitioning the graph data. We serialize NodeId to a byte array, then this function scans the bytes and calculate the hash value. HashFunctions.fnv is recursively defined. It takes one byte (key.head) to compute a intermediate value and creates a new array (key.drop(1)) of rest of the data and call recursively until all data are processed. It means we create an array per byte. Too expensive. We can simply use a while-loop with the array index as the loop variable.
(private ref: CLD-384)