public class Counter extends Object implements Writable
Counters represent global counters, defined either by the
Map-Reduce framework or applications. Each Counter is named by
an Enum and has a long for the value.
Counters are bunched into Groups, each comprising of
counters from a particular Enum class.
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object genericRight) |
String |
getDisplayName()
Get the name of the counter.
|
String |
getName() |
long |
getValue()
What is the current value of this counter?
|
int |
hashCode() |
void |
increment(long incr)
Increment this counter by the given value
|
void |
readFields(DataInput in)
Read the binary representation of the counter
|
protected void |
setDisplayName(String displayName)
已过时。
|
void |
setValue(long value)
Set this counter by the given value
|
void |
write(DataOutput out)
Write the binary representation of the counter
|
@Deprecated protected void setDisplayName(String displayName)
public void readFields(DataInput in) throws IOException
readFields 在接口中 Writablein - DataInput to deseriablize this object from.IOExceptionpublic void write(DataOutput out) throws IOException
write 在接口中 Writableout - DataOuput to serialize this object into.IOExceptionpublic String getName()
public String getDisplayName()
public long getValue()
public void setValue(long value)
value - the value to setpublic void increment(long incr)
incr - the value to increase this counter byCopyright © 2009 The Apache Software Foundation