Search in sources :

Example 1 with TxnOffsetCommitResponseTopic

use of org.apache.kafka.common.message.TxnOffsetCommitResponseData.TxnOffsetCommitResponseTopic 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;
}
Also used : TxnOffsetCommitRequestTopic(org.apache.kafka.common.message.TxnOffsetCommitRequestData.TxnOffsetCommitRequestTopic) TxnOffsetCommitResponseTopic(org.apache.kafka.common.message.TxnOffsetCommitResponseData.TxnOffsetCommitResponseTopic) TxnOffsetCommitResponsePartition(org.apache.kafka.common.message.TxnOffsetCommitResponseData.TxnOffsetCommitResponsePartition) ArrayList(java.util.ArrayList) TxnOffsetCommitRequestPartition(org.apache.kafka.common.message.TxnOffsetCommitRequestData.TxnOffsetCommitRequestPartition)

Aggregations

ArrayList (java.util.ArrayList)1 TxnOffsetCommitRequestPartition (org.apache.kafka.common.message.TxnOffsetCommitRequestData.TxnOffsetCommitRequestPartition)1 TxnOffsetCommitRequestTopic (org.apache.kafka.common.message.TxnOffsetCommitRequestData.TxnOffsetCommitRequestTopic)1 TxnOffsetCommitResponsePartition (org.apache.kafka.common.message.TxnOffsetCommitResponseData.TxnOffsetCommitResponsePartition)1 TxnOffsetCommitResponseTopic (org.apache.kafka.common.message.TxnOffsetCommitResponseData.TxnOffsetCommitResponseTopic)1