@InterfaceAudience.Private public class GenericCounter extends AbstractCounter
Constructor and Description |
---|
GenericCounter() |
GenericCounter(String name,
String displayName) |
GenericCounter(String name,
String displayName,
long value) |
Modifier and Type | Method and Description |
---|---|
String |
getDisplayName()
Get the display name of the counter.
|
String |
getName() |
Counter |
getUnderlyingCounter() |
long |
getValue()
What is the current value of this counter?
|
void |
increment(long incr)
Increment this counter by the given value
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in . |
void |
setDisplayName(String displayName)
Deprecated.
|
void |
setValue(long value)
Set this counter by the given value
|
void |
write(DataOutput out)
GenericCounter ::= keyName isDistinctDisplayName [displayName] value
|
equals, hashCode
@Deprecated public void setDisplayName(String displayName)
Counter
setDisplayName
in interface Counter
setDisplayName
in class AbstractCounter
displayName
- of the counterpublic void readFields(DataInput in) throws IOException
Writable
in
.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
in
- DataInput
to deseriablize this object from.IOException
public void write(DataOutput out) throws IOException
out
- DataOuput
to serialize this object into.IOException
public String getName()
public String getDisplayName()
Counter
public long getValue()
Counter
public void setValue(long value)
Counter
value
- the value to setpublic void increment(long incr)
Counter
incr
- the value to increase this counter bypublic Counter getUnderlyingCounter()
Copyright © 2013 Apache Software Foundation. All rights reserved.