Github user sryza commented on a diff in the pull request:
https://github.com/apache/spark/pull/6456#discussion_r31261652
--- Diff:
core/src/main/scala/org/apache/spark/util/collection/PartitionedSerializedPairBuffer.scala
---
@@ -89,11 +93,17 @@ private[spark] class PartitionedSerializedPairBuffer[K,
V](
/** Double the size of the array because we've reached capacity */
private def growMetaBuffer(): Unit = {
- if (metaBuffer.capacity.toLong * 2 > Int.MaxValue) {
- // Doubling the capacity would create an array bigger than
Int.MaxValue, so don't
- throw new Exception(s"Can't grow buffer beyond ${Int.MaxValue}
bytes")
+ if (metaBuffer.capacity >= MAXIMUM_META_BUFFER_CAPACITY) {
+ throw new IllegalStateException(s"Can't grow buffer beyond
${MAXIMUM_RECORDS} records")
}
- val newMetaBuffer = IntBuffer.allocate(metaBuffer.capacity * 2)
+ val newCapacity =
--- End diff --
If we have too many records, we'll end up failing when we try to do a
`put`, right? Can we make this fail with a more explicit message?
---
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]