org.terrier.structures.indexing.singlepass.hadoop
Class HadoopRunPostingIterator

java.lang.Object
  extended by org.terrier.structures.indexing.singlepass.RunIterator
      extended by org.terrier.structures.indexing.singlepass.hadoop.HadoopRunPostingIterator
All Implemented Interfaces:
Closeable, Iterator<PostingInRun>

public class HadoopRunPostingIterator
extends RunIterator

This class allows the iteration of over a postings within a run within the Hadoop framwork.

Since:
2.2
Author:
Craig Macdonald

Field Summary
protected  String mapNo
          Map number
protected  Iterator<MapEmittedPostingList> postingIterator
          Runs To Be Merged
protected  int splitNo
          The Split that the current posting comes from
protected  String term
          Term that we're processing
 
Fields inherited from class org.terrier.structures.indexing.singlepass.RunIterator
flushNo, numberOfFields, posting, postingClass
 
Constructor Summary
HadoopRunPostingIterator(Class<? extends PostingInRun> postingClass, int runNo, Iterator<MapEmittedPostingList> _postingiterator, String _term, int numFields)
          Constructs a new RunPostingIterator.
 
Method Summary
 String getMapNo()
          Returns the map that the current posting came from
 int getSplitNo()
           
 boolean hasNext()
          Move to the next posting
 PostingInRun next()
          Return the next PostingInRun
 
Methods inherited from class org.terrier.structures.indexing.singlepass.RunIterator
close, createPosting, current, getRunNo, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

postingIterator

protected Iterator<MapEmittedPostingList> postingIterator
Runs To Be Merged


mapNo

protected String mapNo
Map number


term

protected String term
Term that we're processing


splitNo

protected int splitNo
The Split that the current posting comes from

Constructor Detail

HadoopRunPostingIterator

public HadoopRunPostingIterator(Class<? extends PostingInRun> postingClass,
                                int runNo,
                                Iterator<MapEmittedPostingList> _postingiterator,
                                String _term,
                                int numFields)
                         throws Exception
Constructs a new RunPostingIterator.

Parameters:
postingClass - is the name of the class to use to read the postings
runNo - is the number of the run
_postingiterator - is the iterator of reduce input data that we are going to loop through
_term - is the term that this iterator is operating on
Throws:
Exception
Method Detail

hasNext

public boolean hasNext()
Move to the next posting

Specified by:
hasNext in interface Iterator<PostingInRun>
Specified by:
hasNext in class RunIterator

next

public PostingInRun next()
Return the next PostingInRun

Specified by:
next in interface Iterator<PostingInRun>
Specified by:
next in class RunIterator

getMapNo

public String getMapNo()
Returns the map that the current posting came from


getSplitNo

public int getSplitNo()
Returns:
the splitNo


Terrier 3.6. Copyright © 2004-2011 University of Glasgow