0

I am using the Spark JobServer Java Client from this GitHub project:

https://github.com/bluebreezecf/SparkJobServerClient

I am able to upload a Jar containing the Job I want to execute to Spark JobServer. The logs indicate it is stored in /tmp/spark-jobserver directory structure. However, when accessing it from the context I create, the Job class if not found, so the Jar is not being loaded for my Job request.

EDIT: I later discovered that the jar that is uploaded by the Java Client is corrupt. That is why Spark JobServer cannot use it. When I manually replaced it with a good Jar the JobServer ran it fine. Now, the real problem is related to the client's uploadSparkJobJar() API.

org.khaleesi.carfield.tools.sparkjobserver.api.SparkJobServerClientException: Spark Job Server http://sparkjobserverhost:8090/ response 404 { "status": "ERROR", "result": "classPath org.kritek.scalability.jobs.Olap1 not found" }

Here is my code:

        //POST /contexts/<name>--Create context with parameters
        Map<String, String> params = new HashMap<String, String>();
        params.put(ISparkJobServerClientConstants.PARAM_MEM_PER_NODE, "512m");
        params.put(ISparkJobServerClientConstants.PARAM_NUM_CPU_CORES, "10");
        params.put("dependent-jar-uris", "file:///tmp/spark-jobserver/filedao/data/olap1_job-2016-08-11T04_47_07.802Z.jar");
        boolean success = client.createContext(contextName, params);

        assertTrue(success);

        //dependent-jar-uris=file:///some/path/of/my-foo-lib.jar

        //Post /jobs---Create a new job 
        params.put(ISparkJobServerClientConstants.PARAM_APP_NAME, appName);
        params.put(ISparkJobServerClientConstants.PARAM_CLASS_PATH, "org.kritek.scalability.jobs.Olap1");

        SparkJobResult result = null;
        String jobId = null;

        params.put(ISparkJobServerClientConstants.PARAM_CONTEXT, contextName);
        params.put(ISparkJobServerClientConstants.PARAM_SYNC, "true");
        result = client.startJob("conf-1=1", params);
Jason
  • 2,006
  • 3
  • 21
  • 36

1 Answers1

0

Check the answer from here spark submit java.lang.ClassNotFoundException

Note: if you are used maven project you could use mvn package assembly:single to include your dependecies.

spark-submit --class Test --master yarn --deploy-mode cluster --supervise --verbose jarName.jar hdfs:///somePath/Test.txt hdfs:///somePath/Test.out

Try to use, also you could check the absolute path in your project

--class com.myclass.Test
SharpLu
  • 1,136
  • 2
  • 12
  • 28