Package io.debezium.connector.cassandra
Class QueueProcessor
- java.lang.Object
-
- io.debezium.connector.cassandra.AbstractProcessor
-
- io.debezium.connector.cassandra.QueueProcessor
-
public class QueueProcessor extends AbstractProcessor
A thread that constantly polls records from the queue and emit them to Kafka via the KafkaRecordEmitter. The processor is also responsible for marking the offset to file and deleting the commit log files.
-
-
Field Summary
Fields Modifier and Type Field Description static StringARCHIVE_FOLDERprivate StringcommitLogRelocationDirprivate Set<String>erroneousCommitLogsstatic StringERROR_FOLDERprivate KafkaRecordEmitterkafkaRecordEmitterprivate static org.slf4j.LoggerLOGGERprivate static StringNAME_PREFIXprivate io.debezium.connector.base.ChangeEventQueue<Event>queue
-
Constructor Summary
Constructors Constructor Description QueueProcessor(CassandraConnectorContext context, int index)QueueProcessor(CassandraConnectorContext context, int index, KafkaRecordEmitter emitter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Override destroy to clean up resources after stopping the processorvoidinitialize()Override initialize to initialize resources before starting the processorvoidprocess()The actual work the processor is doing.private voidprocessEvent(Event event)-
Methods inherited from class io.debezium.connector.cassandra.AbstractProcessor
getName, isRunning, start, stop
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
queue
private final io.debezium.connector.base.ChangeEventQueue<Event> queue
-
kafkaRecordEmitter
private final KafkaRecordEmitter kafkaRecordEmitter
-
commitLogRelocationDir
private final String commitLogRelocationDir
-
NAME_PREFIX
private static final String NAME_PREFIX
- See Also:
- Constant Field Values
-
ARCHIVE_FOLDER
public static final String ARCHIVE_FOLDER
- See Also:
- Constant Field Values
-
ERROR_FOLDER
public static final String ERROR_FOLDER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
QueueProcessor
public QueueProcessor(CassandraConnectorContext context, int index)
-
QueueProcessor
QueueProcessor(CassandraConnectorContext context, int index, KafkaRecordEmitter emitter)
-
-
Method Detail
-
process
public void process() throws InterruptedExceptionDescription copied from class:AbstractProcessorThe actual work the processor is doing. This method will be executed in a while loop until processor stops or encounters exception.- Specified by:
processin classAbstractProcessor- Throws:
InterruptedException
-
initialize
public void initialize() throws ExceptionDescription copied from class:AbstractProcessorOverride initialize to initialize resources before starting the processor- Overrides:
initializein classAbstractProcessor- Throws:
Exception
-
destroy
public void destroy()
Description copied from class:AbstractProcessorOverride destroy to clean up resources after stopping the processor- Overrides:
destroyin classAbstractProcessor
-
processEvent
private void processEvent(Event event)
-
-