Package com.illumon.iris.binarystore
Class RollingFileManager
java.lang.Object
com.illumon.iris.binarystore.RollingFileManagerBase
com.illumon.iris.binarystore.RollingFileManager
- All Implemented Interfaces:
ChannelManager
,ChannelManagerStandard
public class RollingFileManager extends RollingFileManagerBase
This class maintains the file channels, with the appropriate roll interval for BinaryStoreWriters.
Each call to
RollingFileManagerBase.getChannel()
evaluates the current time, and might re-initialize the channel.
This class adds a time suffix to the configured location and file prefix.
For example,
"/db/TempFiles/irisadmin/logs", "DbInternal.UpdatePerformanceLog.localhost.bin.2018-04-16."
to specify the log directory and file prefix
or
"/db/TempFiles/irisadmin/logs/DbInternal.UpdatePerformanceLog.localhost.bin.2018-04-16."
to specify the directory and prefix together.-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.binarystore.RollingFileManagerBase
RollingFileManagerBase.ExistingFilePolicy
-
Field Summary
Fields inherited from class com.illumon.iris.binarystore.RollingFileManagerBase
baseDir, existingFilePolicy, expiration, FORCE_BEFORE_CLOSE, headerBuffer, log, writeChannel
-
Constructor Summary
Constructors Constructor Description RollingFileManager(com.fishlib.io.logger.Logger log, String baseDirName, String filenamePrefix, ByteBuffer headerBuffer, RollingFileManagerBase.ExistingFilePolicy existingFilePolicy, ExpirationManager<String> expirationManager)
RollingFileManager(com.fishlib.io.logger.Logger log, String baseDirName, String filenamePrefix, ByteBuffer headerBuffer, DateFormat rollFormat, RollingFileManagerBase.ExistingFilePolicy existingFilePolicy)
Create a ChannelManager that will change files on the hour.RollingFileManager(String basePath, ByteBuffer headerBuffer, DateFormat rollFormat, RollingFileManagerBase.ExistingFilePolicy existingFilePolicy, com.fishlib.io.logger.Logger log)
-
Method Summary
Modifier and Type Method Description protected String
makeFilename(String value)
Construct the complete filename using the changing part passed in.Methods inherited from class com.illumon.iris.binarystore.RollingFileManagerBase
close, flush, getChannel, initChannel, isChannelValid, reopenChannel, writeHeader
-
Constructor Details
-
RollingFileManager
public RollingFileManager(@NotNull com.fishlib.io.logger.Logger log, @NotNull String baseDirName, @NotNull String filenamePrefix, @NotNull ByteBuffer headerBuffer, @Nullable DateFormat rollFormat, @NotNull RollingFileManagerBase.ExistingFilePolicy existingFilePolicy)Create a ChannelManager that will change files on the hour.- Parameters:
log
- the LoggerbaseDirName
- log files will be placed in this directoryfilenamePrefix
- log files will begin with this prefix and end with the time according to rollFormatheaderBuffer
- this buffer will be written to all new filesrollFormat
- the current time will be formatted according to this formatterexistingFilePolicy
- determines how existing files will be treated
-
RollingFileManager
public RollingFileManager(@NotNull com.fishlib.io.logger.Logger log, @NotNull String baseDirName, @NotNull String filenamePrefix, @NotNull ByteBuffer headerBuffer, @NotNull RollingFileManagerBase.ExistingFilePolicy existingFilePolicy, @NotNull ExpirationManager<String> expirationManager) -
RollingFileManager
@Deprecated public RollingFileManager(String basePath, ByteBuffer headerBuffer, DateFormat rollFormat, RollingFileManagerBase.ExistingFilePolicy existingFilePolicy, com.fishlib.io.logger.Logger log)Deprecated.Translating constructor for backward compatibility.
-
-
Method Details
-
makeFilename
Description copied from class:RollingFileManagerBase
Construct the complete filename using the changing part passed in.- Overrides:
makeFilename
in classRollingFileManagerBase
- Parameters:
value
- the changing portion of the filename- Returns:
- the filename, possibly combining other data with the value
-