T - type of the counter enum classC - type of the counter@InterfaceAudience.Private public abstract class FrameworkCounterGroup<T extends java.lang.Enum<T>,C extends Counter> extends java.lang.Object implements CounterGroupBase<C>
| Modifier and Type | Class and Description |
|---|---|
class |
FrameworkCounterGroup.FrameworkCounter
A counter facade for framework counters.
|
| Constructor and Description |
|---|
FrameworkCounterGroup(java.lang.Class<T> enumClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCounter(C counter)
Add a counter to this group.
|
C |
addCounter(java.lang.String name,
java.lang.String displayName,
long value)
Add a counter to this group
|
boolean |
equals(java.lang.Object genericRight) |
C |
findCounter(java.lang.String counterName)
Find a counter in the group.
|
C |
findCounter(java.lang.String counterName,
boolean create)
Find a counter in the group
|
C |
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<C> other)
Increment all counters by a group of counters
|
java.util.Iterator<C> |
iterator() |
protected abstract C |
newCounter(T key)
Abstract factory method for new framework counter
|
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)
FrameworkGroup ::= #counter (key value)*
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetUnderlyingGrouppublic FrameworkCounterGroup(java.lang.Class<T> enumClass)
public java.lang.String getName()
CounterGroupBasegetName in interface CounterGroupBase<C extends Counter>public java.lang.String getDisplayName()
CounterGroupBasegetDisplayName in interface CounterGroupBase<C extends Counter>public void setDisplayName(java.lang.String displayName)
CounterGroupBasesetDisplayName in interface CounterGroupBase<C extends Counter>displayName - of the grouppublic void addCounter(C counter)
CounterGroupBaseaddCounter in interface CounterGroupBase<C extends Counter>counter - to addpublic C addCounter(java.lang.String name, java.lang.String displayName, long value)
CounterGroupBaseaddCounter in interface CounterGroupBase<C extends Counter>name - of the counterdisplayName - of the countervalue - of the counterpublic C findCounter(java.lang.String counterName, java.lang.String displayName)
CounterGroupBasefindCounter in interface CounterGroupBase<C extends Counter>counterName - the name of the counterdisplayName - the display name of the counterpublic C findCounter(java.lang.String counterName, boolean create)
CounterGroupBasefindCounter in interface CounterGroupBase<C extends Counter>counterName - the name of the countercreate - create the counter if not found if truepublic C findCounter(java.lang.String counterName)
CounterGroupBasefindCounter in interface CounterGroupBase<C extends Counter>counterName - the name of the counterprotected abstract C newCounter(T key)
key - for the enum value of a counterpublic int size()
size in interface CounterGroupBase<C extends Counter>public void incrAllCounters(CounterGroupBase<C> other)
CounterGroupBaseincrAllCounters in interface CounterGroupBase<C extends Counter>other - the group to be added to this grouppublic void write(java.io.DataOutput out)
throws java.io.IOException
write in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic java.util.Iterator<C> iterator()
public boolean equals(java.lang.Object genericRight)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2009 The Apache Software Foundation