package com.chenyang.nse.bussiness.tools.dataprocess.hive.hdfs.format;

import java.io.IOException;
import java.util.Iterator;

public class HdfsItemIterator implements Iterator<DataBatch> {
   private final HdfsFileReader reader;
   private DataBatch batch;

   public HdfsItemIterator(HdfsFileReader reader) {
      this.reader = reader;
   }

   public boolean hasNext() {
      try {
         this.batch = this.reader.next();
         return this.batch != null;
      } catch (IOException var2) {
         return false;
      }
   }

   public DataBatch next() {
      return this.batch;
   }
}
