title: How To get the values returned from Spark Job class into Spark Launcher class
body: <p>I am using the below piece of code to launch the Spark Job.</p>
  
  <p>I want to get the result from <code>com.test.Foo</code> Class into the Launcher class which starts the spark application.</p>
  
  <p>I don't want to write the values to a temporary file and read it from the Launcher Class. Is there a way to get the required values returned from the spark main class <code>com.test.Foo</code> .</p>
  
  <p>Is there a way to set the values to current session and get it wherever required?</p>
  
  <pre><code>SparkAppHandle handler = new SparkLauncher()
                              .setAppResource(&lt;path to jar&gt;)
                              .setMaster("yarn-cluster") 
                              .setDeployMode("cluster")
                              .setVerbose(true)
                              .setMainClass("com.test.Foo")               
                              .addAppArgs(args[0],args[1])
                              .startApplication();
  </code></pre>