Deploy Apache Spark application from another application in Java, best practice

后端 未结 3 1023
有刺的猬
有刺的猬 2021-02-10 04:37

I am a new user of Spark. I have a web service that allows a user to request the server to perform a complex data analysis by reading from a database and pushing the results bac

3条回答
  •  失恋的感觉
    2021-02-10 05:15

    The web server can also act as the Spark driver. So it would have a SparkContext instance and contain the code for working with RDDs.

    The advantage of this is that the Spark executors are long-lived. You save time by not having to start/stop them all the time. You can cache RDDs between operations.

    A disadvantage is that since the executors are running all the time, they take up memory that other processes in the cluster could possibly use. Another one is that you cannot have more than one instance of the web server, since you cannot have more than one SparkContext to the same Spark application.

提交回复
热议问题