Return-Path: X-Original-To: apmail-hadoop-common-dev-archive@www.apache.org Delivered-To: apmail-hadoop-common-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C890DC967 for ; Tue, 15 May 2012 18:36:11 +0000 (UTC) Received: (qmail 19268 invoked by uid 500); 15 May 2012 18:36:10 -0000 Delivered-To: apmail-hadoop-common-dev-archive@hadoop.apache.org Received: (qmail 19211 invoked by uid 500); 15 May 2012 18:36:10 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 19202 invoked by uid 99); 15 May 2012 18:36:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2012 18:36:10 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of samir.helpdoc@gmail.com designates 209.85.216.176 as permitted sender) Received: from [209.85.216.176] (HELO mail-qc0-f176.google.com) (209.85.216.176) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 May 2012 18:36:05 +0000 Received: by qcsc21 with SMTP id c21so5893527qcs.35 for ; Tue, 15 May 2012 11:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wruWpZ2gyLBY19s9J2MoxVdJbIpOcQBo/m446oiG55Y=; b=BNszpOznfwnUfomSd7lki/BXqdIspUtCbjGZRs0cE/lmOgb0j3pKvc2tJ54oJA6d7U l6zuahNbwbOiqfrBNG56/1Dt1A23PDvyGGaz0PsYplIlJz6q9uFGou94j8N8eG0hwi40 gBljOowhm8sRlCSYbqzrIpwZDLQ1xA/zcjWXg+NeUlIMyhLmWd/gI1s48UCqyOdZkLJE ii3t9YOKnE25m0ecWOjUp9vTVQZH5AOOwZKsWW6xPMsug3SePvKPFD3Fle+d6HR+qoWK owePIFWbEq2n+/mkAtwm01JQYuiCsYUidPLO+CbnMmT2F4KTE3nJ+ehmJdFw2q5Pxau8 LP0Q== MIME-Version: 1.0 Received: by 10.224.108.129 with SMTP id f1mr5195142qap.53.1337106944429; Tue, 15 May 2012 11:35:44 -0700 (PDT) Received: by 10.229.4.32 with HTTP; Tue, 15 May 2012 11:35:44 -0700 (PDT) In-Reply-To: <33849704.post@talk.nabble.com> References: <32876784.post@talk.nabble.com> <33849704.post@talk.nabble.com> Date: Wed, 16 May 2012 00:05:44 +0530 Message-ID: Subject: Re: Hadoop - Distributed sorting From: samir das mohapatra To: common-dev@hadoop.apache.org Content-Type: multipart/alternative; boundary=20cf3074b37e730d7304c0177837 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074b37e730d7304c0177837 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Steps to do this: 1) Map: It will only define the key value for each number 2) Combiner : To sort locally over chunk of dataset . 3) Reducer: It will sort after over whole chunk globally--------------> OUT PUT as sorted Note: set combiner and reducer as Same class. Example: Let us assume that our data set (integers) is constrained between 100 to 200 and we have 5 files each containing 1000 random integers between 100 and 200 (so a total of 5000 integers between 100 and 200). We read each file into a Map and then in the Reduce phase, we produce a final Map which contains the count of all the integers. Now if we sort all the integers from the final Map and output it into a list data structure in the form of then we have sorted all the data (see figure below). Aside : In Java, you don=92t even have to come up with the data-structure that I am talking about, if you just use a TreeMapin the final Reduce phase, then all the keys (i.e. data) are already sorted as long as the key type (e.g. String, Integer, etc.) implements the Comparableinterface ( Hadoop has something similar called WritableComparableand I am using a TreeMap that takes Strings as keys in Reducer Thanks Samir On Tue, May 15, 2012 at 11:31 PM, @dataElGrande wro= te: > > Check out Pentaho's howto's when dealing with Hadoop or NoSQL or anything > big > data related. http://wiki.pentaho.com/display/BAD/How+To%27s > > > madhu_sushmi wrote: > > > > Hi, > > I need to implement distributed sorting using Hadoop. I am quite new to > > Hadoop and I am getting confused. If I want to implement Merge sort, wh= at > > my Map and reduce should be doing. ? Should all the sorting happen at > > reduce side? > > > > Please help. This is an urgent requirement. Please guide me. > > > > Thanks, > > Madhu > > > > -- > View this message in context: > http://old.nabble.com/Hadoop---Distributed-sorting-tp32876784p33849704.ht= ml > Sent from the Hadoop core-dev mailing list archive at Nabble.com. > > --20cf3074b37e730d7304c0177837--