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

All Superinterfaces:
org.apache.tez.runtime.api.Reader
All Known Implementing Classes:
ConcatenatedMergedKeyValuesInput.ConcatenatedMergedKeyValuesReader

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

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


Method Summary
 Object getCurrentKey()
          Returns the current key
 Iterable<Object> getCurrentValues()
          Returns an Iterable view of the values associated with the current key
 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

getCurrentValues

Iterable<Object> getCurrentValues()
                                  throws IOException
Returns an Iterable view of the values associated with the current key

Returns:
an Iterable view of the values associated with the current key
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All rights reserved.