C
- type of counter inside the countersG
- type of group inside the counters@InterfaceAudience.Public @InterfaceStability.Unstable public abstract class AbstractCounters<C extends TezCounter,G extends CounterGroupBase<C>> extends Object implements org.apache.hadoop.io.Writable, Iterable<G>
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
AbstractCounters(AbstractCounters<C1,G1> counters,
org.apache.tez.common.counters.CounterGroupFactory<C,G> groupFactory)
Construct from another counters object.
|
AbstractCounters(org.apache.tez.common.counters.CounterGroupFactory<C,G> gf) |
Modifier and Type | Method and Description |
---|---|
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 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.
|
int |
hashCode() |
void |
incrAllCounters(AbstractCounters<C,G> other)
Increments multiple counters by their amounts in another Counters
instance.
|
Iterator<G> |
iterator() |
void |
readFields(DataInput in) |
String |
toShortString() |
String |
toString()
Return textual representation of the counter values.
|
void |
write(DataOutput out)
Write the set of groups.
|
@InterfaceAudience.Private public AbstractCounters(org.apache.tez.common.counters.CounterGroupFactory<C,G> gf)
@InterfaceAudience.Private public AbstractCounters(AbstractCounters<C1,G1> counters, org.apache.tez.common.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 groupspublic C findCounter(String groupName, String counterName)
groupName
- of the countercounterName
- name of the counterpublic C findCounter(Enum<?> key)
key
- the counter keypublic Iterable<String> getGroupNames()
public Iterator<G> iterator()
iterator
in interface Iterable<G extends CounterGroupBase<C>>
public G getGroup(String groupName)
groupName
- name of the grouppublic int countCounters()
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 String toShortString()
public String toString()
public void incrAllCounters(AbstractCounters<C,G> other)
other
- the other Counters instanceCopyright © 2015 Apache Software Foundation. All rights reserved.