Class SimpleDataImportStreamProcessor
java.lang.Object
com.illumon.iris.db.tables.dataimport.logtailer.DataImportProcessorBaseImpl
com.illumon.iris.db.tables.dataimport.logtailer.DataImportStreamProcessor
com.illumon.iris.db.tables.dataimport.logtailer.SimpleDataImportStreamProcessor
- All Implemented Interfaces:
DataImportProcessorBase
public class SimpleDataImportStreamProcessor extends DataImportStreamProcessor
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSimpleDataImportStreamProcessor.OnRejectAn object defined by the caller, capable of fulfillingreject(String, Exception)Nested classes/interfaces inherited from class com.illumon.iris.db.tables.dataimport.logtailer.DataImportStreamProcessor
DataImportStreamProcessor.Context -
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 protected BooleancheckLiveness()Test "liveness" for this stream processor.protected voidclose(String reason)protected StringgetDescription()static SimpleDataImportStreamProcessormake(com.fishlib.io.sched.Scheduler scheduler, com.fishlib.configuration.Configuration configuration, com.fishlib.io.logger.Logger log, String description, FullTableLocationKey streamKey, com.illumon.iris.db.tables.dataimport.logtailer.DataImportStreamProcessor.Directory streamProcessorDirectory, LocalTableDataService tableDataService, StringCacheProvider stringCacheProvider, SchemaService schemaService, Runnable closeCallback, SimpleDataImportStreamProcessor.OnReject onReject)Factory method to create a new SimpleDataImportStreamProcessorprotected booleanonInitialization()voidprocessData(Runnable runnable)Call this with your runnable that processes data and writes to the table to ensure proper locking around the checkpointing and flushing.protected voidreject(String reason, Exception cause)Methods inherited from class com.illumon.iris.db.tables.dataimport.logtailer.DataImportStreamProcessor
addPostCommitCallback, addPostPrepareCallback, initialize, shutdown, toStringMethods inherited from class com.illumon.iris.db.tables.dataimport.logtailer.DataImportProcessorBaseImpl
getLog, getLogPrefix
-
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 tasksconfiguration- the configuration to uselog- The logdescription- description of the data connectionstreamKey- Destination informationstreamProcessorDirectory- An object to lookup Processors based on table key.tableDataService- The table data servicestringCacheProvider- The string cache providerschemaService- The schemaServicecloseCallback- callback to be invoked when the simple data stream is closedonReject- callback to be invoked if the simple data stream is rejected- Returns:
- a new SimpleDataImportStreamProcessor
-
processData
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
-
checkLiveness
Description copied from class:DataImportStreamProcessorTest "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:
checkLivenessin classDataImportStreamProcessor- Returns:
- True if alive, false if not, null if uncertain
-
getDescription
-
reject
-