【发布时间】:2013-01-30 04:04:37
【问题描述】:
我们正在启动一个基于大数据的分析项目,并且我们正在考虑采用 scala(类型安全堆栈)。我想知道可用于执行 hadoop、map reduce 程序的各种 scala API/项目。
【问题讨论】:
标签: scala hadoop mapreduce jvm-languages
我们正在启动一个基于大数据的分析项目,并且我们正在考虑采用 scala(类型安全堆栈)。我想知道可用于执行 hadoop、map reduce 程序的各种 scala API/项目。
【问题讨论】:
标签: scala hadoop mapreduce jvm-languages
一定要查看Scalding。作为用户和偶尔的贡献者,我发现它是一个非常有用的工具。 Scalding API 也意味着与标准 Scala 集合 API 非常兼容。就像你可以在普通集合上调用 flatMap、map 或 groupBy 一样,你可以在 scalding Pipes 上做同样的事情,你可以把它想象成一个分布式的元组列表。还有一个 API 的类型化版本,它提供了更强的类型安全保证。我没用过 Scoobi,但是 API 看起来和他们的差不多。
此外,还有其他一些好处:
【讨论】:
另一个选项是Stratosphere,它提供了一个Scala API,可以将Scala 类型转换为Stratosphere 的内部数据类型。
API 与 Scalding 非常相似,但 Stratosphere 本身支持高级数据流(因此您不必链接 MapReduce 作业)。与使用 Scalding 相比,使用 Stratosphere 的性能要好得多。
Stratosphere 不在 Hadoop MapReduce 上运行,而是在 Hadoop YARN 上运行,因此您可以在 use your existing YARN cluster 上运行。
这是 Stratosphere 中的字数统计示例(使用 Scala API):
val input = TextFile(textInput)
val words = input.flatMap { line => line.split(" ") }
val counts = words
.groupBy { word => word }
.count()
val output = counts.write(wordsOutput, CsvOutputFormat())
val plan = new ScalaPlan(Seq(output))
【讨论】: