org.apache.hadoop.mapreduce

## Class Counters

- java.lang.Object
- - org.apache.hadoop.mapreduce.counters.AbstractCounters<Counter,CounterGroup>
  - - org.apache.hadoop.mapreduce.Counters

- All Implemented Interfaces:
    Iterable<CounterGroup>, org.apache.hadoop.io.Writable

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class Counters
      extends AbstractCounters<Counter,CounterGroup>

  `Counters` holds per job/task counters, defined either by the Map-Reduce framework or applications. Each `Counter` can be of any `Enum` type.

  `Counters` are bunched into `CounterGroup`s, each comprising of counters from a particular `Enum` class.

- - ### Field Summary

    - ### Fields inherited from class org.apache.hadoop.mapreduce.counters.AbstractCounters

      `LOG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Counters()` Default constructor
    `Counters(AbstractCounters<C,G> counters)` Construct the Counters object from the another counters object

  - ### Method Summary

    - ### Methods inherited from class org.apache.hadoop.mapreduce.counters.AbstractCounters

      `addGroup, addGroup, countCounters, equals, findCounter, findCounter, findCounter, getGroup, getGroupNames, getWriteAllCounters, hashCode, incrAllCounters, iterator, limits, readFields, setWriteAllCounters, toString, write`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Constructor Detail

    - #### Counters

          public Counters()

      Default constructor

    - #### Counters

          public Counters(AbstractCounters<C,G> counters)

      Construct the Counters object from the another counters object
      Type Parameters:
        `C` - the type of counter
        `G` - the type of counter group
      Parameters:
        `counters` - the old counters object

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.