Class SimpleDataImportStreamProcessor

All Implemented Interfaces:
DataImportProcessorBase

public class SimpleDataImportStreamProcessor
extends DataImportStreamProcessor
  • Method Details

    • make

      public static SimpleDataImportStreamProcessor make​(@NotNull com.fishlib.io.sched.Scheduler scheduler, @NotNull com.fishlib.configuration.Configuration configuration, @NotNull com.fishlib.io.logger.Logger log, @NotNull String description, @NotNull FullTableLocationKey streamKey, @NotNull com.illumon.iris.db.tables.dataimport.logtailer.DataImportStreamProcessor.Directory streamProcessorDirectory, @NotNull LocalTableDataService tableDataService, @NotNull StringCacheProvider stringCacheProvider, @NotNull SchemaService schemaService, @NotNull Runnable closeCallback, @NotNull SimpleDataImportStreamProcessor.OnReject onReject)
      Factory method to create a new SimpleDataImportStreamProcessor
      Parameters:
      scheduler - The scheduler for the flush and commit tasks
      configuration - the configuration to use
      log - The log
      description - description of the data connection
      streamKey - Destination information
      streamProcessorDirectory - An object to lookup Processors based on table key.
      tableDataService - The table data service
      stringCacheProvider - The string cache provider
      schemaService - The schemaService
      closeCallback - callback to be invoked when the simple data stream is closed
      onReject - callback to be invoked if the simple data stream is rejected
      Returns:
      a new SimpleDataImportStreamProcessor
    • processData

      public void processData​(Runnable runnable)
      Call this with your runnable that processes data and writes to the table to ensure proper locking around the checkpointing and flushing.
      Parameters:
      runnable - a runnable that processes data for this stream
    • onInitialization

      protected boolean onInitialization()
    • close

      protected void close​(@NotNull String reason)
    • checkLiveness

      protected Boolean checkLiveness()
      Description copied from class: DataImportStreamProcessor
      Test "liveness" for this stream processor. checkLiveness will return one of three values:
      • true - the current connection is known to be live - the heartbeat succeeded
      • false - the current connection is dead - the heartbeat attempt threw an exception and the current channel has already been closed, or the liveness check timed out and the connection was killed
      • null - the connection state is unknown - e.g. the heartbeat timed out the connection could not be killed
      Specified by:
      checkLiveness in class DataImportStreamProcessor
      Returns:
      True if alive, false if not, null if uncertain
    • getDescription

      @NotNull protected String getDescription()
    • reject

      protected void reject​(@NotNull String reason, @NotNull Exception cause)