我正在使用下面的代码来启动 Spark 作业。
我想从com.test.Foo
Class 获取结果到启动 spark 应用程序的 Launcher 类中。
我不想将值写入临时文件并从 Launcher 类中读取它。有没有办法获得从 spark 主类返回的所需值com.test.Foo
。
有没有办法将值设置为当前会话并在需要的地方获取它?
SparkAppHandle handler = new SparkLauncher()
.setAppResource(<path to jar>)
.setMaster("yarn-cluster")
.setDeployMode("cluster")
.setVerbose(true)
.setMainClass("com.test.Foo")
.addAppArgs(args[0],args[1])
.startApplication();