@Override
public List<UnboundedPartition<Pair<byte[], byte[]>, Long>> getPartitions() {
long offsetTimestamp = -1L;
long stopReadingAtStamp = Long.MAX_VALUE;
if (config != null) {
offsetTimestamp = config.getLong(CFG_RESET_OFFSET_TIMESTAMP_MILLIS, -1L);
if (offsetTimestamp > 0) {
LOG.info("Resetting offset of kafka topic {} to {}",
topicId, offsetTimestamp);
} else if (offsetTimestamp == 0) {
LOG.info("Going to read the whole contents of kafka topic {}",
topicId);
}
stopReadingAtStamp = config.getLong(
CFG_STOP_AT_TIMESTAMP_MILLIS, stopReadingAtStamp);
if (stopReadingAtStamp < Long.MAX_VALUE) {
LOG.info("Will stop polling kafka topic at current timestamp {}",
stopReadingAtStamp);
}
}
return getPartitions(offsetTimestamp, stopReadingAtStamp);
}