Class LogAggregatorServiceBinaryStoreWriterFactory

java.lang.Object
com.illumon.intradaylogger.IntradayLogger.TableWriterFactoryImpl
com.illumon.iris.db.v2.logaggregator.LogAggregatorServiceBinaryStoreWriterFactory
All Implemented Interfaces:
IntradayLogger.TableWriterFactory

public final class LogAggregatorServiceBinaryStoreWriterFactory extends IntradayLogger.TableWriterFactoryImpl
Creates a TableWriter that will connect to a Log Aggregator Service. Rows are written to network and not to disk.
  • Method Details

    • dynamicColumnPartitionFactory

      public static LogAggregatorServiceBinaryStoreWriterFactory dynamicColumnPartitionFactory(@NotNull @NotNull com.fishlib.io.logger.Logger log, @NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull TableIdentifier.NamespaceSet namespaceSet, @NotNull @NotNull String internalPartition, @Nullable @Nullable TokenFactoryFactory tokenAuthenticationManager)
      Construct an instance without a column partition value (for dynamic column partition selection).
      Parameters:
      log - the logger
      namespace - the namespace for the table
      tableName - the tableName to which this will write
      namespaceSet - the NamespaceSet
      internalPartition - the internal partition for the location
      tokenAuthenticationManager - source for authentication tokens. If null, use AuthenticationClientManager.getDefault().
      Returns:
      a LogAggregatorServiceBinaryStoreWriterFactory configured for logger-generated dynamic partitions
    • currentDatePartitionFactory

      public static LogAggregatorServiceBinaryStoreWriterFactory currentDatePartitionFactory(@NotNull @NotNull com.fishlib.io.logger.Logger log, @NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull TableIdentifier.NamespaceSet namespaceSet, @NotNull @NotNull String internalPartition, @Nullable @Nullable TokenFactoryFactory tokenAuthenticationManager)
      Construct a LogAggregatorServiceBinaryStoreWriterFactory instance that will create a column partition value based on the current time, and will cycle LogAggregatorService connections if the date changes.
      Parameters:
      log - the logger
      namespace - the namespace for the table
      tableName - the tableName to which this will write
      namespaceSet - the NamespaceSet
      internalPartition - the internal partition for the location
      tokenAuthenticationManager - source for authentication tokens. If null, use AuthenticationClientManager.getDefault().
      Returns:
      a LogAggregatorServiceBinaryStoreWriterFactory configure to use the current date as the partition
    • fixedColumnPartitionFactory

      public static LogAggregatorServiceBinaryStoreWriterFactory fixedColumnPartitionFactory(@NotNull @NotNull com.fishlib.io.logger.Logger log, @NotNull @NotNull String namespace, @NotNull @NotNull String tableName, @NotNull TableIdentifier.NamespaceSet namespaceSet, @NotNull @NotNull String internalPartition, @NotNull @NotNull String columnPartition, @Nullable @Nullable TokenFactoryFactory tokenAuthenticationManager)
      Construct a LogAggregatorServiceBinaryStoreWriterFactory instance that uses the specified column partition value.
      Parameters:
      log - the logger
      namespace - the namespace for the table
      tableName - the tableName to which this will write
      namespaceSet - the NamespaceSet
      internalPartition - the internal partition for the location
      columnPartition - the column partition value
      tokenAuthenticationManager - source for authentication tokens. If null, use AuthenticationClientManager.getDefault().
      Returns:
      a LogAggregatorServiceBinaryStoreWriterFactory using a fixed column partition
    • buildWriter

      public TableWriter buildWriter(String[] columnNames, SupportedType[] intradayTypes, Class[] columnTypes_notUsed, Object[] typeMetadata, Map<String,Object> constantColumnValues, int applicationVersion) throws IOException
      Description copied from interface: IntradayLogger.TableWriterFactory
      Creates a new table writer.
      Parameters:
      columnNames - column names
      intradayTypes - column types for the intraday logger
      columnTypes_notUsed - column types for the table
      typeMetadata - metadata for encoding and decoding a type
      constantColumnValues - values that do not change for each row
      applicationVersion - application version number used to select listener for reading this file
      Returns:
      new table writer
      Throws:
      IOException - problem creating the table writer
    • makeDynamicBufferWriter

      public LogAggregatorWriterMultiPartition makeDynamicBufferWriter(@NotNull @NotNull ByteBuffer header) throws IOException
      Builds a MultiPartitionWriter, backed by the LAS, for use with a V2 logger that uses dynamic partitions.
      Parameters:
      header -
      Returns:
      a MultiPartitionWriter backed by the LAS
      Throws:
      IOException - if the buffer writer could not be created
    • makeSingleBufferWriter

      public LogAggregatorWriterStandard makeSingleBufferWriter(@NotNull @NotNull ByteBuffer header) throws IOException
      Builds a SinglePartitionWriter, backed by the LAS, for use with a V2 logger that does not use dynamic partitions.
      Parameters:
      header -
      Returns:
      a SinglePartitionWriter backed by the LAS
      Throws:
      IOException - if the buffer writer could not be created
    • supportsDynamicPartitioning

      public boolean supportsDynamicPartitioning()
      Description copied from interface: IntradayLogger.TableWriterFactory
      This must indicate whether or not the TableWriter instances supplied by this factory support dynamic column partition values. Support of dynamic column partitions means that the underlying writers must be able to determine the column partition values based on each supplied row.
      Returns:
      true if the factory supports dynamic column partitions, false otherwise.