K
- record key typeV
- record value typepublic abstract class AbstractPartition<K,V> extends MonitoredPartition implements IPartition
IPartition
abstract implementation. It only provides the basics.Modifier and Type | Field and Description |
---|---|
protected org.apache.kafka.clients.consumer.KafkaConsumer<K,V> |
consumer
the consumer
|
protected Long |
earliestOffset |
protected Long |
latestOffset |
protected int |
partitionNumber
our partition number
|
protected String |
topic
our topic
|
commitLatency, committedOffsetGauge, currentDelayGauge, currentTimestampGauge, earliestOffsetGauge, fetchSize, latestOffsetGauge, messagesCommitBacklogGauge, messagesFetchBacklogGauge, messagesPersistedBacklogGauge, messagesReplayableGauge, metricsContext, msgFetchRate, offsetAckRate, offsetFailRate
Modifier | Constructor and Description |
---|---|
protected |
AbstractPartition(org.apache.kafka.clients.consumer.KafkaConsumer<K,V> consumer,
org.thales.punch.libraries.metrics.api.IMetricContext mc,
String topic,
int partitionNumber,
Long offsetWatchDogTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
attach(Object o)
Attach an object to this partition.
|
Object |
getAttachment() |
int |
getPartitionNumber() |
String |
getTopic() |
protected abstract void |
onReceive(IRecordHandler<K,V> receiver,
org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record) |
protected void |
setEarliestOffset(Long value) |
protected void |
setLatestOffset(Long value) |
close
protected int partitionNumber
protected String topic
protected Long earliestOffset
protected Long latestOffset
protected AbstractPartition(org.apache.kafka.clients.consumer.KafkaConsumer<K,V> consumer, org.thales.punch.libraries.metrics.api.IMetricContext mc, String topic, int partitionNumber, Long offsetWatchDogTimeout)
mc
- the metric contextpartitionNumber
- the partition numberoffsetWatchDogTimeout
- public int getPartitionNumber()
getPartitionNumber
in interface IPartition
public String getTopic()
getTopic
in interface IPartition
public void attach(Object o)
IPartition
IPartition.getAttachment()
.attach
in interface IPartition
o
- the object to attachpublic Object getAttachment()
getAttachment
in interface IPartition
protected void setEarliestOffset(Long value)
protected void setLatestOffset(Long value)
protected abstract void onReceive(IRecordHandler<K,V> receiver, org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record)
Copyright © 2014–2023. All rights reserved.