private static void runCompressionGzip(NativeIO nativeIO, Path oldFile) {
            try {
                Path gzippedFile = Paths.get(oldFile.toString() + ".gz");
                try (FileOutputStream fileOut = AtomicFileOutputStream.create(gzippedFile);
                     GZIPOutputStream compressor = new GZIPOutputStream(fileOut, 0x100000);
                     FileInputStream inputStream = new FileInputStream(oldFile.toFile())) {
                    pageFriendlyTransfer(nativeIO, compressor, fileOut.getFD(), inputStream, 0x400000);
                    compressor.finish();
                    compressor.flush();
                }
                Files.delete(oldFile);
                nativeIO.dropFileFromCache(gzippedFile.toFile());
            } catch (IOException e) {
                logger.log(Level.WARNING, "Failed to compress log file with gzip: " + 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