简体   繁体   English

Playframework&Spark

[英]Playframework & Spark

I want to get started with the Playframework and Apache Spark. 我想开始使用Playframework和Apache Spark。

I found the following activator to start with: https://www.typesafe.com/activator/template/spark-play 我找到了以下激活器: https//www.typesafe.com/activator/template/spark-play

Question 1: 问题1:

Is this a reasonably good way to integrate spark into play? 这是将火花融入游戏的合理方法吗? Or should I start differently? 或者我应该开始不一样? As most activators here https://www.typesafe.com/activator/templates#filter:spark seem to work directly with AKKA or AKKA & spray. 由于大多数活化剂在这里https://www.typesafe.com/activator/templates#filter:spark似乎直接与AKKA或AKKA&喷雾。 Is an explicit AKKA integration needed at all as Play from 2.4 on is based on AKKA-HTTP? 是否需要明确的AKKA集成,因为Play on 2.4 on基于AKKA-HTTP?

Question 2: 问题2:

在此输入图像描述

The dependencies are managed in a non-standard way eg not using the standard build.sbt. 依赖关系以非标准方式管理,例如不使用标准build.sbt。 layout. 布局。 Is this "recommended" for spark integration? 这是“推荐”用于火花整合吗? What are the benefits of it? 它有什么好处?

The Scala-dependency file is accompanied with Scala依赖文件附带

import play.sbt.PlayImport._
import play.sbt.routes.RoutesKeys._


name         := """sparkTest"""
organization := "ch.alexmass"
version      := "0.0.1"
scalaVersion := Version.scala



lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaSource in Compile <<= baseDirectory / "src/scala"

libraryDependencies ++= Dependencies.sparkAkkaHadoop

dependencyOverrides ++= Set(
  "com.fasterxml.jackson.core" % "jackson-databind" % "2.4.4"
)

releaseSettings

scalariformSettings

ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }

//routesGenerator := InjectedRoutesGenerator


fork in run := true

Thank you. 谢谢。

during the last couple of days I learnt a lot. 在过去的几天里,我学到了很多东西。 I will try to answer this question myself. 我会尽力回答这个问题。

Question 1 问题1

Play is fullstack and based on AKKA. Play是fullstack,基于AKKA。 I think for a prototype / UI app this integration is fine. 我认为对于原型/ UI应用程序,这种集成很好。

For a REST-only API AKKA only with something like spray would be better & faster. 对于仅支持REST的API,AKKA只有像喷雾这样的东西会更好更快。 However spray will be deprecated in favour of akka-http. 但是,不推荐使用spray来支持akka-http。

Question 2 问题2

This is up to personal preference. 这取决于个人喜好。 However may sometimes provide a clearer structure of the dependencies. 但是,有时可能会提供更清晰的依赖关系结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM