Class MultiPartitionFileManager

java.lang.Object
com.illumon.iris.binarystore.MultiPartitionFileManager
All Implemented Interfaces:
ChannelManager, ChannelManagerMultiPartition

public class MultiPartitionFileManager extends Object implements ChannelManagerMultiPartition
ChannelManager implementation for binary log files, using dynamic column partition selection. This implementation creates binary log files in the format yyyy-MM-dd-date/timestamp based on the supplied column partition values.
  • Constructor Details

    • MultiPartitionFileManager

      public MultiPartitionFileManager(@NotNull String baseDirName, @NotNull String namespace, @NotNull String tableName, @NotNull TableIdentifier.NamespaceSet namespaceSet, @NotNull String internalPartition, ByteBuffer headerBuffer, com.fishlib.io.logger.Logger log)
      Create a dynamic binary store writer which determines the destination file based on each row's column partition value.
      Parameters:
      baseDirName - the base directory name
      namespace - the namespace
      tableName - the table name
      namespaceSet - the namespace set
      internalPartition - the internal partition
      headerBuffer - the header buffer to be put at the beginning of each new file
      log - Logger instance
  • Method Details

    • close

      public void close() throws IOException
      Attempt to close all the partitions (files) managed by this MultiPartitionFileManager. 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 will not be attempted.
      Specified by:
      close in interface ChannelManager
      Throws:
      IOException - from the close calls
    • flush

      public void flush()
      This flush implementation is a no-op.
      Specified by:
      flush in interface ChannelManager
    • getChannel

      public GatheringByteChannel getChannel(@NotNull String columnPartitionValue) throws IOException
      Description copied from interface: ChannelManagerMultiPartition
      For ChannelManager implementations that support dynamic column partition determination, the channel will be based on a partition determined by the caller. Current implementations determine the value for each entry of data being sent.
      Specified by:
      getChannel in interface ChannelManagerMultiPartition
      Parameters:
      columnPartitionValue - the row's column partition value
      Returns:
      a non-null, open GatheringByteChannel
      Throws:
      IOException - if the call encounters an error