org.apache.hadoop.streaming.io
Class KeyOnlyTextOutputReader

java.lang.Object
  extended by org.apache.hadoop.streaming.io.OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>
      extended by org.apache.hadoop.streaming.io.KeyOnlyTextOutputReader

public class KeyOnlyTextOutputReader
extends OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>

OutputReader that reads the client's output as text, interpreting each line as a key and outputting NullWritables for values.


Constructor Summary
KeyOnlyTextOutputReader()
           
 
Method Summary
 org.apache.hadoop.io.Text getCurrentKey()
          Returns the current key.
 org.apache.hadoop.io.NullWritable getCurrentValue()
          Returns the current value.
 String getLastOutput()
          Returns the last output from the client as a String.
 void initialize(PipeMapRed pipeMapRed)
          Initializes the OutputReader.
 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

KeyOnlyTextOutputReader

public KeyOnlyTextOutputReader()
Method Detail

initialize

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

Overrides:
initialize in class OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>
Throws:
IOException

readKeyValue

public boolean readKeyValue()
                     throws IOException
Description copied from class: OutputReader
Read the next key/value pair outputted by the client.

Specified by:
readKeyValue in class OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>
Returns:
true iff a key/value pair was read
Throws:
IOException

getCurrentKey

public org.apache.hadoop.io.Text getCurrentKey()
                                        throws IOException
Description copied from class: OutputReader
Returns the current key.

Specified by:
getCurrentKey in class OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>
Throws:
IOException

getCurrentValue

public org.apache.hadoop.io.NullWritable getCurrentValue()
                                                  throws IOException
Description copied from class: OutputReader
Returns the current value.

Specified by:
getCurrentValue in class OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>
Throws:
IOException

getLastOutput

public String getLastOutput()
Description copied from class: OutputReader
Returns the last output from the client as a String.

Specified by:
getLastOutput in class OutputReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.NullWritable>


Copyright © 2014 Apache Software Foundation. All Rights Reserved.