Counters
instead.@Deprecated @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.Group
s, each comprising of
counters from a particular Enum
class.
Modifier and Type | Class and Description |
---|---|
static class |
Counters.Counter
Deprecated.
A counter record, comprising its name and value.
|
static class |
Counters.Group
Deprecated.
Group of counters, comprising of counters from a particular
counter Enum class. |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_COUNTER_LIMIT
Deprecated.
|
LOG
Constructor and Description |
---|
Counters()
Deprecated.
|
Counters(Counters newCounters)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Counters.Counter |
findCounter(java.lang.String group,
int id,
java.lang.String name)
Deprecated.
use
findCounter(String, String) instead |
Counters.Counter |
findCounter(java.lang.String group,
java.lang.String name)
Deprecated.
Find a counter, create one if necessary
|
static Counters |
fromEscapedCompactString(java.lang.String compactString)
Deprecated.
Convert a stringified (by
makeEscapedCompactString() counter
representation into a counter object. |
long |
getCounter(java.lang.Enum<?> key)
Deprecated.
Returns current value of the specified counter, or 0 if the counter
does not exist.
|
Counters.Group |
getGroup(java.lang.String groupName)
Deprecated.
Returns the named counter group, or an empty group if there is none
with the specified name.
|
java.util.Collection<java.lang.String> |
getGroupNames()
Deprecated.
Returns the names of all counter classes.
|
void |
incrAllCounters(Counters other)
Deprecated.
Increments multiple counters by their amounts in another Counters
instance.
|
void |
incrCounter(java.lang.Enum<?> key,
long amount)
Deprecated.
Increments the specified counter by the specified amount, creating it if
it didn't already exist.
|
void |
incrCounter(java.lang.String group,
java.lang.String counter,
long amount)
Deprecated.
Increments the specified counter by the specified amount, creating it if
it didn't already exist.
|
void |
log(org.apache.commons.logging.Log log)
Deprecated.
Logs the current counter values.
|
java.lang.String |
makeCompactString()
Deprecated.
|
java.lang.String |
makeEscapedCompactString()
Deprecated.
Represent the counter in a textual format that can be converted back to
its object form
|
int |
size()
Deprecated.
use
AbstractCounters.countCounters() instead |
static Counters |
sum(Counters a,
Counters b)
Deprecated.
Convenience method for computing the sum of two sets of counters.
|
addGroup, addGroup, countCounters, equals, findCounter, findCounter, getWriteAllCounters, hashCode, incrAllCounters, iterator, limits, readFields, setWriteAllCounters, toString, write
public Counters()
public Counters(Counters newCounters)
public Counters.Group getGroup(java.lang.String groupName)
AbstractCounters
getGroup
in class AbstractCounters<Counters.Counter,Counters.Group>
groupName
- name of the grouppublic java.util.Collection<java.lang.String> getGroupNames()
AbstractCounters
getGroupNames
in class AbstractCounters<Counters.Counter,Counters.Group>
public java.lang.String makeCompactString()
public Counters.Counter findCounter(java.lang.String group, java.lang.String name)
AbstractCounters
findCounter
in class AbstractCounters<Counters.Counter,Counters.Group>
group
- of the countername
- name of the counter@Deprecated public Counters.Counter findCounter(java.lang.String group, int id, java.lang.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(java.lang.Enum<?> key, long amount)
key
- identifies a counteramount
- amount by which counter is to be incrementedpublic void incrCounter(java.lang.String group, java.lang.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(java.lang.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 java.lang.String makeEscapedCompactString()
public static Counters fromEscapedCompactString(java.lang.String compactString) throws java.text.ParseException
makeEscapedCompactString()
counter
representation into a counter object.compactString
- to parsejava.text.ParseException
Copyright © 2009 The Apache Software Foundation