## org.apache.hadoop.mapreduce
Class CounterGroup

    java.lang.Object
      org.apache.hadoop.mapreduce.CounterGroup

All Implemented Interfaces:
  Iterable<Counter>, Writable

    public class CounterGroup

extends Object
implements Writable, Iterable<Counter>

A group of `Counter`s that logically belong together. Typically, it is an `Enum` subclass and the counters are the values.

Constructor Summary
`protected` `CounterGroup(String name)`
`protected` `CounterGroup(String name, String displayName)`

Method Summary
`boolean` `equals(Object genericRight)`
`Counter` `findCounter(String counterName)`
`protected Counter` `findCounter(String counterName, String displayName)` Internal to find a counter in a group.
`String` `getDisplayName()` Get the display name of the group.
`String` `getName()` Get the internal name of the group
`int` `hashCode()`
`void` `incrAllCounters(CounterGroup rightGroup)`
`Iterator<Counter>` `iterator()`
`void` `readFields(DataInput in)` Deserialize the fields of this object from `in`.
`int` `size()` Returns the number of counters in this group.
`void` `write(DataOutput out)` Serialize the fields of this object to `out`.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CounterGroup

    protected CounterGroup(String name)

### CounterGroup

    protected CounterGroup(String name,
                           String displayName)

Method Detail

### getName

    public String getName()

  Get the internal name of the group

  Returns:
    the internal name

### getDisplayName

    public String getDisplayName()

  Get the display name of the group.

  Returns:
    the human readable name

### findCounter

    protected Counter findCounter(String counterName,
                                  String displayName)

  Internal to find a counter in a group.

  Parameters:
    `counterName` - the name of the counter
    `displayName` - the display name of the counter
  Returns:
    the counter that was found or added

### findCounter

    public Counter findCounter(String counterName)

### iterator

    public Iterator<Counter> iterator()

  Specified by:
    `iterator` in interface `Iterable<Counter>`

### write

    public void write(DataOutput out)
               throws IOException

  Description copied from interface: `Writable`
  Serialize the fields of this object to `out`.

  Specified by:
    `write` in interface `Writable`
  Parameters:
    `out` - `DataOuput` to serialize this object into.
  Throws:
    `IOException`

### readFields

    public void readFields(DataInput in)
                    throws IOException

  Description copied from interface: `Writable`
  Deserialize the fields of this object from `in`.

  For efficiency, implementations should attempt to re-use storage in the existing object where possible.

  Specified by:
    `readFields` in interface `Writable`
  Parameters:
    `in` - `DataInput` to deseriablize this object from.
  Throws:
    `IOException`

### size

    public int size()

  Returns the number of counters in this group.

### equals

    public boolean equals(Object genericRight)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### incrAllCounters

    public void incrAllCounters(CounterGroup rightGroup)

Copyright © 2009 The Apache Software Foundation