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, wait
getUnderlyingGroup
public String getName()
CounterGroupBase
getName
in interface CounterGroupBase<T extends Counter>
public String getDisplayName()
CounterGroupBase
getDisplayName
in interface CounterGroupBase<T extends Counter>
public void setDisplayName(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(String counterName, String displayName, long value)
CounterGroupBase
addCounter
in interface CounterGroupBase<T extends Counter>
counterName
- of the counterdisplayName
- of the countervalue
- of the counterpublic T findCounter(String counterName, String displayName)
CounterGroupBase
findCounter
in interface CounterGroupBase<T extends Counter>
counterName
- the name of the counterdisplayName
- the display name of the counterpublic T findCounter(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(String counterName)
CounterGroupBase
findCounter
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.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public int size()
size
in interface CounterGroupBase<T extends Counter>
public void incrAllCounters(CounterGroupBase<T> rightGroup)
CounterGroupBase
incrAllCounters
in interface CounterGroupBase<T extends Counter>
rightGroup
- the group to be added to this groupCopyright © 2013 Apache Software Foundation. All Rights Reserved.