|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapreduce.counters.AbstractCounterGroup<T>
T
- type of the counter for the group@InterfaceAudience.Private public abstract class AbstractCounterGroup<T extends Counter>
An abstract class to provide common implementation of the generic counter group in both mapred and mapreduce package.
Constructor Summary | |
---|---|
AbstractCounterGroup(String name,
String displayName,
Limits limits)
|
Method Summary | |
---|---|
T |
addCounter(String counterName,
String displayName,
long value)
Add a counter to this group |
void |
addCounter(T counter)
Add a counter to this group. |
boolean |
equals(Object genericRight)
|
T |
findCounter(String counterName)
Find a counter in the group. |
T |
findCounter(String counterName,
boolean create)
Find a counter in the group |
T |
findCounter(String counterName,
String displayName)
Find a counter in the group. |
String |
getDisplayName()
Get the display name of the group. |
String |
getName()
Get the internal name of the group |
int |
hashCode()
|
void |
incrAllCounters(CounterGroupBase<T> rightGroup)
Increment all counters by a group of counters |
Iterator<T> |
iterator()
|
protected abstract T |
newCounter()
Abstract factory method to create a new counter of type T |
protected abstract T |
newCounter(String counterName,
String displayName,
long value)
Abstract factory method to create a new counter of type T |
void |
readFields(DataInput in)
|
void |
setDisplayName(String displayName)
Set the display name of the group |
int |
size()
|
void |
write(DataOutput out)
GenericGroup ::= displayName #counter counter* |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.mapreduce.counters.CounterGroupBase |
---|
getUnderlyingGroup |
Constructor Detail |
---|
public AbstractCounterGroup(String name, String displayName, Limits limits)
Method Detail |
---|
public String getName()
CounterGroupBase
getName
in interface CounterGroupBase<T extends Counter>
public String getDisplayName()
CounterGroupBase
getDisplayName
in interface CounterGroupBase<T extends Counter>
public void setDisplayName(String displayName)
CounterGroupBase
setDisplayName
in interface CounterGroupBase<T extends Counter>
displayName
- of the grouppublic void addCounter(T counter)
CounterGroupBase
addCounter
in interface CounterGroupBase<T extends Counter>
counter
- to addpublic T addCounter(String counterName, String displayName, long value)
CounterGroupBase
addCounter
in interface CounterGroupBase<T extends Counter>
counterName
- of the counterdisplayName
- of the countervalue
- of the counter
public T findCounter(String counterName, String displayName)
CounterGroupBase
findCounter
in interface CounterGroupBase<T extends Counter>
counterName
- the name of the counterdisplayName
- the display name of the counter
public T findCounter(String counterName, boolean create)
CounterGroupBase
findCounter
in interface CounterGroupBase<T extends Counter>
counterName
- the name of the countercreate
- create the counter if not found if true
public T findCounter(String counterName)
CounterGroupBase
findCounter
in interface CounterGroupBase<T extends Counter>
counterName
- the name of the counter
protected abstract T newCounter(String counterName, String displayName, long value)
counterName
- of the counterdisplayName
- of the countervalue
- of the counter
protected abstract T newCounter()
public Iterator<T> iterator()
iterator
in interface Iterable<T extends Counter>
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public int size()
size
in interface CounterGroupBase<T extends Counter>
public boolean equals(Object genericRight)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void incrAllCounters(CounterGroupBase<T> rightGroup)
CounterGroupBase
incrAllCounters
in interface CounterGroupBase<T extends Counter>
rightGroup
- the group to be added to this group
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |