hadoop Counter 源码

  • 2022-10-20
  • 浏览 (175)

haddop Counter 代码

文件路径:/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/Counter.java

/**
 * 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.mapreduce;

import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.io.Writable;

/**
 * A named counter that tracks the progress of a map/reduce job.
 *
 * <p><code>Counters</code> represent global counters, defined either by the
 * Map-Reduce framework or applications. Each <code>Counter</code> is named by
 * an {@link Enum} and has a long for the value.</p>
 *
 * <p><code>Counters</code> are bunched into Groups, each comprising of
 * counters from a particular <code>Enum</code> class.
 */
@InterfaceAudience.Public
@InterfaceStability.Stable
public interface Counter extends Writable {

  /**
   * Set the display name of the counter
   * @param displayName of the counter
   * @deprecated (and no-op by default)
   */
  @Deprecated
  void setDisplayName(String displayName);

  /**
   * @return the name of the counter
   */
  String getName();

  /**
   * Get the display name of the counter.
   * @return the user facing name of the counter
   */
  String getDisplayName();

  /**
   * What is the current value of this counter?
   * @return the current value
   */
  long getValue();

  /**
   * Set this counter by the given value
   * @param value the value to set
   */
  void setValue(long value);

  /**
   * Increment this counter by the given value
   * @param incr the value to increase this counter by
   */
  void increment(long incr);
 
  @Private
  /**
   * Return the underlying object if this is a facade.
   * @return the undelying object.
   */
  Counter getUnderlyingCounter();
}

相关信息

hadoop 源码目录

相关文章

hadoop Cluster 源码

hadoop ClusterMetrics 源码

hadoop ContextFactory 源码

hadoop CounterGroup 源码

hadoop Counters 源码

hadoop CryptoUtils 源码

hadoop CustomJobEndNotifier 源码

hadoop FileSystemCounter 源码

hadoop ID 源码

hadoop InputFormat 源码

0  赞