apache spark launcher - Java Big Data

Java examples for Big Data:apache spark

Description

apache spark launcher

Demo Code



import org.apache.spark.launcher.SparkLauncher;

public class MyLauncher {
    public static void main(String[] args) throws Exception {
        Process spark = new SparkLauncher().setAppResource("/my/app.jar")
                .setMainClass("my.spark.app.Main").setMaster("local")
                .setConf(SparkLauncher.DRIVER_MEMORY, "2g").launch();
        spark.waitFor();/*from  w  w  w. j  a v a 2 s. com*/
    }
}

Related Tutorials