org.apache.hadoop.mapreduce
Interface Counter

All Superinterfaces:
org.apache.hadoop.io.Writable
All Known Implementing Classes:
AbstractCounter, Counters.Counter, FileSystemCounterGroup.FSCounter, FrameworkCounterGroup.FrameworkCounter, GenericCounter

@InterfaceAudience.Public
@InterfaceStability.Stable
public interface Counter
extends org.apache.hadoop.io.Writable

A named counter that tracks the progress of a map/reduce job.

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.


Method Summary
 java.lang.String getDisplayName()
          Get the display name of the counter.
 java.lang.String getName()
           
 Counter getUnderlyingCounter()
          Return the underlying object if this is a facade.
 long getValue()
          What is the current value of this counter?
 void increment(long incr)
          Increment this counter by the given value
 void setDisplayName(java.lang.String displayName)
          Deprecated. (and no-op by default)
 void setValue(long value)
          Set this counter by the given value
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Method Detail

setDisplayName

@Deprecated
void setDisplayName(java.lang.String displayName)
Deprecated. (and no-op by default)

Set the display name of the counter

Parameters:
displayName - of the counter

getName

java.lang.String getName()
Returns:
the name of the counter

getDisplayName

java.lang.String getDisplayName()
Get the display name of the counter.

Returns:
the user facing name of the counter

getValue

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

Returns:
the current value

setValue

void setValue(long value)
Set this counter by the given value

Parameters:
value - the value to set

increment

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

Parameters:
incr - the value to increase this counter by

getUnderlyingCounter

Counter getUnderlyingCounter()
Return the underlying object if this is a facade.

Returns:
the undelying object.


Copyright © 2009 The Apache Software Foundation