private static void runCompressionZstd(NativeIO nativeIO, Path oldFile) {
            try {
                Path compressedFile = Paths.get(oldFile.toString() + ".zst");
                int bufferSize = 2*1024*1024;
                try (FileOutputStream fileOut = AtomicFileOutputStream.create(compressedFile);
                     ZstdOutputStream out = new ZstdOutputStream(fileOut, bufferSize);
                     FileInputStream in = new FileInputStream(oldFile.toFile())) {
                    pageFriendlyTransfer(nativeIO, out, fileOut.getFD(), in, bufferSize);
                    out.flush();
                }
                Files.delete(oldFile);
                nativeIO.dropFileFromCache(compressedFile.toFile());
            } catch (IOException e) {
                logger.log(Level.WARNING, "Failed to compress log file with zstd: " + oldFile, e);
            } finally {
                nativeIO.dropFileFromCache(oldFile.toFile());
            }
        }
Find next rotation after specified time.

@param now the specified time; if zero, current time is used.
@return the next rotation time
container-core/src/main/java/com/yahoo/container/logging/LogFileHandler.java