partitionLatestOffsetRequestInfo);
earliestOffsetInfo.put(topicAndPartition,
partitionEarliestOffsetRequestInfo);
}
OffsetResponse latestOffsetResponse = consumer
.getOffsetsBefore(new OffsetRequest(latestOffsetInfo,
kafka.api.OffsetRequest.CurrentVersion(), CamusJob
.getKafkaClientName(context)));
OffsetResponse earliestOffsetResponse = consumer
.getOffsetsBefore(new OffsetRequest(earliestOffsetInfo,
kafka.api.OffsetRequest.CurrentVersion(), CamusJob
.getKafkaClientName(context)));
consumer.close();
for (TopicAndPartition topicAndPartition : topicAndPartitions) {
long latestOffset = latestOffsetResponse.offsets(
topicAndPartition.topic(),
topicAndPartition.partition())[0];
long earliestOffset = earliestOffsetResponse.offsets(
topicAndPartition.topic(),
topicAndPartition.partition())[0];
//TODO: factor out kafka specific request functionality
CamusRequest etlRequest = new EtlRequest(context,