sv2000 commented on a change in pull request #2900: [GOBBLIN-1040]
HighLevelConsumer re-design by removing references to …
URL: https://github.com/apache/incubator-gobblin/pull/2900#discussion_r386166694
##########
File path:
gobblin-modules/gobblin-kafka-09/src/main/java/org/apache/gobblin/kafka/client/Kafka09ConsumerClient.java
##########
@@ -180,6 +200,26 @@ public KafkaConsumerRecord apply(ConsumerRecord<K, V>
input) {
return codaHaleMetricMap;
}
+ @Override
+ public synchronized void commitOffsets(Map<KafkaPartition, Long>
partitionOffsets) {
+ Map<TopicPartition, OffsetAndMetadata> offsets =
partitionOffsets.entrySet().stream().collect(Collectors.toMap(e -> new
TopicPartition(e.getKey().getTopicName(),e.getKey().getId()), e -> new
OffsetAndMetadata(e.getValue())));
+ consumer.commitAsync(offsets, new OffsetCommitCallback() {
+ @Override
+ public void onComplete(Map<TopicPartition, OffsetAndMetadata> offsets,
Exception exception) {
+ if(exception != null) {
+ log.error("Exception while committing offsets " + partitionOffsets,
exception);
+ return;
+ }
+ }
+ });
+ }
+
+ @Override
+ public synchronized long committed(KafkaPartition partition) {
Review comment:
Add javadoc here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services