private List<Entry> readWALEntries(WALStreamReader reader, String wal) throws IOException {
    List<Entry> entries = new ArrayList<>();
    if (reader == null) {
      return entries;
    }
    long size = 0;
    for (;;) {
      Entry entry;
      try {
        entry = reader.next();
      } catch (EOFException e) {
        LOG.info("EOF while reading WAL entries from {}: {}, continuing", wal, e.toString());
        break;
      }
      if (entry == null) {
        break;
      }
      if (filter(entry)) {
        entries.add(entry);
        size += entry.getEdit().heapSize();
        if (size > batchSize) {
          break;
        }
      }
    }
    return entries;
  }
This callable executed at RS side to replay sync replication wal.
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplaySyncReplicationWALCallable.java