Class TimedIterator

java.lang.Object
com.linkedin.venice.spark.datawriter.task.TimedIterator
All Implemented Interfaces:
Iterator<org.apache.spark.sql.Row>

public class TimedIterator extends Object implements Iterator<org.apache.spark.sql.Row>
Wraps an Iterator<Row> and records wall-clock timing when the iterator is exhausted. Timing is recorded once, on the first call to hasNext() that returns false.
  • Constructor Details

    • TimedIterator

      public TimedIterator(Iterator<org.apache.spark.sql.Row> delegate, org.apache.spark.util.LongAccumulator timeNsAccumulator)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<org.apache.spark.sql.Row>
    • next

      public org.apache.spark.sql.Row next()
      Specified by:
      next in interface Iterator<org.apache.spark.sql.Row>