|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.Counters
public class Counters
A set of named counters.
Nested Class Summary | |
---|---|
static class |
Counters.Group
Represents a group of counters, comprising the counters from a particular counter enum class. |
Constructor Summary | |
---|---|
Counters()
|
Method Summary | |
---|---|
long |
getCounter(Enum key)
Returns current value of the specified counter, or 0 if the counter does not exist. |
Counters.Group |
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. |
void |
incrAllCounters(Counters other)
Increments multiple counters by their amounts in another Counters instance. |
void |
incrCounter(Enum key,
long amount)
Increments the specified counter by the specified amount, creating it if it didn't already exist. |
void |
log(org.apache.commons.logging.Log log)
Logs the current counter values. |
void |
readFields(DataInput in)
Reads the fields of this object from in . |
int |
size()
Returns the total number of counters, by summing the number of counters in each group. |
static Counters |
sum(Counters a,
Counters b)
Convenience method for computing the sum of two sets of counters. |
void |
write(DataOutput out)
Writes the fields of this object to out . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Counters()
Method Detail |
---|
public Collection<String> getGroupNames()
public Counters.Group getGroup(String groupName)
public void incrCounter(Enum key, long amount)
key
- identifies a counteramount
- amount by which counter is to be incrementedpublic long getCounter(Enum key)
public void incrAllCounters(Counters other)
other
- the other Counters instancepublic static Counters sum(Counters a, Counters b)
public int size()
public void write(DataOutput out) throws IOException
Writable
out
.
write
in interface Writable
IOException
public void readFields(DataInput in) throws IOException
Writable
in
. For efficiency,
implementations should attempt to re-use storage in the existing object
where possible.
readFields
in interface Writable
IOException
public void log(org.apache.commons.logging.Log log)
log
- The log to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |