@Override
  public void seek(String singleFileOffset) {
    try {
      // See comments for AvroFileCheckpoint to understand the behavior below
      AvroFileCheckpoint checkpoint = new AvroFileCheckpoint(singleFileOffset);
      if (checkpoint.isStartingOffset()) {
        // seek to the beginning of the first block
        fileReader.sync(0);
        curBlockStart = fileReader.previousSync();
        curRecordOffset = 0;
        return;
      }
      fileReader.seek(checkpoint.getBlockStart());
      for (int i = 0; i < checkpoint.getRecordOffset(); i++) {
        if (fileReader.hasNext()) {
          fileReader.next();
        }
      }
      curBlockStart = checkpoint.getBlockStart();
      curRecordOffset = checkpoint.getRecordOffset();
    } catch (IOException e) {
      throw new SamzaException(e);
    }
  }
An implementation of the HdfsReader that reads and processes avro format
files.
samza-hdfs/src/main/java/org/apache/samza/system/hdfs/reader/AvroFileHdfsReader.java