org.apache.hadoop.mapreduce.counters

## Interface CounterGroupBase<T extends Counter>

- Type Parameters:
    `T` - type of the counter for the group
  All Superinterfaces:
    Iterable<T>, Writable
  All Known Subinterfaces:
    CounterGroup
  All Known Implementing Classes:
    Counters.Group

      @InterfaceAudience.Public
       @InterfaceStability.Evolving
      public interface CounterGroupBase<T extends Counter>
      extends Writable, Iterable<T>

  The common counter group interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `addCounter(String name, String displayName, long value)` Add a counter to this group
    `void` | `addCounter(T counter)` Add a counter to this group.
    `T` | `findCounter(String counterName)` Find a counter in the group.
    `T` | `findCounter(String counterName, boolean create)` Find a counter in the group
    `T` | `findCounter(String counterName, String displayName)` Find a counter in the group.
    `String` | `getDisplayName()` Get the display name of the group.
    `String` | `getName()` Get the internal name of the group
    `void` | `incrAllCounters(CounterGroupBase<T> rightGroup)` Increment all counters by a group of counters
    `void` | `setDisplayName(String displayName)` Set the display name of the group
    `int` | `size()`

    - ### Methods inherited from interface org.apache.hadoop.io.Writable

      `readFields, write`

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

      `forEach, iterator, spliterator`

- - ### Method Detail

    - #### getName

          String getName()

      Get the internal name of the group
      Returns:
        the internal name

    - #### getDisplayName

          String getDisplayName()

      Get the display name of the group.
      Returns:
        the human readable name

    - #### setDisplayName

          void setDisplayName(String displayName)

      Set the display name of the group
      Parameters:
        `displayName` - of the group

    - #### addCounter

          void addCounter(T counter)

      Add a counter to this group.
      Parameters:
        `counter` - to add

    - #### addCounter

          T addCounter(String name,
                       String displayName,
                       long value)

      Add a counter to this group
      Parameters:
        `name` - of the counter
        `displayName` - of the counter
        `value` - of the counter
      Returns:
        the counter

    - #### findCounter

          T findCounter(String counterName,
                        String displayName)

      Find a counter in the group.
      Parameters:
        `counterName` - the name of the counter
        `displayName` - the display name of the counter
      Returns:
        the counter that was found or added

    - #### findCounter

          T findCounter(String counterName,
                        boolean create)

      Find a counter in the group
      Parameters:
        `counterName` - the name of the counter
        `create` - create the counter if not found if true
      Returns:
        the counter that was found or added or null if create is false

    - #### findCounter

          T findCounter(String counterName)

      Find a counter in the group.
      Parameters:
        `counterName` - the name of the counter
      Returns:
        the counter that was found or added

    - #### size

          int size()

      Returns:
        the number of counters in this group.

    - #### incrAllCounters

          void incrAllCounters(CounterGroupBase<T> rightGroup)

      Increment all counters by a group of counters
      Parameters:
        `rightGroup` - the group to be added to this group

Copyright © 2022 Apache Software Foundation. All rights reserved.