org.apache.hadoop.mapreduce

## Class MarkableIterator<VALUE>

- java.lang.Object
- - 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

    Constructors
    Constructor and Description
    `MarkableIterator(Iterator<VALUE> itr)` Create a new iterator layered on the input iterator

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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`

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### 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 © 2022 Apache Software Foundation. All rights reserved.