Package com.illumon.iris.binarystore
Class RollingFileManagerBase
java.lang.Object
com.illumon.iris.binarystore.RollingFileManagerBase
- All Implemented Interfaces:
ChannelManager,ChannelManagerStandard
- Direct Known Subclasses:
RollingFileManager,RollingFileManagerWithDateColumnPartition,RollingFileManagerWithSpecifiedColumnPartition
public abstract class RollingFileManagerBase extends Object implements ChannelManagerStandard
Base class for rolling files on a time interval.
Extending classes will supply logic for naming files using the expiration managers.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRollingFileManagerBase.ExistingFilePolicyAllow different behaviors when an existing output file is seen. -
Field Summary
Fields Modifier and Type Field Description protected FilebaseDirprotected RollingFileManagerBase.ExistingFilePolicyexistingFilePolicyprotected ExpirationManager<String>expirationprotected static booleanFORCE_BEFORE_CLOSEprotected ByteBufferheaderBufferprotected com.fishlib.io.logger.Loggerlogprotected FileChannelwriteChannel -
Method Summary
Modifier and Type Method Description voidclose()Close this ChannelManager.voidflush()Flush this ChannelManager.FileChannelgetChannel()For ChannelManager implementations that don't support dynamic column partition determination, the channel is based on pre-determined criteria.protected FileChannelinitChannel(long now)protected booleanisChannelValid()protected StringmakeFilename(String value)Construct the complete filename using the changing part passed in.protected FileChannelreopenChannel()protected voidwriteHeader()Write the binary file header to a new file.
-
Field Details
-
FORCE_BEFORE_CLOSE
protected static final boolean FORCE_BEFORE_CLOSE -
log
protected final com.fishlib.io.logger.Logger log -
headerBuffer
-
existingFilePolicy
-
expiration
-
baseDir
-
writeChannel
-
-
Method Details
-
getChannel
Description copied from interface:ChannelManagerStandardFor ChannelManager implementations that don't support dynamic column partition determination, the channel is based on pre-determined criteria. The channel may still change, but not dynamically based on data that the ChannelManager user determines.- Specified by:
getChannelin interfaceChannelManagerStandard- Returns:
- a non-null, open
GatheringByteChannel - Throws:
IOException- if the call encounters an error
-
initChannel
- Throws:
IOException
-
reopenChannel
- Throws:
IOException
-
close
Description copied from interface:ChannelManagerClose this ChannelManager. If the implementation supports multiple channels, an attempt will be made to close all channels. If an IOException occurs on one or more channels, the first one will be rethrown, but the operation will still be attempted on all remaining channels. If an exception occurs that is not an IOException, that exception will be thrown and operations on remaining channels may not be attempted.- Specified by:
closein interfaceChannelManager- Throws:
IOException- from the close operations
-
flush
Description copied from interface:ChannelManagerFlush this ChannelManager. If the implementation supports multiple channels, all channels will be flushed. If an IOException occurs on one or more channels, the first one will be rethrown, but the operation will still be attempted on all remaining channels. If an exception occurs that is not an IOException, that exception will be thrown and operations on remaining channels may not be attempted.- Specified by:
flushin interfaceChannelManager- Throws:
IOException- from the close operations
-
isChannelValid
protected boolean isChannelValid() -
writeHeader
Write the binary file header to a new file.- Throws:
IOException
-
makeFilename
Construct the complete filename using the changing part passed in.- Parameters:
value- the changing portion of the filename- Returns:
- the filename, possibly combining other data with the value
-