Spark test on local machine

I am running Spark 1.3.1 unit tests using the sbt test, and besides the fact that the unit tests are incredibly slow, I keep running at java.lang.ClassNotFoundException: org.apache.spark.storage.RDDBlockId. This usually means a dependency problem, but I don't know where. Tried installing everything on a new machine including fresh chaos, fresh ivy2 but I still face the same problem

Any help is appreciated

An exception:

Exception in thread "Driver Heartbeater" java.lang.ClassNotFoundException: 
    org.apache.spark.storage.RDDBlockId
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)

      

My build.sbt:

libraryDependencies ++=  Seq( 
  "org.scalaz"              %% "scalaz-core" % "7.1.2" excludeAll ExclusionRule(organization = "org.slf4j"), 
  "com.typesafe.play"       %% "play-json" % "2.3.4" excludeAll ExclusionRule(organization = "org.slf4j"), 
  "org.apache.spark"        %% "spark-core" % "1.3.1" % "provided"  withSources() excludeAll (ExclusionRule(organization = "org.slf4j"), ExclusionRule("org.spark-project.akka", "akka-actor_2.10")), 
  "org.apache.spark"        %% "spark-graphx" % "1.3.1" % "provided" withSources() excludeAll (ExclusionRule(organization = "org.slf4j"), ExclusionRule("org.spark-project.akka", "akka-actor_2.10")), 
  "org.apache.cassandra"    % "cassandra-all" % "2.1.6", 
  "org.apache.cassandra"    % "cassandra-thrift" % "2.1.6", 
  "com.typesafe.akka" %% "akka-actor" % "2.3.11", 
  "com.datastax.cassandra"  % "cassandra-driver-core" % "2.1.6" withSources() withJavadoc() excludeAll (ExclusionRule(organization = "org.slf4j"),ExclusionRule(organization = "org.apache.spark"),ExclusionRule(organization = "com.twitter",name = "parquet-hadoop-bundle")), 
  "com.github.nscala-time"  %% "nscala-time" % "1.2.0" excludeAll ExclusionRule(organization = "org.slf4j") withSources(), 
  "com.datastax.spark"      %% "spark-cassandra-connector-embedded" % "1.3.0-M2" excludeAll (ExclusionRule(organization = "org.slf4j"),ExclusionRule(organization = "org.apache.spark"),ExclusionRule(organization = "com.twitter",name = "parquet-hadoop-bundle")), 
  "com.datastax.spark"      %% "spark-cassandra-connector" % "1.3.0-M2" excludeAll (ExclusionRule(organization = "org.slf4j"),ExclusionRule(organization = "org.apache.spark"),ExclusionRule(organization = "com.twitter",name = "parquet-hadoop-bundle")), 
  "org.slf4j"               % "slf4j-api"            % "1.6.1", 
   "com.twitter"            % "jsr166e" % "1.1.0", 
  "org.slf4j"               % "slf4j-nop" % "1.6.1" % "test", 
  "org.scalatest"           %% "scalatest" % "2.2.1" % "test" excludeAll ExclusionRule(organization = "org.slf4j") 
) 

      

and my spark test settings (of which I turned everything off to test it)

(spark.kryo.registrator,com.my.spark.MyRegistrator) 
(spark.eventLog.dir,) 
(spark.driver.memory,16G) 
(spark.kryoserializer.buffer.mb,512) 
(spark.akka.frameSize,5) 
(spark.shuffle.spill,false) 
(spark.default.parallelism,8) 
(spark.shuffle.consolidateFiles,false) 
(spark.serializer,org.apache.spark.serializer.KryoSerializer) 
(spark.shuffle.spill.compress,false) 
(spark.driver.host,10.10.68.66) 
(spark.akka.timeout,300) 
(spark.driver.port,55328) 
(spark.eventLog.enabled,false) 
(spark.cassandra.connection.host,127.0.0.1) 
(spark.cassandra.connection.ssl.enabled,false) 
(spark.master,local[8]) 
(spark.cassandra.connection.ssl.trustStore.password,password) 
(spark.fileserver.uri,http://10.10.68.66:55329) 
(spark.cassandra.auth.username,username) 
(spark.local.dir,/tmp/spark) 
(spark.app.id,local-1436229075894) 
(spark.storage.blockManagerHeartBeatMs,300000) 
(spark.executor.id,<driver>) 
(spark.storage.memoryFraction,0.5) 
(spark.app.name,Count all entries 217885402) 
(spark.shuffle.compress,false) 

      

Collectable or packaged jar sent offline or mezos works great! Suggestions?

+3


source to share


2 answers


The reason was a large broadcast variable. It's not clear why (since it fits in memory), but removing it from the test cases made it work.



0


source


We faced the same issue in Spark 1.6.0 (there is already a bug report for it ) We fixed it by switching to the Kryo serializer (which you should use anyway). So it looks like a bug in the default JavaSerializer.

Just follow these steps to get rid of it:



new SparkConf().setAppName("Simple Application").set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")

      

+1


source







All Articles