Return-Path: Delivered-To: apmail-hadoop-core-user-archive@www.apache.org Received: (qmail 33718 invoked from network); 27 Jun 2009 15:30:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jun 2009 15:30:39 -0000 Received: (qmail 65008 invoked by uid 500); 27 Jun 2009 15:30:48 -0000 Delivered-To: apmail-hadoop-core-user-archive@hadoop.apache.org Received: (qmail 64916 invoked by uid 500); 27 Jun 2009 15:30:47 -0000 Mailing-List: contact core-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-user@hadoop.apache.org Delivered-To: mailing list core-user@hadoop.apache.org Received: (qmail 64906 invoked by uid 99); 27 Jun 2009 15:30:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jun 2009 15:30:47 +0000 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=HTML_MESSAGE,SPF_PASS,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of stuart.white1@gmail.com designates 209.85.217.215 as permitted sender) Received: from [209.85.217.215] (HELO mail-gx0-f215.google.com) (209.85.217.215) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jun 2009 15:30:38 +0000 Received: by gxk11 with SMTP id 11so4771449gxk.5 for ; Sat, 27 Jun 2009 08:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=62ugOK9tj3fGk1aqqgeCPGI7pITC3FQEnApLhJN+G9Q=; b=xXYNSUYcgaaHmFl6oFYQaJksDWV7gNWsckG6tDJuEzfyR10kmQif9sbuLPryunoM3E P7lgE2GNK6ai7NIda3vzan1zUSMik2CowxPPQ4VW0EAQe0GLL+jJLRMMcVAIrsg/708l 7zOUObwcyKXIGIlr59h3oJoIDQTjsF0xZ/3KE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=B9ORqcwEuUQGrld+YeGJrTBcuJNitIYjo8PRt1tG6k1ROgp62kl2vJMxyyYK5EQtkk zxFE+vlPCcqyMQ7KzSQiiBM7GYoq6jFQbLWKL816QiM0orijAWlHDzpCuGwAi/DqTuve mkd1nDQVRq0bCrDNWFwD4Jl+3iHsHYZnfQOIs= MIME-Version: 1.0 Received: by 10.151.72.5 with SMTP id z5mr1513683ybk.218.1246116617578; Sat, 27 Jun 2009 08:30:17 -0700 (PDT) In-Reply-To: <4af5cd780906270825w1242a689p96d23e293d2cedb0@mail.gmail.com> References: <4af5cd780906270825w1242a689p96d23e293d2cedb0@mail.gmail.com> Date: Sat, 27 Jun 2009 10:30:17 -0500 Message-ID: <4af5cd780906270830r58d4d009r5e5ba258629e163b@mail.gmail.com> Subject: Re: Confused about partitioning and reducers From: Stuart White To: core-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=001e680f102056e976046d5622fe X-Virus-Checked: Checked by ClamAV on apache.org --001e680f102056e976046d5622fe Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Please disregard this question. I think I'm mistaken. On Sat, Jun 27, 2009 at 10:25 AM, Stuart White wrote: > If I call HashPartitioner.getPartition(), passing a key of 4 and a > numPartitions of 5, it returns a partition of 4. (Which is what I would > expect.) > > However, if I have a mapred job, and in my mapper I emit a record with key > 4, I'm configured to use the HashPartitioner, I have 5 Reducers configured, > and I'm using the IdentityReducer, the record with key 4 gets handled by > Reducer #0 (because it gets written out to part-00000). > > I would have expected a record with key 4 to be handled by reducer #4 (and > therefore written to part-00004) because the HashPartitioner returns 4 for a > key of 4 and a numPartitions of 5. > > Obviously I'm missing something here. What is the logic for deciding which > partition of records is handled by which reducer instance? > > It can't be random, otherwise mapside join wouldn't work. > > Thanks. > --001e680f102056e976046d5622fe--