马preduce星火 [英] MapReduce to Spark

查看:190
本文介绍了马preduce星火的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Java编写的麻preduce工作。这取决于多个类。我想运行星火马preduce工作。

I have a MapReduce job written in Java. It depends on multiple classes. I want to run the MapReduce job on Spark.

我应该遵循哪些步骤做?

What steps should I follow to do the same?

我需要改变只对马preduce类?

I need to make changes only to the MapReduce class?

谢谢!

推荐答案

这是一个很广泛的问题,但短期的,它是:

This is a very broad question, but the short of it is:


  1. 创建输入数据的RDD。

  2. 呼叫地图与映射器code。输出键 - 值对。

  3. 呼叫 reduceByKey 与减速code。

  4. 写所产生的RDD到磁盘上。

  1. Create an RDD of the input data.
  2. Call map with your mapper code. Output key-value pairs.
  3. Call reduceByKey with your reducer code.
  4. Write the resulting RDD to disk.

Spark是比马preduce更加灵活:有很大不同的,你可以步骤1和4之间使用转换数据的方法。

Spark is more flexible than MapReduce: there is a great variety of methods that you could use between steps 1 and 4 to transform the data.

这篇关于马preduce星火的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆