private String getEndOffset(SystemStreamPartition systemStreamPartition) {
      TopicPartition topicPartition = toTopicPartition(systemStreamPartition);
      Map<TopicPartition, Long> topicPartitionToOffsets = threadSafeKafkaConsumer.execute(consumer -> consumer.endOffsets(ImmutableSet.of(topicPartition)));
      Long endOffset = topicPartitionToOffsets.get(topicPartition);
      LOG.info("End offset for topic partition: {} is {}.", topicPartition, endOffset);
      return String.valueOf(endOffset);
    }
Determines the end offset of the {@param SystemStreamPartition}.
@param systemStreamPartition represents the system stream partition.
@return the end offset of the partition.
samza-kafka/src/main/java/org/apache/samza/system/kafka/KafkaSystemAdmin.java