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