public byte[] read() throws IOException {
    HBaseProtos.RotateFileData[] datas = new HBaseProtos.RotateFileData[2];
    for (int i = 0; i < 2; i++) {
      try {
        datas[i] = read(files[i]);
      } catch (FileNotFoundException e) {
        LOG.debug("file {} does not exist", files[i], e);
      } catch (EOFException e) {
        LOG.debug("file {} is incomplete", files[i], e);
      }
    }
    int winnerIndex = select(datas);
    nextFile = 1 - winnerIndex;
    if (datas[winnerIndex] != null) {
      prevTimestamp = datas[winnerIndex].getTimestamp();
      return datas[winnerIndex].getData().toByteArray();
    } else {
      return null;
    }
  }
Reads the content of the rotate file by selecting the winner file based on the timestamp of the
data inside the files. It reads the content of both files and selects the one with the latest
timestamp as the winner. If a file is incomplete or does not exist, it logs the error and moves
on to the next file. It returns the content of the winner file as a byte array. If none of the
files have valid data, it returns null.
@return a byte array containing the data from the winner file, or null if no valid data is
        found.
@throws IOException if an error occurs while reading the files.
hbase-client/src/main/java/org/apache/hadoop/hbase/util/RotateFile.java