com.datasalt.pangool.tuplemr.mapred
Class TupleIterator<OUTPUT_KEY,OUTPUT_VALUE>

java.lang.Object
  extended by com.datasalt.pangool.tuplemr.mapred.TupleIterator<OUTPUT_KEY,OUTPUT_VALUE>
All Implemented Interfaces:
Iterable<ITuple>, Iterator<ITuple>

public class TupleIterator<OUTPUT_KEY,OUTPUT_VALUE>
extends Object
implements Iterator<ITuple>, Iterable<ITuple>

Iterator used in SimpleReducer and RollupReducer.

Basically it translates an Iterable containing NullWritable objects to one that contains ITuple objects. In order to do so it handles the ReduceContext and uses ReduceContext.getCurrentKey() to obtain the key in every iteration.

See Also:
Iterable, ITuple

Constructor Summary
TupleIterator(org.apache.hadoop.mapreduce.ReduceContext<DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable,OUTPUT_KEY,OUTPUT_VALUE> context)
           
 
Method Summary
 boolean hasNext()
           
 Iterator<ITuple> iterator()
           
 ITuple next()
           
 void remove()
           
 void setIterator(Iterator<org.apache.hadoop.io.NullWritable> iterator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleIterator

public TupleIterator(org.apache.hadoop.mapreduce.ReduceContext<DatumWrapper<ITuple>,org.apache.hadoop.io.NullWritable,OUTPUT_KEY,OUTPUT_VALUE> context)
Method Detail

setIterator

public void setIterator(Iterator<org.apache.hadoop.io.NullWritable> iterator)

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<ITuple>

next

public ITuple next()
Specified by:
next in interface Iterator<ITuple>

remove

public void remove()
Specified by:
remove in interface Iterator<ITuple>

iterator

public Iterator<ITuple> iterator()
Specified by:
iterator in interface Iterable<ITuple>


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.