Class SizeBasedRollingPolicy
- java.lang.Object
-
- net.morimekta.providence.mio.rolling.SizeBasedRollingPolicy
-
- All Implemented Interfaces:
RollingFileMessageWriter.RollingPolicy
public class SizeBasedRollingPolicy extends java.lang.Object implements RollingFileMessageWriter.RollingPolicy
A rolling policy that moves over to a new file whenever the current file reaches a threshold size.
-
-
Constructor Summary
Constructors Constructor Description SizeBasedRollingPolicy(java.io.File directory, long rollOnFileSizeInBytes, java.lang.String fileNameFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
maybeUpdateCurrentFile(RollingFileMessageWriter.CurrentFileUpdater onRollFile, boolean initialCall)
Maybe call the current file updater.
-
-
-
Method Detail
-
maybeUpdateCurrentFile
public void maybeUpdateCurrentFile(@Nonnull RollingFileMessageWriter.CurrentFileUpdater onRollFile, boolean initialCall) throws java.io.IOException
Description copied from interface:RollingFileMessageWriter.RollingPolicy
Maybe call the current file updater.- Specified by:
maybeUpdateCurrentFile
in interfaceRollingFileMessageWriter.RollingPolicy
- Parameters:
onRollFile
- The current file updater to call if the current file should roll over.initialCall
- If this is the initial call, and the current file updater should be called regardless.- Throws:
java.io.IOException
- If the file roll or update check failed.
-
-