无法提交简单的 SnappySQLJob
Unable to submit a simple SnappySQLJob
我无法提交仅执行 System.out.println() 的简单作业。这是我从 SnappyData Lead 那里得到的错误。
snappy-job.sh submit --lead 10.0.18.66:8090 --app-name SimpleJobApp
--class snappydata.jobs.SimpleJob --app-jar simpleJob.jar OKOK{ "status": "ERROR", "result": {
"message": "null",
"errorClass": "scala.MatchError",
"stack": ["spark.jobserver.JobManagerActor$$anonfun$spark$jobserver$JobManagerActor$$getJobFuture.apply(JobManagerActor.scala:244)", "scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)", "scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)", "java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)", "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)", "java.lang.Thread.run(Thread.java:745)"] }
这是工作:
public class SimpleJob implements SnappySQLJob {
/**
*
*/
public SimpleJob() {
System.out.println(getClass().getSimpleName()+" Created");
}
@Override
public Object runJob(Object sparkContext, Config jobConfig) {
SnappyContext snappyContext = (SnappyContext)sparkContext;
System.out.println(getClass().getSimpleName()+".runJob: executed");
return null;
}
@Override
public SparkJobValidation validate(Object sparkContext, Config jobConfig) {
SnappyContext snappyContext = (SnappyContext)sparkContext;
System.out.println(getClass().getSimpleName()+".validate: executed");
return null;
}
}
这是 SnappyData 潜在客户日志:
16/08/05 17:44:07.352 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-14 信息 JarManager:为应用程序 SimpleJobApp 存储 jar,1052 字节 16/08/05 17:44:07 .368 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-19 信息 LocalContextSupervisorActor:创建名为 snappyContext1470419047337607598 16/08/05 17:44:07.369 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-16 的 SparkContext 信息 JobManagerActor:正在启动actor spark.jobserver.JobManagerActor 16/08/05 17:44:07.371 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-16 信息 JobStatusActor:启动 actor spark.jobserver.JobStatusActor 16/08/05 17:44:07 .371 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-14 信息 JobResultActor:起始演员 spark.jobserver.JobResultActor 16/08/05 17:44:07.371 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 LocalContextSupervisorActor : SparkContext snappyContext1470419047337607598 已初始化 16/08/05 17:44:07.375 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-16 信息 RddManagerActor:启动演员 spark.jobserver.RddManagerActor 16/08/05 17:44:07.389 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 JobManagerActor:正在加载 class snappydata.jobs.SimpleJob pp SimpleJobApp 16/08/05 17:44:07.389 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 SparkContext:添加 JAR /tmp/spark-jobserver/filedao/data/SimpleJobApp-2016-08-05T17_44_07.353Z.jar 在 http://10.0.18.66:50772/jars/SimpleJobApp-2016-08-05T17_44_07.353Z.jar 带有时间戳1470419047389 16/08/05 17:44:07.390 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息上下文URL类加载器:已添加 URL 文件:/tmp/spark-jobserver/filedao/data/SimpleJobApp-2016-08-05T17_44_07.353Z.jar 到 ContextURLClassLoader 16/08/05 17:44:07.390 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 INFO JarUtils$:加载对象 snappydata.jobs.SimpleJob$ 使用加载器 spark.jobserver.util.ContextURLClassLoader@709f3e69 16/08/05 17:44:07.391 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 JarUtils$:加载 class snappydata.jobs.SimpleJob 使用加载器 spark.jobserver.util.ContextURLClassLoader@709f3e69 16/08/05 17:44:07.392 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 JobManagerActor:启动 Spark 作业 376c8d23-6b49-4138-aadd-e4cff8f9f945 [snappydata.jobs.SimpleJob] ... 16/08/05 17:44:07.398 UTC pool-29-thread-1 INFO JobManagerActor:开始工作未来线程 16/08/05 17:44:07.402 UTC SnappyLeadJobServer-akka.actor.default -dispatcher-17 INFO JobStatusActor:作业 376c8d23-6b49-4138-aadd-e4cff8f9f945 已完成,但出现错误 16/08/05 17:44:07.402 U TC pool-29-thread-2 WARN JobManagerActor:作业 376c8d23-6b49-4138-aadd-e4cff8f9f945 异常:scala.MatchError:spark.jobserver.JobManagerActor$$anonfun$spark$jobserver$JobManagerActor$$getJobFuture$ 处为空4.apply(JobManagerActor.scala:244) 在 scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) 在 scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread.java:745)
Java 使用 scala API 的程序给出了这个 error.I 已经用 Java API 编写了 SimpleJob。
public class SimpleJob extends JavaSnappySQLJob {
public SimpleJob() {
System.out.println(getClass().getSimpleName()+" Created");
}
@Override
public Object runJavaJob(SnappyContext snappyContext, Config config) {
System.out.println(getClass().getSimpleName()+".runJob:
executed");
return null;
}
@Override
public JSparkJobValidation isValidJob(SnappyContext snappyContext, Config config) {
System.out.println(getClass().getSimpleName()+".validate: executed");
return new JSparkJobValid();
}
}
我无法提交仅执行 System.out.println() 的简单作业。这是我从 SnappyData Lead 那里得到的错误。
snappy-job.sh submit --lead 10.0.18.66:8090 --app-name SimpleJobApp
--class snappydata.jobs.SimpleJob --app-jar simpleJob.jar OKOK{ "status": "ERROR", "result": {
"message": "null",
"errorClass": "scala.MatchError",
"stack": ["spark.jobserver.JobManagerActor$$anonfun$spark$jobserver$JobManagerActor$$getJobFuture.apply(JobManagerActor.scala:244)", "scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1(Future.scala:24)", "scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)", "java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)", "java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)", "java.lang.Thread.run(Thread.java:745)"] }
这是工作:
public class SimpleJob implements SnappySQLJob {
/**
*
*/
public SimpleJob() {
System.out.println(getClass().getSimpleName()+" Created");
}
@Override
public Object runJob(Object sparkContext, Config jobConfig) {
SnappyContext snappyContext = (SnappyContext)sparkContext;
System.out.println(getClass().getSimpleName()+".runJob: executed");
return null;
}
@Override
public SparkJobValidation validate(Object sparkContext, Config jobConfig) {
SnappyContext snappyContext = (SnappyContext)sparkContext;
System.out.println(getClass().getSimpleName()+".validate: executed");
return null;
}
}
这是 SnappyData 潜在客户日志:
16/08/05 17:44:07.352 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-14 信息 JarManager:为应用程序 SimpleJobApp 存储 jar,1052 字节 16/08/05 17:44:07 .368 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-19 信息 LocalContextSupervisorActor:创建名为 snappyContext1470419047337607598 16/08/05 17:44:07.369 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-16 的 SparkContext 信息 JobManagerActor:正在启动actor spark.jobserver.JobManagerActor 16/08/05 17:44:07.371 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-16 信息 JobStatusActor:启动 actor spark.jobserver.JobStatusActor 16/08/05 17:44:07 .371 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-14 信息 JobResultActor:起始演员 spark.jobserver.JobResultActor 16/08/05 17:44:07.371 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 LocalContextSupervisorActor : SparkContext snappyContext1470419047337607598 已初始化 16/08/05 17:44:07.375 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-16 信息 RddManagerActor:启动演员 spark.jobserver.RddManagerActor 16/08/05 17:44:07.389 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 JobManagerActor:正在加载 class snappydata.jobs.SimpleJob pp SimpleJobApp 16/08/05 17:44:07.389 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 SparkContext:添加 JAR /tmp/spark-jobserver/filedao/data/SimpleJobApp-2016-08-05T17_44_07.353Z.jar 在 http://10.0.18.66:50772/jars/SimpleJobApp-2016-08-05T17_44_07.353Z.jar 带有时间戳1470419047389 16/08/05 17:44:07.390 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息上下文URL类加载器:已添加 URL 文件:/tmp/spark-jobserver/filedao/data/SimpleJobApp-2016-08-05T17_44_07.353Z.jar 到 ContextURLClassLoader 16/08/05 17:44:07.390 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 INFO JarUtils$:加载对象 snappydata.jobs.SimpleJob$ 使用加载器 spark.jobserver.util.ContextURLClassLoader@709f3e69 16/08/05 17:44:07.391 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 JarUtils$:加载 class snappydata.jobs.SimpleJob 使用加载器 spark.jobserver.util.ContextURLClassLoader@709f3e69 16/08/05 17:44:07.392 UTC SnappyLeadJobServer-akka.actor.default-dispatcher-17 信息 JobManagerActor:启动 Spark 作业 376c8d23-6b49-4138-aadd-e4cff8f9f945 [snappydata.jobs.SimpleJob] ... 16/08/05 17:44:07.398 UTC pool-29-thread-1 INFO JobManagerActor:开始工作未来线程 16/08/05 17:44:07.402 UTC SnappyLeadJobServer-akka.actor.default -dispatcher-17 INFO JobStatusActor:作业 376c8d23-6b49-4138-aadd-e4cff8f9f945 已完成,但出现错误 16/08/05 17:44:07.402 U TC pool-29-thread-2 WARN JobManagerActor:作业 376c8d23-6b49-4138-aadd-e4cff8f9f945 异常:scala.MatchError:spark.jobserver.JobManagerActor$$anonfun$spark$jobserver$JobManagerActor$$getJobFuture$ 处为空4.apply(JobManagerActor.scala:244) 在 scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) 在 scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread.java:745)
Java 使用 scala API 的程序给出了这个 error.I 已经用 Java API 编写了 SimpleJob。
public class SimpleJob extends JavaSnappySQLJob {
public SimpleJob() {
System.out.println(getClass().getSimpleName()+" Created");
}
@Override
public Object runJavaJob(SnappyContext snappyContext, Config config) {
System.out.println(getClass().getSimpleName()+".runJob:
executed");
return null;
}
@Override
public JSparkJobValidation isValidJob(SnappyContext snappyContext, Config config) {
System.out.println(getClass().getSimpleName()+".validate: executed");
return new JSparkJobValid();
}
}