org.apache.hadoop.mapred
Class Counters.Counter

java.lang.Object
  extended by org.apache.hadoop.mapred.Counters.Counter
All Implemented Interfaces:
Writable
Enclosing class:
Counters

public static class Counters.Counter
extends Object
implements Writable

A counter record, comprising its name and value.


Method Summary
 long getCounter()
          What is the current value of this counter?
 String getDisplayName()
          Get the name of the counter.
 String getName()
          Get the internal name of the counter.
 void increment(long incr)
          Increment this counter by the given value
 void readFields(DataInput in)
          Read the binary representation of the counter
 void write(DataOutput out)
          Write the binary representation of the counter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readFields

public void readFields(DataInput in)
                throws IOException
Read the binary representation of the counter

Specified by:
readFields in interface Writable
Parameters:
in - DataInput to deseriablize this object from.
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Write the binary representation of the counter

Specified by:
write in interface Writable
Parameters:
out - DataOuput to serialize this object into.
Throws:
IOException

getName

public String getName()
Get the internal name of the counter.

Returns:
the internal name of the counter

getDisplayName

public String getDisplayName()
Get the name of the counter.

Returns:
the user facing name of the counter

getCounter

public long getCounter()
What is the current value of this counter?

Returns:
the current value

increment

public void increment(long incr)
Increment this counter by the given value

Parameters:
incr - the value to increase this counter by


Copyright © 2008 The Apache Software Foundation