org.apache.hadoop.streaming.io
Class OutputReader<K,V>

java.lang.Object
  extended by org.apache.hadoop.streaming.io.OutputReader<K,V>
Direct Known Subclasses:
RawBytesOutputReader, TextOutputReader, TypedBytesOutputReader

public abstract class OutputReader<K,V>
extends Object

Abstract base for classes that read the client's output.


Constructor Summary
OutputReader()
           
 
Method Summary
abstract  K getCurrentKey()
          Returns the current key.
abstract  V getCurrentValue()
          Returns the current value.
abstract  String getLastOutput()
          Returns the last output from the client as a String.
 void initialize(PipeMapRed pipeMapRed)
          Initializes the OutputReader.
abstract  boolean readKeyValue()
          Read the next key/value pair outputted by the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputReader

public OutputReader()
Method Detail

initialize

public void initialize(PipeMapRed pipeMapRed)
                throws IOException
Initializes the OutputReader. This method has to be called before calling any of the other methods.

Throws:
IOException

readKeyValue

public abstract boolean readKeyValue()
                              throws IOException
Read the next key/value pair outputted by the client.

Returns:
true iff a key/value pair was read
Throws:
IOException

getCurrentKey

public abstract K getCurrentKey()
                         throws IOException
Returns the current key.

Throws:
IOException

getCurrentValue

public abstract V getCurrentValue()
                           throws IOException
Returns the current value.

Throws:
IOException

getLastOutput

public abstract String getLastOutput()
Returns the last output from the client as a String.



Copyright © 2009 The Apache Software Foundation