private static void updateStreamEndOffsets(LogCache.LogCacheBlock cacheBlock, Map<Long, Long> streamEndOffsets) {
        cacheBlock.records().forEach((streamId, records) -> {
            if (!records.isEmpty()) {
                streamEndOffsets.put(streamId, records.get(records.size() - 1).getLastOffset());
            }
        });
    }
Recover WAL, upload WAL to S3 and close opening streams.
Note: {@link WriteAheadLog#start()} should be called before this method.
s3stream/src/main/java/com/automq/stream/s3/S3Storage.java