public class KafkaReader<K,V> extends Object implements Runnable
Modifier and Type | Class and Description |
---|---|
protected static class |
KafkaReader.PartitionState |
Modifier and Type | Field and Description |
---|---|
protected io.confluent.security.store.KeyValueStore<K,V> |
cache |
protected ConsumerListener<K,V> |
consumerListener |
protected Map<org.apache.kafka.common.TopicPartition,KafkaReader.PartitionState> |
partitionStates |
protected boolean |
prepareReaderStartupState |
Constructor and Description |
---|
KafkaReader(String topic,
int numPartitions,
org.apache.kafka.clients.consumer.Consumer<K,V> consumer,
io.confluent.security.store.KeyValueStore<K,V> cache,
ConsumerListener<K,V> consumerListener,
StatusListener statusListener,
KafkaStoreConfig storeConfig,
org.apache.kafka.common.utils.Time time) |
Modifier and Type | Method and Description |
---|---|
void |
close(Duration closeTimeout) |
CompletableFuture<Void> |
existingRecordsFuture()
Returns future that completes when existing records on all partitions at the time
the KafkaReader was started are processed and available in the cache.
|
protected List<CompletableFuture<Void>> |
partitionReadyFutures() |
protected void |
processConsumerRecord(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record) |
void |
run() |
CompletionStage<Void> |
start(Duration topicCreateTimeout) |
protected final Map<org.apache.kafka.common.TopicPartition,KafkaReader.PartitionState> partitionStates
protected final ConsumerListener<K,V> consumerListener
protected boolean prepareReaderStartupState
public KafkaReader(String topic, int numPartitions, org.apache.kafka.clients.consumer.Consumer<K,V> consumer, io.confluent.security.store.KeyValueStore<K,V> cache, ConsumerListener<K,V> consumerListener, StatusListener statusListener, KafkaStoreConfig storeConfig, org.apache.kafka.common.utils.Time time)
public CompletionStage<Void> start(Duration topicCreateTimeout)
protected List<CompletableFuture<Void>> partitionReadyFutures()
public CompletableFuture<Void> existingRecordsFuture()
public void close(Duration closeTimeout)