KafkaConsumerMetaTable metaTable = getMetaTable();
if (metaTable == null) {
LOG.info("Could not get KafkaConsumerMetaTable, seems like we are being shut down");
return -1L;
}
long offset = metaTable.get(new TopicPartition(topic, partition));
LOG.info("Offset for topic: {}, partition: {} is {}", topic, partition, offset);
return offset;
} catch (OperationException e) {
LOG.error("Failed to get offset from meta table. Defaulting to beginning. {}", e.getMessage(), e);
}