Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,12 @@ public boolean append(Object kbase, long koff, int klen, Object vbase, long voff
} catch (SparkOutOfMemoryError oom) {
canGrowArray = false;
}
} else if (numKeys >= growthThreshold && longArray.size() / 2 >= MAX_CAPACITY) {
Comment thread
ankurdave marked this conversation as resolved.
Outdated
// The map has reached its growth threshold, but is already at MAX_CAPACITY and cannot
// grow. Instead, we prevent the map from accepting any more new elements to make sure we
// don't exceed the load factor. If we need to spill later, this allows
// UnsafeKVExternalSorter to reuse the array for sorting.
canGrowArray = false;
}
}
return true;
Expand Down