Result.OutputException| Constructor and Description |
|---|
ResultOutput(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.mapreduce.RecordWriter writer)
Creates a new instance.
|
ResultOutput(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.mapreduce.RecordWriter writer,
List<org.apache.hadoop.mapreduce.Counter> counters)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(T result)
Adds an object into this result.
|
void |
close()
Finalizes and closes this output.
|
protected Object |
getKey(T result)
Returns a key for the value.
|
String |
toString() |
static <K,V> void |
write(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,? super K,? super V> context,
K key,
V value)
Writes a key and value into current context.
|
public ResultOutput(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.mapreduce.RecordWriter writer)
throws IOException,
InterruptedException
context - the current contextwriter - the record writer for writing data model objectsIOException - if failed to initialize the outputInterruptedException - if interrupted while initializing the outputIllegalArgumentException - if some parameters are nullpublic ResultOutput(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.mapreduce.RecordWriter writer,
List<org.apache.hadoop.mapreduce.Counter> counters)
throws IOException,
InterruptedException
context - current contextwriter - target writercounters - record countersIOException - if initialization failed by I/O exceptionInterruptedException - if interruptedIllegalArgumentException - if some parameters were nullpublic static <K,V> void write(org.apache.hadoop.mapreduce.TaskInputOutputContext<?,?,? super K,? super V> context,
K key,
V value)
K - type of key objectV - type of value objectcontext - current contextkey - the key object (nullable)value - the value object (nullable)Result.OutputException - if failed to write the objectspublic void add(T result)
Resultprotected Object getKey(T result)
result - target valuepublic void close()
throws IOException,
InterruptedException
IOException - if failed to finalize the outputInterruptedException - if interrupted while finalizing the outputCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.