@Test public void testParquetIteratorIdempotency() throws IOException { ParquetReader reader = mock(ParquetReader.class); when(reader.read()).thenReturn(1).thenReturn(null); ParquetReaderIterator<Integer> iterator = new ParquetReaderIterator<>(reader); int idempotencyCheckCounter = 0; while (idempotencyCheckCounter < 3) { assertTrue(iterator.hasNext()); idempotencyCheckCounter++; } }
@Override public boolean hasNext() { try { if (this.next == null) { this.next = parquetReader.read(); } return this.next != null; } catch (IOException io) { throw new HoodieIOException("unable to read next record from parquet file ", io); } }
ParquetReaderIterator implements Iterator<T> { @Override public boolean hasNext() { try { if (this.next == null) { this.next = parquetReader.read(); } return this.next != null; } catch (IOException io) { throw new HoodieIOException("unable to read next record from parquet file ", io); } } }
ParquetReaderIterator implements Iterator<T> { @Override public boolean hasNext() { try { if (this.next == null) { this.next = parquetReader.read(); } return this.next != null; } catch (IOException io) { throw new HoodieIOException("unable to read next record from parquet file ", io); } } ParquetReaderIterator(ParquetReader<T> parquetReader); }
ParquetReaderIterator implements Iterator<T> { @Override public boolean hasNext() { try { if (this.next == null) { this.next = parquetReader.read(); } return this.next != null; } catch (IOException io) { throw new HoodieIOException("unable to read next record from parquet file ", io); } } ParquetReaderIterator(ParquetReader<T> parquetReader); @Override boolean hasNext(); @Override T next(); void close(); }
ParquetReaderIterator implements Iterator<T> { @Override public boolean hasNext() { try { if (this.next == null) { this.next = parquetReader.read(); } return this.next != null; } catch (IOException io) { throw new HoodieIOException("unable to read next record from parquet file ", io); } } ParquetReaderIterator(ParquetReader<T> parquetReader); @Override boolean hasNext(); @Override T next(); void close();  }