Spark驱动程序作为REST API

问题描述 投票:0回答:1

我们可以有一个充当Rest API的spark驱动程序吗?使用此Rest API(1个驱动程序),我可以即时(实时)启动多个执行程序。我的意思是,每当有新请求发出Spark Driver(RestAPI)时,它都需要启动新的执行程序,而不是另一个新的驱动程序。

示例场景:

Assume you have a model with 3 steps
1) Read from one set of tables and applies join and many transformations.
2) Read from second set of tables and applies join and many transformations.
3) Finally compare above dataframes and update back some records. 

Here we have 3 input values to the model.
Likewise we have 1000 combinations of input values for the model  to run.
apache-spark apache-spark-sql apache-spark-dataset
1个回答
1
投票

Offcourse,您可以将驱动程序用作rest api。

[一旦收到请求,只要准备好RDD / DF,然后执行一个操作,它将起作用。

[您可以在驱动程序中执行此操作(这意味着SparkContext始终处于运行状态,并占用资源),也可以将其与REST Api封装在一起,以根据请求将作业提交到集群。(然后为每个作业创建一个新的SparkContext )。

© www.soinside.com 2019 - 2024. All rights reserved.