Class DataImportStreamProcessor

java.lang.Object
com.illumon.iris.db.tables.dataimport.logtailer.DataImportProcessorBaseImpl
com.illumon.iris.db.tables.dataimport.logtailer.DataImportStreamProcessor
All Implemented Interfaces:
DataImportProcessorBase
Direct Known Subclasses:
DataImportChannelProcessor, SimpleDataImportStreamProcessor

public abstract class DataImportStreamProcessor
extends DataImportProcessorBaseImpl
Base class for streaming connections to the data import server.
  • Method Details

    • checkLiveness

      protected abstract Boolean checkLiveness() throws InterruptedException, TimeoutException
      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
      Returns:
      True if alive, false if not, null if uncertain
      Throws:
      InterruptedException - if the thread is interrupted while waiting
      TimeoutException - if the stream processor doesn't go to DONE state within the configured time limit
    • addPostPrepareCallback

      public boolean addPostPrepareCallback​(Runnable callback)
      Add a new Runnable that should be invoked whenever a checkpoint has been prepared.

      BIG RED LETTER NOTE: This will hold a lock on the processor the entire time it is executing. Any callbacks added here must be rapid and not create locks of their own or performance may be SEVERELY impacted.

      Parameters:
      callback - The Runnable to be invoked when the checkpoint has been prepared.
    • addPostCommitCallback

      public boolean addPostCommitCallback​(Runnable callback)
      Add a new Runnable that should be invoked whenever a checkpoint has been committed.

      BIG RED LETTER NOTE: This will hold a lock on the processor the entire time it is executing. Any callbacks added here must be rapid and not create locks of their own or performance may be SEVERELY impacted.

      Parameters:
      callback - The Runnable to be invoked whenever the checkpoint has been committed.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • initialize

      public DataImportStreamProcessor.Context initialize()
      Initialize this stream processor, and provide a Context for its state
      Returns:
      a DataImportStreamProcessor.Context for the current stream.
    • shutdown

      public void shutdown()
      Description copied from interface: DataImportProcessorBase
      Perform any actions needed to terminate this DataImportProcessor.