@InterfaceAudience.Public @InterfaceStability.Stable public class Counters extends AbstractCounters<Counters.Counter,Counters.Group>
Counters represent global counters, defined either by the
 Map-Reduce framework or applications. Each Counter can be of
 any Enum type.
Counters are bunched into Counters.Groups, each comprising of
 counters from a particular Enum class.
| 修飾子とタイプ | クラスと説明 | 
|---|---|
| static class  | Counters.CounterA counter record, comprising its name and value. | 
| static class  | Counters.GroupGroupof counters, comprising of counters from a particular
  counterEnumclass. | 
| 修飾子とタイプ | フィールドと説明 | 
|---|---|
| static int | MAX_COUNTER_LIMIT | 
| static int | MAX_GROUP_LIMIT | 
LOG| 修飾子とタイプ | メソッドと説明 | 
|---|---|
| Counters.Counter | findCounter(String group,
           int id,
           String name)非推奨です。 
 use  findCounter(String, String)instead | 
| Counters.Counter | findCounter(String group,
           String name)Find a counter, create one if necessary | 
| static Counters | fromEscapedCompactString(String compactString)Convert a stringified (by  makeEscapedCompactString()counter
 representation into a counter object. | 
| long | getCounter(Enum<?> key)Returns current value of the specified counter, or 0 if the counter
 does not exist. | 
| Counters.Group | getGroup(String groupName)Returns the named counter group, or an empty group if there is none
 with the specified name. | 
| Collection<String> | getGroupNames()Returns the names of all counter classes. | 
| void | incrAllCounters(Counters other)Increments multiple counters by their amounts in another Counters
 instance. | 
| void | incrCounter(Enum<?> key,
           long amount)Increments the specified counter by the specified amount, creating it if
 it didn't already exist. | 
| void | incrCounter(String group,
           String counter,
           long amount)Increments the specified counter by the specified amount, creating it if
 it didn't already exist. | 
| void | log(org.apache.commons.logging.Log log)Logs the current counter values. | 
| String | makeCompactString() | 
| String | makeEscapedCompactString()Represent the counter in a textual format that can be converted back to
 its object form | 
| int | size()非推奨です。 
 use  AbstractCounters.countCounters()instead | 
| static Counters | sum(Counters a,
   Counters b)Convenience method for computing the sum of two sets of counters. | 
countCounters, equals, findCounter, hashCode, incrAllCounters, iterator, readFields, toString, writeforEach, spliteratorpublic static final int MAX_COUNTER_LIMIT
public static final int MAX_GROUP_LIMIT
public Counters.Group getGroup(String groupName)
AbstractCountersgetGroup クラス内 AbstractCounters<Counters.Counter,Counters.Group>groupName - name of the grouppublic Collection<String> getGroupNames()
AbstractCountersgetGroupNames クラス内 AbstractCounters<Counters.Counter,Counters.Group>public String makeCompactString()
public Counters.Counter findCounter(String group, String name)
AbstractCountersfindCounter クラス内 AbstractCounters<Counters.Counter,Counters.Group>group - of the countername - name of the counter@Deprecated public Counters.Counter findCounter(String group, int id, String name)
findCounter(String, String) insteadgroup - the name of the groupid - the id of the counter within the group (0 to N-1)name - the internal name of the counterpublic void incrCounter(Enum<?> key, long amount)
key - identifies a counteramount - amount by which counter is to be incrementedpublic void incrCounter(String group, String counter, long amount)
group - the name of the groupcounter - the internal name of the counteramount - amount by which counter is to be incrementedpublic long getCounter(Enum<?> key)
key - the counter enum to lookuppublic void incrAllCounters(Counters other)
other - the other Counters instancepublic int size()
AbstractCounters.countCounters() insteadpublic static Counters sum(Counters a, Counters b)
a - the first countersb - the second counterspublic void log(org.apache.commons.logging.Log log)
log - The log to use.public String makeEscapedCompactString()
public static Counters fromEscapedCompactString(String compactString) throws ParseException
makeEscapedCompactString() counter
 representation into a counter object.compactString - to parseParseExceptionCopyright © 2016 Apache Software Foundation. All rights reserved.