Return-Path: X-Original-To: apmail-hadoop-common-user-archive@www.apache.org Delivered-To: apmail-hadoop-common-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F27FB6F18 for ; Fri, 20 May 2011 17:17:55 +0000 (UTC) Received: (qmail 37589 invoked by uid 500); 20 May 2011 17:17:53 -0000 Delivered-To: apmail-hadoop-common-user-archive@hadoop.apache.org Received: (qmail 37538 invoked by uid 500); 20 May 2011 17:17:53 -0000 Mailing-List: contact common-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-user@hadoop.apache.org Delivered-To: mailing list common-user@hadoop.apache.org Received: (qmail 37530 invoked by uid 99); 20 May 2011 17:17:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2011 17:17:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of markkerzner@gmail.com designates 209.85.214.48 as permitted sender) Received: from [209.85.214.48] (HELO mail-bw0-f48.google.com) (209.85.214.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 May 2011 17:17:46 +0000 Received: by bwz8 with SMTP id 8so1113267bwz.35 for ; Fri, 20 May 2011 10:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=7oCtrNGuch0ytUTKH1wazDX856XYQk0nbvwEYsYXQos=; b=BhLe9CpLHyNHPlEefDZzmDasa2a562QjTPUa092AvoryIDGA8sKwdRXDjJ28Yv1A3B mKwtd3uo0Z1Q4nXaGEOo13db46GeluSyZR8leLj6YkMAYXcMHC7SVDQmJ/CzCHsmEOto fCMmgz3d/XPwAx/pG0h8bV8/qJIjGEMQdjYZU= 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=I0rmUH2sTeFnIxHPQnLbJFISye72B+Nh8KHbrzm9/oWEU6v8shYQDissko0ESTqW8R B0pbbTJdEFMVxR16xZWke3daTxYQ+4mg2p+QObi6r9xYE3kiI8kY68dFzfPmC72/sn85 5UNQEnrQ6jg4STwEULxy3iKeroQbTlPLvVKt4= MIME-Version: 1.0 Received: by 10.204.19.5 with SMTP id y5mr4270201bka.194.1305911846114; Fri, 20 May 2011 10:17:26 -0700 (PDT) Received: by 10.204.52.206 with HTTP; Fri, 20 May 2011 10:17:26 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 May 2011 12:17:26 -0500 Message-ID: Subject: Re: Can I number output results with a Counter? From: Mark Kerzner To: common-user@hadoop.apache.org Content-Type: multipart/alternative; boundary=000325554fe2b2173c04a3b84be2 X-Virus-Checked: Checked by ClamAV on apache.org --000325554fe2b2173c04a3b84be2 Content-Type: text/plain; charset=ISO-8859-1 Joey, You understood me perfectly well. I see your first advice, but I am not allowed to have gaps. A central service is something I may consider if single reducer becomes a worse bottleneck than it. But what are counters for? They seem to be exactly that. Mark On Fri, May 20, 2011 at 12:01 PM, Joey Echeverria wrote: > To make sure I understand you correctly, you need a globally unique > one up counter for each output record? > > If you had an upper bound on the number of records a single reducer > could output and you can afford to have gaps, you could just use the > task id and multiply that by the max number of records and then one up > from there. > > If that doesn't work for you, then you'll need to use some kind of > central service for allocating numbers which could become a > bottleneck. > > -Joey > > On Fri, May 20, 2011 at 9:55 AM, Mark Kerzner > wrote: > > Hi, can I use a Counter to give each record in all reducers a consecutive > > number? Currently I am using a single Reducer, but it is an anti-pattern. > > But I need to assign consecutive numbers to all output records in all > > reducers, and it does not matter how, as long as each gets its own > number. > > > > If it IS possible, then how are multiple processes accessing those > counters > > without creating race conditions. > > > > Thank you, > > > > Mark > > > > > > -- > Joseph Echeverria > Cloudera, Inc. > 443.305.9434 > --000325554fe2b2173c04a3b84be2--