T - type of the counter for the group@InterfaceAudience.Private public abstract class AbstractCounterGroup<T extends Counter> extends Object implements CounterGroupBase<T>
| Constructor and Description |
|---|
AbstractCounterGroup(String name,
String displayName,
Limits limits) |
| Modifier and Type | Method and Description |
|---|---|
T |
addCounter(String counterName,
String displayName,
long value)
Add a counter to this group
|
void |
addCounter(T counter)
Add a counter to this group.
|
boolean |
equals(Object genericRight) |
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
|
int |
hashCode() |
void |
incrAllCounters(CounterGroupBase<T> rightGroup)
Increment all counters by a group of counters
|
Iterator<T> |
iterator() |
protected abstract T |
newCounter()
Abstract factory method to create a new counter of type T
|
protected abstract T |
newCounter(String counterName,
String displayName,
long value)
Abstract factory method to create a new counter of type T
|
void |
readFields(DataInput in) |
void |
setDisplayName(String displayName)
Set the display name of the group
|
int |
size() |
void |
write(DataOutput out)
GenericGroup ::= displayName #counter counter*
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetUnderlyingGroupforEach, spliteratorpublic String getName()
CounterGroupBasegetName in interface CounterGroupBase<T extends Counter>public String getDisplayName()
CounterGroupBasegetDisplayName in interface CounterGroupBase<T extends Counter>public void setDisplayName(String displayName)
CounterGroupBasesetDisplayName in interface CounterGroupBase<T extends Counter>displayName - of the grouppublic void addCounter(T counter)
CounterGroupBaseaddCounter in interface CounterGroupBase<T extends Counter>counter - to addpublic T addCounter(String counterName, String displayName, long value)
CounterGroupBaseaddCounter in interface CounterGroupBase<T extends Counter>counterName - of the counterdisplayName - of the countervalue - of the counterpublic T findCounter(String counterName, String displayName)
CounterGroupBasefindCounter in interface CounterGroupBase<T extends Counter>counterName - the name of the counterdisplayName - the display name of the counterpublic T findCounter(String counterName, boolean create)
CounterGroupBasefindCounter in interface CounterGroupBase<T extends Counter>counterName - the name of the countercreate - create the counter if not found if truepublic T findCounter(String counterName)
CounterGroupBasefindCounter in interface CounterGroupBase<T extends Counter>counterName - the name of the counterprotected abstract T newCounter(String counterName, String displayName, long value)
counterName - of the counterdisplayName - of the countervalue - of the counterprotected abstract T newCounter()
public void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic int size()
size in interface CounterGroupBase<T extends Counter>public void incrAllCounters(CounterGroupBase<T> rightGroup)
CounterGroupBaseincrAllCounters in interface CounterGroupBase<T extends Counter>rightGroup - the group to be added to this groupCopyright © 2008–2022 Apache Software Foundation. All rights reserved.