org.apache.hadoop.mapreduce
Class MarkableIterator<VALUE>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.MarkableIterator<VALUE>

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class MarkableIterator<VALUE>
extends Object

MarkableIterator is a wrapper iterator class that implements the MarkableIteratorInterface.


Constructor Summary
MarkableIterator(Iterator<VALUE> itr)
          Create a new iterator layered on the input iterator
 
Method Summary
 void clearMark()
          Clear any previously set mark
 boolean hasNext()
           
 void mark()
          Mark the current record.
 VALUE next()
           
 void remove()
           
 void reset()
          Reset the iterator to the last record before a call to the previous mark
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkableIterator

public MarkableIterator(Iterator<VALUE> itr)
Create a new iterator layered on the input iterator

Parameters:
itr - underlying iterator that implements MarkableIteratorInterface
Method Detail

mark

public void mark()
          throws IOException
Mark the current record. A subsequent call to reset will rewind the iterator to this record.

Throws:
IOException

reset

public void reset()
           throws IOException
Reset the iterator to the last record before a call to the previous mark

Throws:
IOException

clearMark

public void clearMark()
               throws IOException
Clear any previously set mark

Throws:
IOException

hasNext

public boolean hasNext()

next

public VALUE next()

remove

public void remove()


Copyright © 2014 Apache Software Foundation. All Rights Reserved.