Package io.debezium.connector.cassandra
Class AbstractProcessor
- java.lang.Object
-
- io.debezium.connector.cassandra.AbstractProcessor
-
- Direct Known Subclasses:
CommitLogPostProcessor,CommitLogProcessor,QueueProcessor,SnapshotProcessor
public abstract class AbstractProcessor extends Object
An abstract processor designed to be a convenient superclass for all concrete processors for Cassandra connector task. The class handles concurrency control for starting and stopping the processor.
-
-
Constructor Summary
Constructors Constructor Description AbstractProcessor(String name, Duration delay)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddestroy()Override destroy to clean up resources after stopping the processorStringgetName()voidinitialize()Override initialize to initialize resources before starting the processorbooleanisRunning()abstract voidprocess()The actual work the processor is doing.voidstart()voidstop()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
name
private final String name
-
delayMs
private final long delayMs
-
running
private boolean running
-
-
Method Detail
-
process
public abstract void process() throws InterruptedException, IOExceptionThe actual work the processor is doing. This method will be executed in a while loop until processor stops or encounters exception.- Throws:
InterruptedExceptionIOException
-
initialize
public void initialize() throws ExceptionOverride initialize to initialize resources before starting the processor- Throws:
Exception
-
destroy
public void destroy() throws ExceptionOverride destroy to clean up resources after stopping the processor- Throws:
Exception
-
isRunning
public boolean isRunning()
-
stop
public final void stop()
-
getName
public String getName()
-
-