Return-Path: X-Original-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D07C4720 for ; Tue, 7 Jun 2011 01:39:22 +0000 (UTC) Received: (qmail 60141 invoked by uid 500); 7 Jun 2011 01:39:22 -0000 Delivered-To: apmail-hadoop-mapreduce-issues-archive@hadoop.apache.org Received: (qmail 60115 invoked by uid 500); 7 Jun 2011 01:39:22 -0000 Mailing-List: contact mapreduce-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-issues@hadoop.apache.org Delivered-To: mailing list mapreduce-issues@hadoop.apache.org Received: (qmail 60046 invoked by uid 99); 7 Jun 2011 01:39:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 01:39:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Jun 2011 01:39:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 20101104DC6 for ; Tue, 7 Jun 2011 01:38:59 +0000 (UTC) Date: Tue, 7 Jun 2011 01:38:59 +0000 (UTC) From: "William Slacum (JIRA)" To: mapreduce-issues@hadoop.apache.org Message-ID: <2143265784.2604.1307410739128.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1034929520.61687.1306981487446.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MAPREDUCE-2557) Counters don't reset state when readFields() called MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MAPREDUCE-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045236#comment-13045236 ] William Slacum commented on MAPREDUCE-2557: ------------------------------------------- Hey Todd, 1) No problem on that 2) I think in terms of running a MR job, there's no real effect unless the framework is re-using the same Counters reference for different jobs, which could happen if JVM re-use is enabled. I encountered this while writing an MR job that used Counters as an input value type. I had written my own InputFormat that re-used a Counters reference and found I was getting odd values when performing operations on Counter values. > Counters don't reset state when readFields() called > --------------------------------------------------- > > Key: MAPREDUCE-2557 > URL: https://issues.apache.org/jira/browse/MAPREDUCE-2557 > Project: Hadoop Map/Reduce > Issue Type: Bug > Reporter: William Slacum > Priority: Trivial > Attachments: MAPREDUCE-2557.patch > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > When calling readFields() on a Counters object, the internal state is not completely reset. The IdentityHashMap, Counter> cache retains all previous mappings, even after the actual CounterGroups are changed. Using the same Counters pointer over and over again results in the cache always keeping the mapping for the first call to getCounter(Enum). I've add a clear() call to the cache when readFields() is called and added a unit test to verify that it works. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira