org.apache.tez.runtime.library.api
Interface KeyValueReader

All Superinterfaces:
org.apache.tez.runtime.api.Reader
All Known Implementing Classes:
ConcatenatedMergedKeyValueInput.ConcatenatedMergedKeyValueReader, ShuffledUnorderedKVReader

public interface KeyValueReader
extends org.apache.tez.runtime.api.Reader

A key/value(s) pair based Reader. Example usage while (kvReader.next()) { Object key = kvReader.getCurrentKey(); Object value = kvReader.getCurrentValue();


Method Summary
 Object getCurrentKey()
          Returns the current key
 Object getCurrentValue()
          Returns the current value
 boolean next()
          Moves to the next key/values(s) pair
 

Method Detail

next

boolean next()
             throws IOException
Moves to the next key/values(s) pair

Returns:
true if another key/value(s) pair exists, false if there are no more.
Throws:
IOException - if an error occurs

getCurrentKey

Object getCurrentKey()
                     throws IOException
Returns the current key

Returns:
the current key
Throws:
IOException

getCurrentValue

Object getCurrentValue()
                       throws IOException
Returns the current value

Returns:
the current value
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All rights reserved.