Created
April 30, 2015 19:59
-
-
Save bradkarels/75aff1b7d49ec89f877d to your computer and use it in GitHub Desktop.
Fuddling with Kryo/chill on repl with Spark 1.2.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// scala> :cp lib/chill_2.10-0.5.2.jar | |
//bkarels@ahimsa:~/spark/current$ ./bin/spark-shell --master local[*] --jars lib/mongo-java-driver-3.0.0.jar,lib/mongo-hadoop-core-1.3.2.jar,lib/chill_2.10-0.5.2.jar | |
import com.esotericsoftware.kryo.io.{Input, Output} | |
import com.twitter.chill.ScalaKryoInstantiator | |
import java.io.ByteArrayOutputStream | |
class Person(val name:String) extends Serializable | |
val p0:Person = new Person("p0") | |
val p1:Person = new Person("p1") | |
val p2:Person = new Person("p2") | |
val persons:List[Person] = List(p0,p1,p2) | |
val instantiator = (new ScalaKryoInstantiator).setRegistrationRequired(true) | |
val kryo = instantiator.newKryo | |
kryo.register(classOf[Person]) | |
val output = new Output(new ByteArrayOutputStream) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment