private static @Nullable DataInputStream createFSDataStream(File dataStorageRoot, final long currentEventOrdinal) {
    final File file = new File(dataStorageRoot, FS_STATE_FILE);
    try (InputStream fs = new FileInputStream(file)) {
      byte[] bytes = FileUtil.loadBytes(fs, (int)file.length());
      final DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes));
      final int version = in.readInt();
      if (version != BuildFSState.VERSION) {
        return null;
      }
      final long savedOrdinal = in.readLong();
      if (savedOrdinal + 1L != currentEventOrdinal) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Discarding FS data: savedOrdinal=" + savedOrdinal + "; currentEventOrdinal=" + currentEventOrdinal);
        }
        return null;
      }
      return in;
    }
    catch (FileNotFoundException ignored) {
    }
    catch (Throwable e) {
      LOG.error(e);
    }
    return null;
  }
private static @Nullable DataInputStream createFSDataStream(File dataStorageRoot, final long currentEventOrdinal)