Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DB6C1106DE for ; Tue, 17 Sep 2013 10:10:26 +0000 (UTC) Received: (qmail 47081 invoked by uid 500); 17 Sep 2013 10:10:12 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 46931 invoked by uid 500); 17 Sep 2013 10:10:07 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 46905 invoked by uid 99); 17 Sep 2013 10:10:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 10:10:03 +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 yaron.gonen@gmail.com designates 209.85.160.52 as permitted sender) Received: from [209.85.160.52] (HELO mail-pb0-f52.google.com) (209.85.160.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 10:09:57 +0000 Received: by mail-pb0-f52.google.com with SMTP id wz12so5282600pbc.25 for ; Tue, 17 Sep 2013 03:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=hbHXGXI7ZCBqF3ieoNdv67HMGQ36/SC98nqIdAO4pFw=; b=YkKhBQBo4TPeLSSVHxPcZHbedwatME7C3k89lqxYhPefeW51AE+PhI1vt2wBrg5uzu qnKPQj/Z1zsWKJobC1B7MPS3AgJfza5P+MDLrVtS/kGSLIyrH1jDxue67iXlgdiYdoSl ZnqShTTpmgG8dIE4hSIGFz7jYLb5qXPObIZYgheHY/wBtwKk8X7lebRd2756l6And+qK mHvHw5+LkxOQAG4dsLJR9HAayglAVsCKwIlzhT7JZIKQwIP9ynXTJO2jrJe86Pug1JcG rkHG0A0QbCHlXbQiE7GqmSH729FOTwT0qBuoN6n6YlATt0+QkBbruabIYHUIlvUhK1xU d0Lw== MIME-Version: 1.0 X-Received: by 10.68.162.1 with SMTP id xw1mr2450667pbb.178.1379412577673; Tue, 17 Sep 2013 03:09:37 -0700 (PDT) Received: by 10.68.20.195 with HTTP; Tue, 17 Sep 2013 03:09:37 -0700 (PDT) Date: Tue, 17 Sep 2013 13:09:37 +0300 Message-ID: Subject: MAP_INPUT_RECORDS counter in the reducer From: Yaron Gonen To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=047d7bacbb46b0ea0b04e69184b2 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bacbb46b0ea0b04e69184b2 Content-Type: text/plain; charset=ISO-8859-1 Hi, Is there a way for the reducer to get the total number of input records to the map phase? For example, I want the reducer to normalize a sum by dividing it in the number of records. I tried getting the value of that counter by using the line: context.getCounter(Task.Counter.MAP_INPUT_RECORDS).getValue(); in the reducer code, but I got 0. Thanks! Yaron --047d7bacbb46b0ea0b04e69184b2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
Is there a way for the reducer to get the total nu= mber of input records to the map phase?
For example, I want the r= educer to normalize a sum by dividing it in the number of records. I tried = getting the value of that counter by using the line:

context.getCounter(Task.Counter.MAP_INPUT_RECOR= DS).getValue();

in the reducer code, bu= t I got 0.

Thanks!
Yaron
--047d7bacbb46b0ea0b04e69184b2--