private long getCommittedTimestampMillis(TopicPartition topicPartition) throws Exception {
   Message message = mKafkaClient.getCommittedMessage(topicPartition);
   if (message == null) {
     LOG.error(
         "No message found for topic "
             + topicPartition.getTopic()
             + " partition "
             + topicPartition.getPartition());
     return -1;
   }
   return mMessageParser.extractTimestampMillis(message);
 }
 private long getLastTimestampMillis(TopicPartition topicPartition) throws Exception {
   Message message = mKafkaClient.getLastMessage(topicPartition);
   if (message == null) {
     // This will happen if no messages have been posted to the given topic partition.
     LOG.error(
         "No message found for topic "
             + topicPartition.getTopic()
             + " partition "
             + topicPartition.getPartition());
     return -1;
   }
   return mMessageParser.extractTimestampMillis(message);
 }