Class DataIterator<T>

  • Type Parameters:
    T - is the output data type returned by this iterator.
    All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<T>, org.apache.iceberg.io.CloseableIterator<T>

    @Internal
    public class DataIterator<T>
    extends java.lang.Object
    implements org.apache.iceberg.io.CloseableIterator<T>
    Flink data iterator that reads CombinedScanTask into a CloseableIterator
    • Constructor Summary

      Constructors 
      Constructor Description
      DataIterator​(FileScanTaskReader<T> fileScanTaskReader, org.apache.iceberg.CombinedScanTask task, org.apache.iceberg.io.FileIO io, org.apache.iceberg.encryption.EncryptionManager encryption)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      boolean currentFileHasNext()  
      int fileOffset()  
      boolean hasNext()  
      T next()  
      long recordOffset()  
      void seek​(int startingFileOffset, long startingRecordOffset)
      (startingFileOffset, startingRecordOffset) points to the next row that reader should resume from.
      • 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, remove
    • Constructor Detail

      • DataIterator

        public DataIterator​(FileScanTaskReader<T> fileScanTaskReader,
                            org.apache.iceberg.CombinedScanTask task,
                            org.apache.iceberg.io.FileIO io,
                            org.apache.iceberg.encryption.EncryptionManager encryption)
    • Method Detail

      • seek

        public void seek​(int startingFileOffset,
                         long startingRecordOffset)
        (startingFileOffset, startingRecordOffset) points to the next row that reader should resume from. E.g., if the seek position is (file=0, record=1), seek moves the iterator position to the 2nd row in file 0. When next() is called after seek, 2nd row from file 0 should be returned.
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<T>
      • next

        public T next()
        Specified by:
        next in interface java.util.Iterator<T>
      • currentFileHasNext

        public boolean currentFileHasNext()
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • fileOffset

        public int fileOffset()
      • recordOffset

        public long recordOffset()