private static Pair<Path, Long> generateWAL() throws Exception {
    Path path = UTIL.getDataTestDir("wal");
    ProtobufLogWriter writer = new ProtobufLogWriter();
    writer.init(FS, path, UTIL.getConfiguration(), false, FS.getDefaultBlockSize(path), null);
    for (int i = 0; i < Byte.MAX_VALUE; i++) {
      WALEdit edit = new WALEdit();
      WALEditInternalHelper.addExtendedCell(edit,
        ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setType(Cell.Type.Put)
          .setRow(Bytes.toBytes(i)).setFamily(FAMILY).setQualifier(Bytes.toBytes("qualifier-" + i))
          .setValue(Bytes.toBytes("v-" + i)).build());
      writer.append(new WAL.Entry(new WALKeyImpl(REGION_INFO.getEncodedNameAsBytes(), TABLE_NAME,
        EnvironmentEdgeManager.currentTime(), MVCC, SCOPE), edit));
    }

    WALEdit edit2 = new WALEdit();
    WALEditInternalHelper.addExtendedCell(edit2,
      ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setType(Cell.Type.Put)
        .setRow(Bytes.toBytes(-1)).setFamily(FAMILY).setQualifier(Bytes.toBytes("qualifier"))
        .setValue(Bytes.toBytes("vv")).build());
    WALEditInternalHelper.addExtendedCell(edit2,
      ExtendedCellBuilderFactory.create(CellBuilderType.SHALLOW_COPY).setType(Cell.Type.Put)
        .setRow(Bytes.toBytes(-1)).setFamily(FAMILY).setQualifier(Bytes.toBytes("qualifier-1"))
        .setValue(Bytes.toBytes("vvv")).build());
    writer.append(new WAL.Entry(new WALKeyImpl(REGION_INFO.getEncodedNameAsBytes(), TABLE_NAME,
      EnvironmentEdgeManager.currentTime(), MVCC, SCOPE), edit2));
    writer.sync(false);
    long offset = writer.getSyncedLength();
    writer.close();
    return Pair.newPair(path, offset);
  }
Enable compression and reset the WALEntryStream while reading in ReplicationSourceWALReader.
<p/>
This is used to confirm that we can work well when hitting EOFException in the middle when
reading a WAL entry, when compression is enabled. See HBASE-27621 for more details.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStreamCompressionReset.java