I have used Spark ML and was able to get reasonable accuracy in prediction for my business problem
The data is not huge and I was able to transform the input ( basically a csv file ) using stanford NLP and run Naive Bayes for prediction in my local machine.
I want to run this prediction service like a simple java main program or along with a simple MVC web application
Currently I run my prediction using the spark-submit command ? Instead , can I create spark context and data frames from my servlet / controller class ?
I could not find any documentation on such scenarios.
Kindly advise regarding the feasibility of the above
Spark has REST apis to submit jobs by invoking spark master hostname.
Submit an Application:
Submission Response:
Get the status of a submitted application
Status Response
Now in the spark application which you submit should perform all the operations and
save output to any datasource and access the data via thrift server
as don't have much data to transfer(you can think of sqoop if you want to transfer data between your MVC app db and Hadoop cluster).credits: link1, link2
Edit: (as per question in comment) build spark application jar with necessary dependencies and run the job in local mode. Write the jar in way to read the CSV and make use of MLib then store the prediction output in some data source to access it from web app.