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
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 ClassesModifier and TypeClassDescriptionstatic enumAllow different behaviors when an existing output file is seen. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Fileprotected final RollingFileManagerBase.ExistingFilePolicyprotected ExpirationManager<String>protected static final booleanprotected final ByteBufferprotected final com.fishlib.io.logger.Loggerprotected FileChannel -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close this ChannelManager.voidflush()Flush this ChannelManager.For ChannelManager implementations that don't support dynamic column partition determination, the channel is based on pre-determined criteria.protected FileChannelinitChannel(long now) protected booleanprotected StringmakeFilename(String value) Construct the complete filename using the changing part passed in.protected FileChannelprotected voidWrite 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
-