Package org.apache.hadoop.mapred
Class Counters.Counter
java.lang.Object
org.apache.hadoop.mapred.Counters.Counter
- Enclosing class:
- Counters
A counter record, comprising its name and value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontentEquals(Counters.Counter counter) Deprecated.booleanlongGet the display name of the counter.getName()longgetValue()What is the current value of this counter?inthashCode()voidincrement(long incr) Increment this counter by the given valueReturns the compact stringified version of the counter in the format [(actual-name)(display-name)(value)]voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidsetDisplayName(String displayName) Set the display name of the countervoidsetValue(long value) Set this counter by the given valuevoidwrite(DataOutput out) Serialize the fields of this object toout.
-
Constructor Details
-
Counter
public Counter()
-
-
Method Details
-
setDisplayName
Description copied from interface:CounterSet the display name of the counter- Specified by:
setDisplayNamein interfaceCounter- Parameters:
displayName- of the counter
-
getName
-
getDisplayName
Description copied from interface:CounterGet the display name of the counter.- Specified by:
getDisplayNamein interfaceCounter- Returns:
- the user facing name of the counter
-
getValue
public long getValue()Description copied from interface:CounterWhat is the current value of this counter? -
setValue
public void setValue(long value) Description copied from interface:CounterSet this counter by the given value -
increment
public void increment(long incr) Description copied from interface:CounterIncrement this counter by the given value -
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
makeEscapedCompactString
Returns the compact stringified version of the counter in the format [(actual-name)(display-name)(value)]- Returns:
- the stringified result
-
contentEquals
Deprecated.Checks for (content) equality of two (basic) counters- Parameters:
counter- to compare- Returns:
- true if content equals
-
getCounter
public long getCounter()- Returns:
- the value of the counter
-
getUnderlyingCounter
- Specified by:
getUnderlyingCounterin interfaceCounter
-
equals
-
hashCode
public int hashCode()
-