简体   繁体   English

支持Map的IDE减少Scala中的程序

[英]IDE supporting Map reduce programs in Scala

Hi can anyone suggest the suitable IDE for writing mapreduce programs in Scala? 嗨,有人可以建议适合的IDE在Scala中编写mapreduce程序吗? Please provide the sample code for WordCount Program in Scala using mapreduce. 请使用mapreduce提供Scala中WordCount程序的示例代码。

If you are talking about distributed computations so the main player in this area in scala world is Spark . 如果您正在谈论分布式计算,那么在scala世界中该领域的主要参与者是Spark

Words count example is coming with documentation : 文档附带了字数统计示例:

val textFile = spark.textFile("hdfs://...")
val counts = textFile.flatMap(line => line.split(" "))
                 .map(word => (word, 1))
                 .reduceByKey(_ + _)
counts.saveAsTextFile("hdfs://...")

You can run this code in interactive shell or in your program. 您可以在交互式外壳程序或程序中运行此代码。 Spark context could be created this way: 可以通过以下方式创建Spark上下文:

val conf = new SparkConf().setAppName("Simple Application")
val spark = new SparkContext(conf)

There are also many ready to run examples on Github Github上也有很多准备运行的示例

You can use eclipse as Spark application is essentially scala code. 您可以使用Eclipse,因为Spark应用程序本质上是scala代码。
Any ide will only help in developing (writing the code) and not in debugging since this application is submitted to Hadoop cluster and executed parallely in all the nodes. 任何想法都只会帮助开发(编写代码),而不会帮助调试,因为此应用程序已提交到Hadoop集群并在所有节点中并行执行。

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

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