Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/6159#discussion_r30559095
--- Diff:
unsafe/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java ---
@@ -427,7 +496,9 @@ public void putNewKey(
* @param capacity the new map capacity
*/
private void allocate(int capacity) {
- capacity = Math.max((int) Math.min(Integer.MAX_VALUE,
nextPowerOf2(capacity)), 64);
+ assert (capacity >= 0);
+ // The capacity needs to be divisible by 64 so that our bit set can be
sized properly
+ capacity = Math.max((int) Math.min(MAX_CAPACITY,
nextPowerOf2(capacity)), 64);
longArray = new LongArray(memoryManager.allocate(capacity * 8 * 2));
--- End diff --
Yep, good catch. I was a bit tired while working on this :(
---
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]