spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russ <russ.br...@yahoo.com.INVALID>
Subject How to register a Tuple3 with KryoSerializer?
Date Wed, 30 Dec 2015 18:16:23 GMT
I need to register with KryoSerializer a Tuple3 that is generated by a call to the sortBy()
method that eventually calls collect() from Partitioner.RangePartitioner.sketch().
The IntelliJ Idea debugger indicates that the for the Tuple3 are java.lang.Integer, java.lang.Integer
and long[].  So, the question is, how should I specify the long[] type?
I have tried the following from my Scala code:
sparkConf.registerKryoClasses(Array(classOf[scala.Tuple3[java.lang.Integer,  java.lang.Integer,
Array[java.lang.Long]]]))
However, that approach throws the following exception which indicates that I have failed to
register the Tuple3 correctly:
java.lang.IllegalArgumentException: Class is not registered: scala.Tuple3[]
Can anyone suggest the correct way to register this Tuple3?  I suppose that I could create
register the tuple from a Java method but it would be nice to avoid having to introduce any
Java into my code.
Thanks.

Mime
View raw message