org.apache.hadoop.hive.ql.exec.tez.tools
Class InputMerger

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.tez.tools.InputMerger
All Implemented Interfaces:
org.apache.tez.runtime.api.Reader, org.apache.tez.runtime.library.api.KeyValuesReader

public class InputMerger
extends Object
implements org.apache.tez.runtime.library.api.KeyValuesReader

A KeyValuesReader implementation that returns a sorted stream of key-values by doing a sorted merge of the key-value in LogicalInputs. Tags are in the last byte of the key, so no special handling for tags is required. Uses a priority queue to pick the KeyValuesReader of the input that is next in sort order.


Field Summary
static org.apache.commons.logging.Log l4j
           
 
Constructor Summary
InputMerger(List<? extends org.apache.tez.runtime.api.Input> shuffleInputs)
           
 
Method Summary
 Object getCurrentKey()
           
 Iterable<Object> getCurrentValues()
           
 boolean next()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

l4j

public static final org.apache.commons.logging.Log l4j
Constructor Detail

InputMerger

public InputMerger(List<? extends org.apache.tez.runtime.api.Input> shuffleInputs)
            throws Exception
Throws:
Exception
Method Detail

next

public boolean next()
             throws IOException
Specified by:
next in interface org.apache.tez.runtime.library.api.KeyValuesReader
Returns:
true if there are more key-values and advances to next key-values
Throws:
IOException

getCurrentKey

public Object getCurrentKey()
                     throws IOException
Specified by:
getCurrentKey in interface org.apache.tez.runtime.library.api.KeyValuesReader
Throws:
IOException

getCurrentValues

public Iterable<Object> getCurrentValues()
                                  throws IOException
Specified by:
getCurrentValues in interface org.apache.tez.runtime.library.api.KeyValuesReader
Throws:
IOException


Copyright © 2014 The Apache Software Foundation. All rights reserved.