Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6BF39200BFA for ; Thu, 29 Dec 2016 02:35:16 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6AAD8160B43; Thu, 29 Dec 2016 01:35:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 91B08160B34 for ; Thu, 29 Dec 2016 02:35:15 +0100 (CET) Received: (qmail 20455 invoked by uid 500); 29 Dec 2016 01:35:14 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 20266 invoked by uid 99); 29 Dec 2016 01:35:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Dec 2016 01:35:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 55388DFD86; Thu, 29 Dec 2016 01:35:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: junping_du@apache.org To: common-commits@hadoop.apache.org Date: Thu, 29 Dec 2016 01:35:15 -0000 Message-Id: <362a8be4d1e1485892bd9d95ea4a88df@git.apache.org> In-Reply-To: <3ddb1031f35247749fa6406077017f74@git.apache.org> References: <3ddb1031f35247749fa6406077017f74@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] hadoop git commit: Revert "MAPREDUCE-6199. AbstractCounters are not reset completely on deserialization (adhoot via rkanter)" archived-at: Thu, 29 Dec 2016 01:35:16 -0000 Revert "MAPREDUCE-6199. AbstractCounters are not reset completely on deserialization (adhoot via rkanter)" This reverts commit f9341c1e2cffc4e3ac37cb7da4e535ca5c6d3913. Conflicts: hadoop-mapreduce-project/CHANGES.txt Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8755a6f5 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8755a6f5 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8755a6f5 Branch: refs/heads/branch-2.8 Commit: 8755a6f5ac6785d6ed521555a2187389360bac42 Parents: e8d7801 Author: Junping Du Authored: Wed Dec 28 17:13:04 2016 -0800 Committer: Junping Du Committed: Wed Dec 28 17:13:04 2016 -0800 ---------------------------------------------------------------------- .../mapreduce/counters/AbstractCounters.java | 4 -- .../hadoop/mapreduce/counters/Limits.java | 7 ---- .../apache/hadoop/mapreduce/TestCounters.java | 39 +------------------- 3 files changed, 1 insertion(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8755a6f5/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/AbstractCounters.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/AbstractCounters.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/AbstractCounters.java index e6e74da..4ab7e89 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/AbstractCounters.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/AbstractCounters.java @@ -307,10 +307,6 @@ public abstract class AbstractCounters 0) { limits.checkGroups(groups.size() + 1); G group = groupFactory.newGenericGroup( http://git-wip-us.apache.org/repos/asf/hadoop/blob/8755a6f5/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/Limits.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/Limits.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/Limits.java index 9546c8d..3821694 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/Limits.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/counters/Limits.java @@ -124,15 +124,8 @@ public class Limits { return firstViolation; } - // This allows initialization of global settings and not for an instance public static synchronized void reset(Configuration conf) { isInited = false; init(conf); } - - // This allows resetting of an instance to allow reuse - public synchronized void reset() { - totalCounters = 0; - firstViolation = null; - } } http://git-wip-us.apache.org/repos/asf/hadoop/blob/8755a6f5/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java index 0215568..83d689c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/TestCounters.java @@ -17,12 +17,8 @@ */ package org.apache.hadoop.mapreduce; -import java.io.IOException; import java.util.Random; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.io.DataInputBuffer; -import org.apache.hadoop.io.DataOutputBuffer; import org.junit.Test; import static org.junit.Assert.*; @@ -74,40 +70,7 @@ public class TestCounters { testMaxGroups(new Counters()); } } - - @Test public void testResetOnDeserialize() throws IOException { - // Allow only one counterGroup - Configuration conf = new Configuration(); - conf.setInt(MRJobConfig.COUNTER_GROUPS_MAX_KEY, 1); - Limits.init(conf); - - Counters countersWithOneGroup = new Counters(); - countersWithOneGroup.findCounter("firstOf1Allowed", "First group"); - boolean caughtExpectedException = false; - try { - countersWithOneGroup.findCounter("secondIsTooMany", "Second group"); - } - catch (LimitExceededException _) { - caughtExpectedException = true; - } - - assertTrue("Did not throw expected exception", - caughtExpectedException); - - Counters countersWithZeroGroups = new Counters(); - DataOutputBuffer out = new DataOutputBuffer(); - countersWithZeroGroups.write(out); - - DataInputBuffer in = new DataInputBuffer(); - in.reset(out.getData(), out.getLength()); - - countersWithOneGroup.readFields(in); - - // After reset one should be able to add a group - countersWithOneGroup.findCounter("firstGroupAfterReset", "After reset " + - "limit should be set back to zero"); - } - + @Test public void testCountersIncrement() { Counters fCounters = new Counters(); --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org