private void init(String offset) {
    if (curReader != null) {
      curReader.close();
      curReader = null;
    }
    curFileIndex = getCurFileIndex(offset);
    if (curFileIndex >= filePaths.size()) {
      throw new SamzaException(
        String.format("Invalid file index %d. Number of files is %d", curFileIndex, filePaths.size()));
    }
    curSingleFileOffset = getCurSingleFileOffset(offset);
    curReader = HdfsReaderFactory.getHdfsReader(readerType, systemStreamPartition);
    curReader.open(filePaths.get(curFileIndex), curSingleFileOffset);
  }
Generate the offset based on file index and offset within single file
@param fileIndex index of the file
@param singleFileOffset offset within single file
@return the complete offset
samza-hdfs/src/main/java/org/apache/samza/system/hdfs/reader/MultiFileHdfsReader.java