Interface IntradayLogger

All Known Subinterfaces:
AuditEventLogFormat1Interface, EightArgLogger<T1,T2,T3,T4,T5,T6,T7,T8>, FiveArgLogger<T1,T2,T3,T4,T5>, FourArgLogger<T1,T2,T3,T4>, MultiArgLogger, OneArgLogger<T1>, SevenArgLogger<T1,T2,T3,T4,T5,T6,T7>, SixArgLogger<T1,T2,T3,T4,T5,T6>, SQLReplicationLogger, TableLogger, ThreeArgLogger<T1,T2,T3>, TwoArgLogger<T1,T2>
All Known Implementing Classes:
AuditEventLogFormat3Logger, BarrageSnapshotPerformanceLogger, BarrageSubscriptionPerformanceLogger, BlackScholesFormat1Logger, IntradayLoggerImpl2, ProcessEventLogFormat2Logger, ProcessEventLogIndexLogger, ProcessMetricsFormat1Logger, ProcessTelemetryFormat1Logger, ProcessTelemetryIndexLogger, QueryOperationPerformanceLogCommunityIndexFormat1Logger, QueryOperationPerformanceLogCoreV2IndexFormat1Logger, QueryOperationPerformanceLogFormat3Logger, QueryOperationPerformanceLogIndexLogger, QueryPerformanceLogCommunityIndexFormat1Logger, QueryPerformanceLogCoreV2IndexFormat1Logger, QueryPerformanceLogFormat2Logger, QueryPerformanceLogIndexLogger, ServerStateLogCommunityIndexFormat1Logger, ServerStateLogCoreV2IndexFormat1Logger, UpdatePerformanceAncestorsIndexFormat1Logger, UpdatePerformanceLogCommunityIndexFormat1Logger, UpdatePerformanceLogCoreV2IndexFormat1Logger, UpdatePerformanceLogFormat4Logger, UpdatePerformanceLogIndexLogger, WorkspaceDataFormat1Logger

public interface IntradayLogger
All generated IntradayLoggers implement this interface. If no interface is specified in the schema file, the IntradayLogger will also implement com.illumon.intradaylogger.OneArgLogger, com.illumon.intradaylogger.TwoArgLogger, ..., or com.illumon.intradaylogger.MultiArgLogger which provide an actual log() call.
  • Field Details

    • DEFAULT_INTRADAY_LOGGER_FLAGS

      static final Row.Flags DEFAULT_INTRADAY_LOGGER_FLAGS
  • Method Details

    • init

      void init(String path, int queueSize) throws IOException
      Throws:
      IOException
    • init

      void init(String path, int queueSize, Thread sharedWriterThread) throws IOException
      Throws:
      IOException
    • init

      void init(IntradayLogger.TableWriterFactory tableWriterBuilder, int queueSize) throws IOException
      Throws:
      IOException
    • init

      void init(IntradayLogger.TableWriterFactory tableWriterBuilder, int queueSize, Thread sharedWriterThread) throws IOException
      Throws:
      IOException
    • setOverflowThrottle

      default void setOverflowThrottle(long throttleMillis)
      If the throttle is set to >= 0, then a pool and queue will be used that allows overflow. The overflowing will be throttled by a wait of this amount of time.
      Parameters:
      throttleMillis - milliseconds to wait before allocating new setters
    • tryWrite

      boolean tryWrite() throws IOException

      Attempt to write a single row to the TableWriter created using the IntradayLogger.TableWriterFactory.

      Implementation Note: "written" simply means that the TableWriter accepted the write request. It may internally buffer the row.

      Returns:
      true if a row was written, false otherwise.
      Throws:
      IOException - if an error occurred during the write.
    • getWriterThread

      Thread getWriterThread()
      Get the Thread that is responsible for writing data from this logger, i.e. the unique thread assigned to call tryWrite(). This will return null if invoked before one of the init(java.lang.String, int) overloads.
      Returns:
      The writer Thread for this logger, or null if init(java.lang.String, int) hasn't been invoked yet
    • waitDone

      void waitDone()
      Block until output queue is empty or logger is closed.
    • waitDone

      boolean waitDone(long timeoutMillis)
      Block until output queue is empty, logger is closed, or timeout expires.
      Parameters:
      timeoutMillis - How long to wait, in milliseconds
      Returns:
      True if the output queue is empty and the logger closed, else false (e.g. because the timeout expired)
    • isClosed

      boolean isClosed()
    • close

      void close() throws IOException
      Close the logger and any writer in use. Users should quiesce all logging threads and invoke shutdown() first in order to guarantee that all pending rows have been written to storage.
      Throws:
      IOException - if an error occurred closing the logger.
    • shutdown

      void shutdown()
      Write all enqueued elements to the TableWriter and prevent further writes. This should be invoked before close(). This must not be invoked if any threads might still try to log additional items.
    • usingDynamicPartitioning

      default boolean usingDynamicPartitioning()
      This indicates whether or not the IntradayLogger instance is currently using row-based column partition selection. An instance may support row-based partition selection but not be using it based on its initialization. This method will be used by generated loggers to know whether to set each row's column partition value based on the defined formula or method.
      Returns:
      true if the logger is using row-based column partition selection
    • getLogFormat

      default int getLogFormat()
      Get the log format (also called "application version") for this logger. May be used, for example, to segment log streams into multiple partitions by log format as part of a rollout strategy for new schema versions.
      Returns:
      The log format number