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 enum
Allow different behaviors when an existing output file is seen. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final File
protected final RollingFileManagerBase.ExistingFilePolicy
protected ExpirationManager<String>
protected static final boolean
protected final ByteBuffer
protected final com.fishlib.io.logger.Logger
protected FileChannel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close this ChannelManager.void
flush()
Flush this ChannelManager.For ChannelManager implementations that don't support dynamic column partition determination, the channel is based on pre-determined criteria.protected FileChannel
initChannel
(long now) protected boolean
protected String
makeFilename
(String value) Construct the complete filename using the changing part passed in.protected FileChannel
protected void
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:ChannelManagerStandard
For 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:
getChannel
in 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:ChannelManager
Close 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:
close
in interfaceChannelManager
- Throws:
IOException
- from the close operations
-
flush
Description copied from interface:ChannelManager
Flush 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:
flush
in 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
-