Interface CounterGroupBase<T extends Counter>
- Type Parameters:
T- type of the counter for the group
- All Known Subinterfaces:
CounterGroup
- All Known Implementing Classes:
Counters.Group
@Public
@Evolving
public interface CounterGroupBase<T extends Counter>
extends Writable, Iterable<T>
The common counter group interface.
-
Method Summary
Modifier and TypeMethodDescriptionaddCounter(String name, String displayName, long value) Add a counter to this groupvoidaddCounter(T counter) Add a counter to this group.findCounter(String counterName) Find a counter in the group.findCounter(String counterName, boolean create) Find a counter in the groupfindCounter(String counterName, String displayName) Find a counter in the group.Get the display name of the group.getName()Get the internal name of the groupgetUnderlyingGroup()voidincrAllCounters(CounterGroupBase<T> rightGroup) Increment all counters by a group of countersvoidsetDisplayName(String displayName) Set the display name of the groupintsize()Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.apache.hadoop.io.Writable
readFields, write
-
Method Details
-
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
Set the display name of the group- Parameters:
displayName- of the group
-
addCounter
Add a counter to this group.- Parameters:
counter- to add
-
addCounter
Add a counter to this group- Parameters:
name- of the counterdisplayName- of the countervalue- of the counter- Returns:
- the counter
-
findCounter
Find a counter in the group.- Parameters:
counterName- the name of the counterdisplayName- the display name of the counter- Returns:
- the counter that was found or added
-
findCounter
Find a counter in the group- Parameters:
counterName- the name of the countercreate- create the counter if not found if true- Returns:
- the counter that was found or added or null if create is false
-
findCounter
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
Increment all counters by a group of counters- Parameters:
rightGroup- the group to be added to this group
-
getUnderlyingGroup
-