public class Counters extends Object implements Writable, Iterable<CounterGroup>
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
public Counters()
public Counters(Counters counters)
public Counter findCounter(Enum<?> key)
key - the counter keypublic Collection<String> getGroupNames()
public Iterator<CounterGroup> iterator()
iterator 在接口中 Iterable<CounterGroup>public CounterGroup getGroup(String groupName)
public int countCounters()
public void write(DataOutput out) throws IOException
write 在接口中 Writableout - DataOuput to serialize this object into.IOExceptionpublic void readFields(DataInput in) throws IOException
readFields 在接口中 Writablein - DataInput to deseriablize this object from.IOExceptionpublic String toString()
public void incrAllCounters(Counters other)
other - the other Counters instanceCopyright © 2009 The Apache Software Foundation