|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.counters.AbstractCounters<C,G>
C - type of counter inside the countersG - type of group inside the counters@InterfaceAudience.Public @InterfaceStability.Stable public abstract class AbstractCounters<C extends Counter,G extends CounterGroupBase<C>>
An abstract class to provide common implementation for the Counters container in both mapred and mapreduce packages.
| Field Summary | |
|---|---|
protected static org.apache.commons.logging.Log |
LOG
|
| Constructor Summary | |
|---|---|
AbstractCounters(AbstractCounters<C1,G1> counters,
CounterGroupFactory<C,G> groupFactory)
Construct from another counters object. |
|
AbstractCounters(CounterGroupFactory<C,G> gf)
|
|
| Method Summary | |
|---|---|
G |
addGroup(G group)
Add a group. |
G |
addGroup(String name,
String displayName)
Add a new group |
int |
countCounters()
Returns the total number of counters, by summing the number of counters in each group. |
boolean |
equals(Object genericRight)
|
C |
findCounter(Enum<?> key)
Find the counter for the given enum. |
C |
findCounter(String scheme,
FileSystemCounter key)
Find the file system counter for the given scheme and enum. |
C |
findCounter(String groupName,
String counterName)
Find a counter, create one if necessary |
G |
getGroup(String groupName)
Returns the named counter group, or an empty group if there is none with the specified name. |
Iterable<String> |
getGroupNames()
Returns the names of all counter classes. |
boolean |
getWriteAllCounters()
Get the "writeAllCounters" option |
int |
hashCode()
|
void |
incrAllCounters(AbstractCounters<C,G> other)
Increments multiple counters by their amounts in another Counters instance. |
Iterator<G> |
iterator()
|
Limits |
limits()
|
void |
readFields(DataInput in)
|
void |
setWriteAllCounters(boolean send)
Set the "writeAllCounters" option to true or false |
String |
toString()
Return textual representation of the counter values. |
void |
write(DataOutput out)
Write the set of groups. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
@InterfaceAudience.Private public AbstractCounters(CounterGroupFactory<C,G> gf)
@InterfaceAudience.Private
public AbstractCounters(AbstractCounters<C1,G1> counters,
CounterGroupFactory<C,G> groupFactory)
C1 - type of the other counterG1 - type of the other counter groupcounters - the counters object to copygroupFactory - the factory for new groups| Method Detail |
|---|
@InterfaceAudience.Private public G addGroup(G group)
group - object to add
@InterfaceAudience.Private
public G addGroup(String name,
String displayName)
name - of the groupdisplayName - of the group
public C findCounter(String groupName,
String counterName)
groupName - of the countercounterName - name of the counter
public C findCounter(Enum<?> key)
key - the counter key
@InterfaceAudience.Private
public C findCounter(String scheme,
FileSystemCounter key)
scheme - of the file systemkey - the enum of the counter
public Iterable<String> getGroupNames()
public Iterator<G> iterator()
iterator in interface Iterable<G extends CounterGroupBase<C>>public G getGroup(String groupName)
groupName - name of the group
public int countCounters()
public void write(DataOutput out)
throws IOException
write in interface org.apache.hadoop.io.WritableIOException
public void readFields(DataInput in)
throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic String toString()
toString in class Objectpublic void incrAllCounters(AbstractCounters<C,G> other)
other - the other Counters instancepublic boolean equals(Object genericRight)
equals in class Objectpublic int hashCode()
hashCode in class Object@InterfaceAudience.Private public void setWriteAllCounters(boolean send)
send - if true all counters would be serialized, otherwise only
framework counters would be serialized in
write(DataOutput)@InterfaceAudience.Private public boolean getWriteAllCounters()
@InterfaceAudience.Private public Limits limits()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||