T - the enum typepublic abstract class WritableEnumCounter<T extends Enum<?>> extends Object implements ReadWriteableASCII
Counter written using the enum | Constructor and Description |
|---|
WritableEnumCounter()
initialise the values map
|
WritableEnumCounter(org.apache.hadoop.mapreduce.Counters counters,
T[] enumType)
intitalise the global stats from some counters
|
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader()
Header for ascii input.
|
long |
getValue(T type) |
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
setValue(T type,
Long value) |
abstract T |
valueOf(String str) |
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
public WritableEnumCounter()
public WritableEnumCounter(org.apache.hadoop.mapreduce.Counters counters, T[] enumType)
counters - the counters to look for the enum types inenumType - the enum typespublic void readASCII(Scanner in) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIin - source to read from.IOException - an error reading inputpublic abstract T valueOf(String str)
str - public String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIout - sink to write toIOException - an error writing to out