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
ReadableASCII
readASCII
in interface ReadableASCII
in
- source to read from.IOException
- an error reading inputpublic abstract T valueOf(String str)
str
- public String asciiHeader()
ReadableASCII
asciiHeader
in interface ReadableASCII
asciiHeader
in interface WriteableASCII
public void writeASCII(PrintWriter out) throws IOException
WriteableASCII
writeASCII
in interface WriteableASCII
out
- sink to write toIOException
- an error writing to out