Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/4972#discussion_r26442690
--- Diff: core/src/main/scala/org/apache/spark/util/SizeEstimator.scala ---
@@ -184,14 +182,14 @@ private[spark] object SizeEstimator extends Logging {
private val ARRAY_SIZE_FOR_SAMPLING = 200
private val ARRAY_SAMPLE_SIZE = 100 // should be lower than
ARRAY_SIZE_FOR_SAMPLING
- private def visitArray(array: AnyRef, cls: Class[_], state: SearchState)
{
- val length = JArray.getLength(array)
- val elementClass = cls.getComponentType
+ private def visitArray(array: AnyRef, arrayClass: Class[_], state:
SearchState) {
+ val length = ScalaRunTime.array_length(array)
+ val elementClass = arrayClass.getComponentType()
// Arrays have object header and length field which is an integer
var arrSize: Long = alignSize(objectSize + INT_SIZE)
- if (elementClass.isPrimitive) {
+ if (elementClass.isPrimitive()) {
--- End diff --
is isPrimitive defined with parentheses? If not, let's not change it here.
---
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]