Author: shv Date: Thu Sep 1 01:51:10 2011 New Revision: 1163891 URL: http://svn.apache.org/viewvc?rev=1163891&view=rev Log: HADOOP-7577. Add EventCounter wrapper to provide compatibility between metrics 1 and 2. Contributed by Joep Rottinghuis.
Added: hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/log/EventCounter.java (with props) Modified: hadoop/common/branches/branch-0.22/common/CHANGES.txt Modified: hadoop/common/branches/branch-0.22/common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/common/CHANGES.txt?rev=1163891&r1=1163890&r2=1163891&view=diff ============================================================================== --- hadoop/common/branches/branch-0.22/common/CHANGES.txt (original) +++ hadoop/common/branches/branch-0.22/common/CHANGES.txt Thu Sep 1 01:51:10 2011 @@ -533,6 +533,9 @@ Release 0.22.0 - Unreleased HADOOP-7390. VersionInfo not generated properly in git after unsplit. (todd via shv) + HADOOP-7577. Add EventCounter wrapper to provide compatibility between + metrics 1 and 2. (Joep Rottinghuis via shv) + Release 0.21.1 - Unreleased IMPROVEMENTS Added: hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/log/EventCounter.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/log/EventCounter.java?rev=1163891&view=auto ============================================================================== --- hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/log/EventCounter.java (added) +++ hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/log/EventCounter.java Thu Sep 1 01:51:10 2011 @@ -0,0 +1,35 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.log; + +/** + * A log4J Appender that simply counts logging events in three levels: + * fatal, error and warn. The class name is used in log4j.properties + * Note that with metrics2 this class will be moved to org.apache.hadoop.log.metrics.EventCounter + * @deprecated use {@link org.apache.hadoop.metrics.jvm.EventCounter} instead + */ +@Deprecated +public class EventCounter extends org.apache.hadoop.metrics.jvm.EventCounter { + static { + // The logging system is not started yet. + System.err.println("WARNING: "+ EventCounter.class.getName() + + " is deprecated. Please use "+ + org.apache.hadoop.metrics.jvm.EventCounter.class.getName() + + " in all the log4j.properties files."); + } +} Propchange: hadoop/common/branches/branch-0.22/common/src/java/org/apache/hadoop/log/EventCounter.java ------------------------------------------------------------------------------ svn:mime-type = text/plain