use of org.apache.kafka.common.message.TxnOffsetCommitResponseData.TxnOffsetCommitResponsePartition in project kafka by apache.
the class TxnOffsetCommitRequest method getErrorResponseTopics.
static List<TxnOffsetCommitResponseTopic> getErrorResponseTopics(List<TxnOffsetCommitRequestTopic> requestTopics, Errors e) {
List<TxnOffsetCommitResponseTopic> responseTopicData = new ArrayList<>();
for (TxnOffsetCommitRequestTopic entry : requestTopics) {
List<TxnOffsetCommitResponsePartition> responsePartitions = new ArrayList<>();
for (TxnOffsetCommitRequestPartition requestPartition : entry.partitions()) {
responsePartitions.add(new TxnOffsetCommitResponsePartition().setPartitionIndex(requestPartition.partitionIndex()).setErrorCode(e.code()));
}
responseTopicData.add(new TxnOffsetCommitResponseTopic().setName(entry.name()).setPartitions(responsePartitions));
}
return responseTopicData;
}
Aggregations