protected final boolean reachWALEditsStopOffset(long pos) {
    if (trailerPresent && pos > 0 && pos == walEditsStopOffset) {
      LOG.trace("Reached end of expected edits area at offset {}", pos);
      return true;
    } else {
      return false;
    }
  }
To check whether a trailer is present in a WAL, it seeks to position (fileLength -
PB_WAL_COMPLETE_MAGIC.size() - Bytes.SIZEOF_INT). It reads the int value to know the size of
the trailer, and checks whether the trailer is present at the end or not by comparing the last
PB_WAL_COMPLETE_MAGIC.size() bytes. In case trailer is not present, it returns false;
otherwise, sets the trailer and sets this.walEditsStopOffset variable up to the point just
before the trailer.
<p/>
The trailer is ignored in case:
<ul>
<li>fileLength is 0 or not correct (when file is under recovery, etc).
<li>the trailer size is negative.
</ul>
In case the trailer size > this.trailerMaxSize, it is read after a WARN message.
@return true if a valid trailer is present
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractProtobufWALReader.java