Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/11870#discussion_r57205363
--- Diff:
core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java ---
@@ -480,11 +480,29 @@ public void safeLookup(Object keyBase, long
keyOffset, int keyLength, Location l
}
/**
+ * Append a pair of key-value at the end, there could other pairs with
the same keys.
+ */
+ public boolean append(Object keyBase, long keyOffset, int keyLength,
+ Object valueBase, long valueOffset, int
valueLength) {
+ assert(longArray != null);
+ int hash = Murmur3_x86_32.hashUnsafeWords(keyBase, keyOffset,
keyLength, 42);
+ int pos = hash & mask;
+ int step = 1;
+ while (longArray.get(pos * 2) != 0) {
--- End diff --
It's the same as we insert new key into the map, the map can be atmost 70%
full.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]