public static long writeTrailer(FSDataOutputStream stream, ProcedureStoreTracker tracker)
    throws IOException {
    long offset = stream.getPos();

    // Write EOF Entry
    ProcedureWALEntry.newBuilder().setType(ProcedureWALEntry.Type.PROCEDURE_WAL_EOF).build()
      .writeDelimitedTo(stream);

    // Write Tracker
    tracker.toProto().writeDelimitedTo(stream);

    stream.write(TRAILER_VERSION);
    StreamUtils.writeLong(stream, TRAILER_MAGIC);
    StreamUtils.writeLong(stream, offset);
    return stream.getPos() - offset;
  }
Load all the procedures in these ProcedureWALFiles, and rebuild the given {@code tracker} if
needed, i.e, the {@code tracker} is a partial one.
<p/>
The method in the give {@code loader} will be called at the end after we load all the
procedures and construct the hierarchy.
<p/>
And we will call the {@link ProcedureStoreTracker#resetModified()} method for the given
{@code tracker} before returning, as it will be used to track the next proc wal file's modified
procedures.
hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2/store/wal/ProcedureWALFormat.java