Partitioning, Shuffle and sort  what happened?

- Partitioning
Partitioning is the process of determining which reducer instance will receive which intermediate keys and values. Each mapper must determine for all of its output (key, value) pairs which reducer will receive them. It is necessary that for any key, regardless of which mapper instance generated it, the destination partition is the same
Problem: how dose the hadoop make it? Use a hash function ? what is the function? 
here is code~
 public class HashPartitioner<K, V> extends Partitioner<K, V> {
public int getPartition(K key, V value, int numReduceTasks) {
return (key.hashCode() & Integer.MAX_VALUE) % numReduceTasks;
}
}

解释:将key均匀分布在ReduceTasks上,举例如果Key为Text的话,Text的hashcode方法跟String的基本一致,都是采用的Horner公式计算,得到一个int,string太大的话这个int值可能会溢出变成负数,所以与上Integer.MAX_VALUE(即0111111111111111),然后再对reduce个数取余,这样就可以让相同key分布在一个节点上,并且较为均匀的分布在reduce上

Horner规则:算法导论上有介绍这个,百度之

think about BloomFilter~ 保证这个任务任务分发的均匀是关键,所以要设计优秀的hash函数是关键

- Shuffle
After the first map tasks have completed, the nodes may still be performing several more map tasks each. But they also begin exchanging the intermediate outputs from the map tasks to where they are required by the reducers. This process of moving map outputs to the reducers is known as shuffling.
 
- Sort
Each reduce task is responsible for reducing the values associated with several intermediate keys. The set of intermediate keys on a single node is automatically sorted by Hadoop before they are presented to the Reducer 

Partitioning, Shuffle and sort的更多相关文章

  1. Hadoop-2.2.0中文文档—— MapReduce下一代- 可插入的 Shuffle 和 Sort

    简单介绍 可插入的 shuffle 和 sort 功能,同意在shuffle 和 sort 逻辑中用可选择的实现类替换.这个情况的样例是:用一个不是HTTP的应用协议,如RDMA来 shuffle 从 ...

  2. shuffle和sort分析

    MapReduce中的Shuffle和Sort分析 MapReduce 是现今一个非常流行的分布式计算框架,它被设计用于并行计算海量数据.第一个提出该技术框架的是Google 公司,而Google 的 ...

  3. mapreduce shuffle 和sort 详解

        MapReduce 框架的核心步骤主要分两部分:Map 和Reduce.当你向MapReduce 框架提交一个计算作业时,它会首先把计算作业拆分成若干个Map 任务,然后分配到不同的节点上去执 ...

  4. MapReduce中的Shuffle和Sort分析

    MapReduce 是现今一个非常流行的分布式计算框架,它被设计用于并行计算海量数据.第一个提出该技术框架的是Google 公司,而Google 的灵感则来自于函数式编程语言,如LISP,Scheme ...

  5. Spark Shuffle之Sort Shuffle

    源文件放在github,随着理解的深入,不断更新,如有谬误之处,欢迎指正.原文链接https://github.com/jacksu/utils4s/blob/master/spark-knowled ...

  6. 【Hadoop】MapReduce笔记(三):MapReduce的Shuffle和Sort阶段详解

    一.MapReduce 总体架构 整体的Shuffle过程包含以下几个部分:Map端Shuffle.Sort阶段.Reduce端Shuffle.即是说:Shuffle 过程横跨 map 和 reduc ...

  7. Hadoop : MapReduce中的Shuffle和Sort分析

    地址 MapReduce 是现今一个非常流行的分布式计算框架,它被设计用于并行计算海量数据.第一个提出该技术框架的是Google 公司,而Google 的灵感则来自于函数式编程语言,如LISP,Sch ...

  8. Add, remove, shuffle and sort

    To deal cards, we would like a method that removes a card from the deck and returns it. The list met ...

  9. MapReduce Shuffle And Sort

    引言   MapReduce作出保证:进入每个Reducer的数据行都是有序的(根据数据行的键值进行排序).MapReduce将Mapper的输出进行排序并传递给Reducer作为输入的过程称为Shu ...

随机推荐

  1. Spark SQL概念学习系列之Spark SQL 架构分析(四)

    Spark SQL 与传统 DBMS 的查询优化器 + 执行器的架构较为类似,只不过其执行器是在分布式环境中实现,并采用的 Spark 作为执行引擎. Spark SQL 的查询优化是Catalyst ...

  2. http://www.hameister.org/JavaFX_PuzzleGame.html

    http://www.hameister.org/JavaFX_PuzzleGame.html

  3. Spring Auto-Wiring Beans

    In Spring framework, you can wire beans automatically with auto-wiring feature. To enable it, just d ...

  4. CodeForces 560B Gerald is into Art

     Gerald is into Art time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  5. Codeforces Round #271 (Div. 2) D. Flowers (递推)

    题目链接:http://codeforces.com/problemset/problem/474/D 用RW组成字符串,要求w的个数要k个连续出现,R任意,问字符串长度为[a, b]时,字符串的种类 ...

  6. VMware搭建12.0搭建Mac OS10.11详细过程

    1.软件准备 1.1VMware12.0 1.2VMware增强包 1.3Mac OS10.11 cdr(相当于dmg) 1.4securable.exe 2.软件破解 2.1VMware输入序列号破 ...

  7. CoordinatorLayout的简单应用(材料设计新控件)

    CoordinatorLayout字面意思为:协调布局,一般作为根布局使用.关于这个布局,记录一下两个用法,备忘. 一.配合 FloatingActionBar 使用 <?xml version ...

  8. 初学Android 一 基本开发环境

    Android平台架构 1.应用程序层: 核心应用程序和普通应用程序,他们都是平级的,都可以平等的调用下层. 2.应用程序框架:供上一层调用的API. 3.函数库: 不能被直接调用的C/C++库的集合 ...

  9. PHP之路,Day1 - PHP基础

    本节内容  1.PHP介绍  2.第一个PHP脚本程序  3.PHP语言标记  4.指令分割符  5.程序注释  6.在程序中使用空白符的处理  7.变量  8.变量的类型  9.数据类型之间相互转换 ...

  10. freeRadius 基础配置及测试

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html 内部邀请码:C8E245J (不写邀请码,没有现金送) 国 ...