【发布时间】:2015-05-13 14:34:58
【问题描述】:
我最近一直在尝试apache spark。我的问题更具体到触发火花工作。 Here我发布了关于理解火花工作的问题。在工作变得肮脏之后,我转向了我的要求。
我有一个 REST 端点,我在其中公开 API 以触发 Jobs,我使用 Spring4.0 进行 Rest 实现。现在继续前进,我想在 Spring 中实现 Jobs as Service,我将以编程方式提交 Job,这意味着当端点被触发时,我将使用给定的参数触发作业。 我现在几乎没有设计选择。
-
类似于下面的书面作业,我需要维护几个由抽象类调用的作业可能是
JobScheduler。/*Can this Code be abstracted from the application and written as as a seperate job. Because my understanding is that the Application code itself has to have the addJars embedded which internally sparkContext takes care.*/ SparkConf sparkConf = new SparkConf().setAppName("MyApp").setJars( new String[] { "/path/to/jar/submit/cluster" }) .setMaster("/url/of/master/node"); sparkConf.setSparkHome("/path/to/spark/"); sparkConf.set("spark.scheduler.mode", "FAIR"); JavaSparkContext sc = new JavaSparkContext(sparkConf); sc.setLocalProperty("spark.scheduler.pool", "test"); // Application with Algorithm , transformations 扩展上述点有多个版本的作业由服务处理。
或者使用 Spark 作业服务器来执行此操作。
首先,我想知道在这种情况下最好的解决方案是什么,无论是执行还是扩展。
注意:我使用的是 spark 的独立集群。 请帮忙。
【问题讨论】:
-
我在这个问题中添加了 Spring for Apache Hadoop 标签。 Spring Batch Admin 提供了一个用于管理和启动作业的 REST API,我相信 Spring for Apache Hadoop 提供了从 Spring Batch 启动 Spark 作业的能力......
-
@MichaelMinella :谢谢你的建议,我一定会考虑的。
标签: rest apache-spark spring-batch job-scheduling spring-data-hadoop