public static class Counters.Group extends java.lang.Object implements CounterGroupBase<Counters.Counter>
Group
of counters, comprising of counters from a particular
counter Enum
class.
Group
handles localization of the class name and the
counter names.
Modifier and Type | Method and Description |
---|---|
void |
addCounter(Counters.Counter counter)
Add a counter to this group.
|
Counters.Counter |
addCounter(java.lang.String name,
java.lang.String displayName,
long value)
Add a counter to this group
|
boolean |
equals(java.lang.Object genericRight) |
Counters.Counter |
findCounter(java.lang.String counterName)
Find a counter in the group.
|
Counters.Counter |
findCounter(java.lang.String counterName,
boolean create)
Find a counter in the group
|
Counters.Counter |
findCounter(java.lang.String counterName,
java.lang.String displayName)
Find a counter in the group.
|
Counters.Counter |
getCounter(int id,
java.lang.String name)
Deprecated.
use
findCounter(String) instead |
long |
getCounter(java.lang.String counterName) |
Counters.Counter |
getCounterForName(java.lang.String name)
Get the counter for the given name and create it if it doesn't exist.
|
java.lang.String |
getDisplayName()
Get the display name of the group.
|
java.lang.String |
getName()
Get the internal name of the group
|
CounterGroupBase<Counters.Counter> |
getUnderlyingGroup()
Exposes the underlying group type if a facade.
|
int |
hashCode() |
void |
incrAllCounters(CounterGroupBase<Counters.Counter> rightGroup)
Increment all counters by a group of counters
|
java.util.Iterator<Counters.Counter> |
iterator() |
java.lang.String |
makeEscapedCompactString() |
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) |
public long getCounter(java.lang.String counterName)
counterName
- the name of the counterpublic java.lang.String makeEscapedCompactString()
@Deprecated public Counters.Counter getCounter(int id, java.lang.String name)
findCounter(String)
insteadid
- the numeric id of the counter within the groupname
- the internal counter namepublic Counters.Counter getCounterForName(java.lang.String name)
name
- the internal counter namepublic 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 java.util.Iterator<Counters.Counter> iterator()
iterator
in interface java.lang.Iterable<Counters.Counter>
public java.lang.String getName()
CounterGroupBase
getName
in interface CounterGroupBase<Counters.Counter>
public java.lang.String getDisplayName()
CounterGroupBase
getDisplayName
in interface CounterGroupBase<Counters.Counter>
public void setDisplayName(java.lang.String displayName)
CounterGroupBase
setDisplayName
in interface CounterGroupBase<Counters.Counter>
displayName
- of the grouppublic void addCounter(Counters.Counter counter)
CounterGroupBase
addCounter
in interface CounterGroupBase<Counters.Counter>
counter
- to addpublic Counters.Counter addCounter(java.lang.String name, java.lang.String displayName, long value)
CounterGroupBase
addCounter
in interface CounterGroupBase<Counters.Counter>
name
- of the counterdisplayName
- of the countervalue
- of the counterpublic Counters.Counter findCounter(java.lang.String counterName, java.lang.String displayName)
CounterGroupBase
findCounter
in interface CounterGroupBase<Counters.Counter>
counterName
- the name of the counterdisplayName
- the display name of the counterpublic Counters.Counter findCounter(java.lang.String counterName, boolean create)
CounterGroupBase
findCounter
in interface CounterGroupBase<Counters.Counter>
counterName
- the name of the countercreate
- create the counter if not found if truepublic Counters.Counter findCounter(java.lang.String counterName)
CounterGroupBase
findCounter
in interface CounterGroupBase<Counters.Counter>
counterName
- the name of the counterpublic int size()
size
in interface CounterGroupBase<Counters.Counter>
public void incrAllCounters(CounterGroupBase<Counters.Counter> rightGroup)
CounterGroupBase
incrAllCounters
in interface CounterGroupBase<Counters.Counter>
rightGroup
- the group to be added to this grouppublic CounterGroupBase<Counters.Counter> getUnderlyingGroup()
CounterGroupBase
getUnderlyingGroup
in interface CounterGroupBase<Counters.Counter>
public boolean equals(java.lang.Object genericRight)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2009 The Apache Software Foundation