Package org.eso.ias.sink.ltdb
Class LtdbKafkaTask
java.lang.Object
org.apache.kafka.connect.sink.SinkTask
org.eso.ias.sink.ltdb.LtdbKafkaTask
- All Implemented Interfaces:
Runnable,org.apache.kafka.connect.connector.Task
The task run by the kafka connector for the LTDB.
It saves IASIOs in the Cassandra database.
No need to synchronize because Kafka connectors run on a
single thread.
Received IASIOs are saved in the buffer to quickly return from the
put method. Asynchronously the thread stores IASIOs in the LTDB.
When the flush is executed all the remainings IASIOs in the buffer
are saved in the LTDB.
- Author:
- acaproni
-
Field Summary
Fields inherited from class org.apache.kafka.connect.sink.SinkTask
context, TOPICS_CONFIG, TOPICS_REGEX_CONFIG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> currentOffsets) voidput(Collection<org.apache.kafka.connect.sink.SinkRecord> records) voidrun()The thread that store elements in the LTDB before the flush is called.voidvoidstop()version()Methods inherited from class org.apache.kafka.connect.sink.SinkTask
close, initialize, onPartitionsAssigned, onPartitionsRevoked, open, preCommit
-
Constructor Details
-
LtdbKafkaTask
public LtdbKafkaTask()
-
-
Method Details
-
version
- Specified by:
versionin interfaceorg.apache.kafka.connect.connector.Task
-
start
- Specified by:
startin interfaceorg.apache.kafka.connect.connector.Task- Specified by:
startin classorg.apache.kafka.connect.sink.SinkTask
-
put
- Specified by:
putin classorg.apache.kafka.connect.sink.SinkTask
-
stop
public void stop()- Specified by:
stopin interfaceorg.apache.kafka.connect.connector.Task- Specified by:
stopin classorg.apache.kafka.connect.sink.SinkTask
-
flush
public void flush(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> currentOffsets) - Overrides:
flushin classorg.apache.kafka.connect.sink.SinkTask
-
run
public void run()The thread that store elements in the LTDB before the flush is called. The thread logs statistics if the time interval elapsed.
-