My requirement is to serve a web service request using Apache Spark.
I developed a XML RPC server which will be triggered by a servlet code and it will in-turn run a spark-submit application. XML RPC will then wait for spark-submit to complete and send the result back to servlet.
My questions are:
Integrating spark with servlets can be challenging due to dependency issues, but leaving that aside, you might be better suited to having a long running driver program with a shared spark context since creating a spark context can take time (and you can't share cached data between different spark contexts). The Ooyala Spark job server can be useful for this, IBM also has a project intended for doing something similar called the Spark Kernel. Hope one of these projects