trying to understand HashPartitioner

2015-03-18 Thread xeonmailinglist-gmail

Hi,

I am trying to understand how |HashPartitioner.java| works. Thus, I ran 
a mapreduce job with 5 reducers and 5 input files. I thought that the 
output of |getPartition(K2 key, V2 value, int numReduceTasks)| was the 
number of reduce task that |K2| and |V2| will execute. Is this correct?


​

--
--



Re: trying to understand HashPartitioner

2015-03-18 Thread xeonmailinglist-gmail

What tells with partition will run on which reduce task?

On 18-03-2015 09:30, xeonmailinglist-gmail wrote:


Hi,

I am trying to understand how |HashPartitioner.java| works. Thus, I 
ran a mapreduce job with 5 reducers and 5 input files. I thought that 
the output of |getPartition(K2 key, V2 value, int numReduceTasks)| was 
the number of reduce task that |K2| and |V2| will execute. Is this 
correct?


​
--
--


--
--



Re: trying to understand HashPartitioner

2015-03-18 Thread Jianfeng (Jeff) Zhang

You can take it similar as the HashMap of java. Use the hashCode of one object 
to distribute it into different bucket.



Best Regard,
Jeff Zhang


From: xeonmailinglist-gmail 
xeonmailingl...@gmail.commailto:xeonmailingl...@gmail.com
Reply-To: user@hadoop.apache.orgmailto:user@hadoop.apache.org 
user@hadoop.apache.orgmailto:user@hadoop.apache.org
Date: Wednesday, March 18, 2015 at 7:08 PM
To: user@hadoop.apache.orgmailto:user@hadoop.apache.org 
user@hadoop.apache.orgmailto:user@hadoop.apache.org
Subject: Re: trying to understand HashPartitioner

What tells with partition will run on which reduce task?

On 18-03-2015 09:30, xeonmailinglist-gmail wrote:

Hi,

I am trying to understand how HashPartitioner.java works. Thus, I ran a 
mapreduce job with 5 reducers and 5 input files. I thought that the output of 
getPartition(K2 key, V2 value, int numReduceTasks) was the number of reduce 
task that K2 and V2 will execute. Is this correct?

​

--
--


--
--