public class Counters extends Object implements Writable, Iterable<CounterGroup>
Constructor and Description |
---|
Counters() |
Modifier and Type | Method and Description |
---|---|
int |
countCounters()
Returns the total number of counters, by summing the number of counters
in each group.
|
boolean |
equals(Object genericRight) |
Counter |
findCounter(Enum<?> key)
Find the counter for the given enum.
|
Counter |
findCounter(String groupName,
String counterName) |
CounterGroup |
getGroup(String groupName)
Returns the named counter group, or an empty group if there is none
with the specified name.
|
Collection<String> |
getGroupNames()
Returns the names of all counter classes.
|
int |
hashCode() |
void |
incrAllCounters(Counters other)
Increments multiple counters by their amounts in another Counters
instance.
|
Iterator<CounterGroup> |
iterator() |
void |
readFields(DataInput in)
Read a set of groups.
|
String |
toString()
Return textual representation of the counter values.
|
void |
write(DataOutput out)
Write the set of groups.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Counter findCounter(Enum<?> key)
key
- the counter keypublic Collection<String> getGroupNames()
public Iterator<CounterGroup> iterator()
iterator
in interface Iterable<CounterGroup>
public CounterGroup getGroup(String groupName)
public int countCounters()
public void write(DataOutput out) throws IOException
write
in interface Writable
out
- DataOuput
to serialize this object into.IOException
public void readFields(DataInput in) throws IOException
readFields
in interface Writable
in
- DataInput
to deseriablize this object from.IOException
public String toString()
public void incrAllCounters(Counters other)
other
- the other Counters instanceCopyright © 2010 The Apache Software Foundation