public class CommitLogProcessor extends AbstractProcessor
CommitLogProcessor is used to process CommitLog in CDC directory.
Upon readCommitLog, it processes the entire CommitLog specified in the CassandraConnectorConfig
and converts each row change in the commit log into a Record,
and then emit the log via a KafkaRecordEmitter.| Modifier and Type | Field and Description |
|---|---|
private File |
cdcDir |
private org.apache.cassandra.db.commitlog.CommitLogReader |
commitLogReader |
private CommitLogReadHandlerImpl |
commitLogReadHandler |
private boolean |
initial |
private boolean |
latestOnly |
private static org.slf4j.Logger |
LOGGER |
private CommitLogProcessorMetrics |
metrics |
private static String |
NAME |
private BlockingEventQueue<Event> |
queue |
private AbstractDirectoryWatcher |
watcher |
| Constructor and Description |
|---|
CommitLogProcessor(CassandraConnectorContext context) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Override destroy to clean up resources after stopping the processor
|
void |
initialize()
Override initialize to initialize resources before starting the processor
|
void |
process()
The actual work the processor is doing.
|
(package private) void |
processCommitLog(File file) |
(package private) void |
processLastModifiedCommitLog() |
getName, isRunning, start, stopprivate static final org.slf4j.Logger LOGGER
private static final String NAME
private final org.apache.cassandra.db.commitlog.CommitLogReader commitLogReader
private final CommitLogReadHandlerImpl commitLogReadHandler
private final File cdcDir
private final AbstractDirectoryWatcher watcher
private final BlockingEventQueue<Event> queue
private final boolean latestOnly
private final CommitLogProcessorMetrics metrics
private boolean initial
public CommitLogProcessor(CassandraConnectorContext context) throws IOException
IOExceptionpublic void initialize()
AbstractProcessorinitialize in class AbstractProcessorpublic void destroy()
AbstractProcessordestroy in class AbstractProcessorpublic void process()
throws IOException,
InterruptedException
AbstractProcessorprocess in class AbstractProcessorIOExceptionInterruptedExceptionvoid processCommitLog(File file) throws IOException
IOExceptionvoid processLastModifiedCommitLog()
throws IOException
IOExceptionCopyright © 2020 JBoss by Red Hat. All rights reserved.