In this post I will show you how to submit a Spark job from Java code. Typically,
we submit Spark jobs to "Spark Cluster" (standalone Spark cluster) and Hadoop/YARN
(MapReduce/Hadoop cluster) by using the $SPARK_HOME/bin/spark-submit
shell
script. Submitting Spark job from a shell script limits programmers when they want
to submit Spark jobs from Java code (such as Java servlets or other Java code such
as REST servers).