p2pMapReduce.mapreduceModule
Class Counter

java.lang.Object
  extended by p2pMapReduce.mapreduceModule.Counter
All Implemented Interfaces:
java.io.Serializable

public class Counter
extends java.lang.Object
implements java.io.Serializable

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.

See Also:
Serialized Form

Constructor Summary
protected Counter()
           
protected Counter(java.lang.String name, java.lang.String displayName)
           
  Counter(java.lang.String name, java.lang.String displayName, long value)
          Create a counter.
 
Method Summary
 boolean equals(java.lang.Object genericRight)
           
 java.lang.String getDisplayName()
          Get the name of the counter.
 java.lang.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
protected  void setDisplayName(java.lang.String displayName)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Counter

protected Counter()

Counter

protected Counter(java.lang.String name,
                  java.lang.String displayName)

Counter

public Counter(java.lang.String name,
               java.lang.String displayName,
               long value)
Create a counter.

Parameters:
name - the name within the group's enum.
displayName - a name to be displayed.
value - the counter value.
Method Detail

setDisplayName

@Deprecated
protected void setDisplayName(java.lang.String displayName)
Deprecated. 


getName

public java.lang.String getName()

getDisplayName

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

Returns:
the user facing name of the counter

getValue

public long getValue()
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

equals

public boolean equals(java.lang.Object genericRight)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object