use of org.apache.gobblin.source.extractor.extract.kafka.KafkaOffsetRetrievalFailureException in project incubator-gobblin by apache.
the class SimpleKafkaSpecConsumer method initializeHighWatermarks.
private void initializeHighWatermarks() {
try {
int i = 0;
for (KafkaPartition kafkaPartition : _partitions) {
long latestOffset = _kafkaConsumer.getLatestOffset(kafkaPartition);
_highWatermark.set(i, latestOffset);
i++;
}
} catch (KafkaOffsetRetrievalFailureException e) {
throw new RuntimeException(e);
}
}
use of org.apache.gobblin.source.extractor.extract.kafka.KafkaOffsetRetrievalFailureException in project incubator-gobblin by apache.
the class SimpleKafkaSpecConsumer method initializeLowWatermarks.
private void initializeLowWatermarks() {
try {
int i = 0;
for (KafkaPartition kafkaPartition : _partitions) {
if (isFirstRun) {
long earliestOffset = _kafkaConsumer.getEarliestOffset(kafkaPartition);
_lowWatermark.set(i, earliestOffset);
} else {
_lowWatermark.set(i, _highWatermark.get(i));
}
i++;
}
isFirstRun = false;
} catch (KafkaOffsetRetrievalFailureException e) {
throw new RuntimeException(e);
}
}
Aggregations