private Path generateBrokenWALFile(byte[] content, int length) throws IOException {
    Path walFile = UTIL.getDataTestDir("wal-" + length);
    try (FSDataOutputStream out = FS.create(walFile)) {
      out.write(content, 0, length);
    }
    return walFile;
  }
In this test, we write a small WAL file first, and then generate partial WAL file which length is
in range [0, fileLength)(we test all the possible length in the range), to see if we can
successfully get the completed entries, and also get an EOF at the end.
<p/>
It is very important to make sure 3 things:
<ul>
<li>We do not get incorrect entries. Otherwise there will be data corruption.</li>
<li>We can get all the completed entries, i.e, we do not miss some data. Otherwise there will be
data loss.</li>
<li>We will get an EOF finally, instead of a general IOException. Otherwise the split or
replication will be stuck.</li>
</ul>
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestParsePartialWALFile.java