0

目标是在 Spark JobServer 的本地实例上创建以下内容:

object foo extends SparkJob with NamedRddSupport

问题:如何解决每个作业中发生的以下错误:

{
  "status": "ERROR",
  "result": {
    "message": "Ask timed out on [Actor[akka://JobServer/user/context-supervisor/439b2467-spark.jobserver.genderPrediction#884262439]] after [10000 ms]",
    "errorClass": "akka.pattern.AskTimeoutException",
    "stack: ["akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:334)", "akka.actor.Scheduler$$anon$7.run(Scheduler.scala:117)", "scala.concurrent.Future$InternalCallbackExecutor$.scala$concurrent$Future$InternalCallbackExecutor$$unbatchedExecute(Future.scala:694)", "scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:691)", "akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(Scheduler.scala:467)", "akka.actor.LightArrayRevolverScheduler$$anon$8.executeBucket$1(Scheduler.scala:419)", "akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:423)", "akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)", "java.lang.Thread.run(Thread.java:745)"]
  }
}

Spark JobServer 更详细的错误描述:

job-server[ERROR] Exception in thread "pool-100-thread-1" java.lang.AbstractMethodError: spark.jobserver.genderPrediction$.namedObjectsPrivate()Ljava/util/concurrent/atomic/AtomicReference;
job-server[ERROR]   at spark.jobserver.JobManagerActor$$anonfun$spark$jobserver$JobManagerActor$$getJobFuture$4.apply(JobManagerActor.scala:248)
job-server[ERROR]   at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
job-server[ERROR]   at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
job-server[ERROR]   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
job-server[ERROR]   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
job-server[ERROR]   at java.lang.Thread.run(Thread.java:745)

如果有人想查看代码:

package spark.jobserver
import org.apache.spark.SparkContext._
import org.apache.spark.{SparkContext}
import com.typesafe.config.{Config, ConfigFactory}
import collection.JavaConversions._
import scala.io.Source

object genderPrediction extends SparkJob with NamedRddSupport
{
  // Main function
  def main(args: scala.Array[String]) 
  {
    val sc = new SparkContext()
    sc.hadoopConfiguration.set("fs.tachyon.impl", "tachyon.hadoop.TFS")
    val config = ConfigFactory.parseString("")
    val results = runJob(sc, config)
  }

  def validate(sc: SparkContext, config: Config): SparkJobValidation = {SparkJobValid}

  def runJob(sc: SparkContext, config: Config): Any =
  {
    return "ok";
  }
}

版本信息:Spark 是 1.5.0 - SparkJobServer 是最新版本

提前非常感谢大家!

4

2 回答 2

1

确保依赖包的 your.compile 和运行时库版本相同。

于 2016-02-10T16:53:34.147 回答
1

为@noorul 的答案添加更多解释

似乎您使用旧版本的 SJS 编译了代码,并且正在使用最新版本运行它。

最近添加了命名对象。您收到 AbstractMethodError 是因为您的服务器需要 NamedObjects 支持,而您没有使用它编译代码。

另外:您不需要那里的 main 方法,因为它不会由 SJS 执行。

于 2016-02-17T18:23:53.683 回答