GitHub user ankurdave opened a pull request:
https://github.com/apache/spark/pull/2503
[SPARK-3649] Remove GraphX custom serializers
As [reported][1] on the mailing list, GraphX throws
```
java.lang.ClassCastException: java.lang.Long cannot be cast to scala.Tuple2
at
org.apache.spark.graphx.impl.RoutingTableMessageSerializer$$anon$1$$anon$2.writeObject(Serializers.scala:39)
at
org.apache.spark.storage.DiskBlockObjectWriter.write(BlockObjectWriter.scala:195)
at
org.apache.spark.util.collection.ExternalSorter.spillToMergeableFile(ExternalSorter.scala:329)
```
when sort-based shuffle attempts to spill to disk. This is because GraphX
defines custom serializers for shuffling pair RDDs that assume Spark will
always serialize the entire pair object rather than breaking it up into its
components. However, the spill code path in sort-based shuffle [violates this
assumption][2].
GraphX uses the custom serializers to compress vertex ID keys using
variable-length integer encoding. However, since the serializer can no longer
rely on the key and value being serialized and deserialized together,
performing such encoding would require writing a tag byte.
Instead, this PR simply removes the custom serializers. This causes a 10%
slowdown for PageRank (494 s to 543 s, PageRank, 3 trials, 10 iterations per
trial, uk-2007-05 graph, 16 r3.2xlarge nodes).
[1]:
http://apache-spark-user-list.1001560.n3.nabble.com/java-lang-ClassCastException-java-lang-Long-cannot-be-cast-to-scala-Tuple2-td13926.html#a14501
[2]:
https://github.com/apache/spark/blob/f9d6220c792b779be385f3022d146911a22c2130/core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala#L329
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ankurdave/spark SPARK-3649
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/2503.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2503
----
commit a49c2ad67f2bf79ae10e9ef696605c64b0c0ed97
Author: Ankur Dave <[email protected]>
Date: 2014-09-22T22:05:30Z
[SPARK-3649] Remove GraphX custom serializers
----
---
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]