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 Map<org.apache.kafka.common.TopicPartition,KafkaReader.PartitionState> |
partitionStates |
Constructor and Description |
---|
KafkaReader(String topic,
int numPartitions,
org.apache.kafka.clients.consumer.Consumer<K,V> consumer,
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() |
void |
run() |
CompletionStage<Void> |
start(Duration topicCreateTimeout) |
protected final Map<org.apache.kafka.common.TopicPartition,KafkaReader.PartitionState> partitionStates
public KafkaReader(String topic, int numPartitions, org.apache.kafka.clients.consumer.Consumer<K,V> consumer, 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)