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.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DataImportStreamProcessor.Context
A context object to pass commonly used information down to individualprocessors
-
Field Summary
Fields inherited from class com.illumon.iris.db.tables.dataimport.logtailer.DataImportProcessorBaseImpl
CHECKPOINT_INTERVAL_MILLIS_SUFFIX, dataStreamProcessorDirectory, DISP_DEFAULT_PREFIX, DISP_PREFIX, FLUSH_INTERVAL_SUFFIX, log, logPrefix, MAX_SHUTDOWN_DELAY_MILLIS_SUFFIX, PROFILING_LEVEL_SUFFIX, schemaService
-
Method Summary
Modifier and Type Method Description boolean
addPostCommitCallback(Runnable callback)
Add a new Runnable that should be invoked whenever a checkpoint has been committed.boolean
addPostPrepareCallback(Runnable callback)
Add a new Runnable that should be invoked whenever a checkpoint has been prepared.protected abstract Boolean
checkLiveness()
Test "liveness" for this stream processor.DataImportStreamProcessor.Context
initialize()
Initialize this stream processor, and provide a Context for its statevoid
shutdown()
Perform any actions needed to terminate this DataImportProcessor.String
toString()
Methods inherited from class com.illumon.iris.db.tables.dataimport.logtailer.DataImportProcessorBaseImpl
getLog, getLogPrefix
-
Method Details
-
checkLiveness
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 waitingTimeoutException
- if the stream processor doesn't go to DONE state within the configured time limit
-
addPostPrepareCallback
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
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
-
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.
-