code: @Deprecated
    public static long readRecordCount (FileSystem fs, Path dir) throws IOException {
      State state = loadState(fs, dir);
  
      if (!state.contains(CompactionSlaEventHelper.RECORD_COUNT_TOTAL)) {
        if (fs.exists(new Path (dir, RECORD_COUNT_FILE))){
          try (BufferedReader br = new BufferedReader(new InputStreamReader(fs.open (new Path (dir, RECORD_COUNT_FILE)), Charsets.UTF_8))) {
            long count = Long.parseLong(br.readLine());
            return count;
          }
        } else {
          return 0;
        }
      } else {
        return Long.parseLong(state.getProp(CompactionSlaEventHelper.RECORD_COUNT_TOTAL));
      }
    }
docs: Read record count from a specific directory.
  File name is {@link InputRecordCountHelper#STATE_FILE}
  @param fs  file system in use
  @param dir directory where a state file is located
  @return record count