Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplest example #13

Open
Volodymyr128 opened this issue May 16, 2017 · 6 comments
Open

Simplest example #13

Volodymyr128 opened this issue May 16, 2017 · 6 comments

Comments

@Volodymyr128
Copy link

Could you please provide with simplest working example (with JAR).

My own JARs (which work through standard Java API) failed. Job status contains null as message, so I can't figure out what's going wrong.

@ywilkof
Copy link
Owner

ywilkof commented May 21, 2017

Hi @Volodymyr128,
I just validated that the examples for requesting job status in the README file work as expected, so you can use them. I validated now with Spark 2.0 and message field was not null and contained a detailed error. It sounds like there might be something problematic with your setup? If you give more details I might be able to help.

@mahmoudparsian
Copy link

mahmoudparsian commented May 21, 2017 via email

@ywilkof
Copy link
Owner

ywilkof commented May 22, 2017

Tested this with a cluster, which consists of one Master an one Executor, both local, run in Standalone mode.

In this example the Jar Spark should use does not exists.

          @Test
    public void submitAndRequestStatus() throws FailedSparkRequestException {
        SparkRestClient client = SparkRestClient.builder()
                .masterHost("ywilkof-XPS-13-9343")
                .sparkVersion("2.0.0")
                .build();

        final String submissionId = client.prepareJobSubmit()
                .appName("MySparkJob!")
                .appResource("file:/not/exist.jar")
                .mainClass("com.sparkjobs.Test")
                .submit();

        final DriverState driverState = client
                .checkJobStatus()
                .withSubmissionId(submissionId);

        System.out.println(driverState);

        JobStatusResponse jobStatus =
                client
                        .checkJobStatus()
                        .withSubmissionIdFullResponse(submissionId);

        System.out.println(jobStatus.getWorkerHostPort());
        System.out.println(jobStatus.getMessage());

    }

And following is the output:

ERROR
192.168.178.96:46367
Exception from the cluster:
java.nio.file.NoSuchFileException: /not/exist.jar
	sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:526)
	sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
	java.nio.file.Files.copy(Files.java:1274)
	org.apache.spark.util.Utils$.org$apache$spark$util$Utils$$copyRecursive(Utils.scala:607)
	org.apache.spark.util.Utils$.copyFile(Utils.scala:578)
	org.apache.spark.util.Utils$.doFetchFile(Utils.scala:663)
	org.apache.spark.util.Utils$.fetchFile(Utils.scala:462)
	org.apache.spark.deploy.worker.DriverRunner.org$apache$spark$deploy$worker$DriverRunner$$downloadUserJar(DriverRunner.scala:154)
	org.apache.spark.deploy.worker.DriverRunner$$anon$1.run(DriverRunner.scala:83)

@mahmoudparsian
Copy link

mahmoudparsian commented May 22, 2017 via email

@ywilkof
Copy link
Owner

ywilkof commented Jun 9, 2017

Hi @mahmoudparsian ,
I am not sure what a full Jar would supply that above example does not already provide. Are you interested in something specific? Is there some setup that does not function properly for you?

@NizarNi
Copy link

NizarNi commented Apr 17, 2018

It doesn't work! I am trying to sumpit spark pi job to the cluster I always get :

this is workersHostPort: Optional.empty
this is job statusMsg: null

and the submitted job gonna be found in Running Drivers and without any worker
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants