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.
  • Field Details

  • Method Details

    • getChannel

      public FileChannel getChannel() throws IOException
      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 interface ChannelManagerStandard
      Returns:
      a non-null, open GatheringByteChannel
      Throws:
      IOException - if the call encounters an error
    • initChannel

      protected FileChannel initChannel(long now) throws IOException
      Throws:
      IOException
    • reopenChannel

      protected FileChannel reopenChannel() throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      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 interface ChannelManager
      Throws:
      IOException - from the close operations
    • flush

      public void flush() throws IOException
      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 interface ChannelManager
      Throws:
      IOException - from the close operations
    • isChannelValid

      protected boolean isChannelValid()
    • writeHeader

      protected void writeHeader() throws IOException
      Write the binary file header to a new file.
      Throws:
      IOException
    • makeFilename

      protected String makeFilename(String value)
      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