public LinkedHashMap<TopicIdPartition, ShareFetchResponseData.PartitionData> responseData(Map<Uuid, String> topicNames) {
        if (responseData == null) {
            synchronized (this) {
                // Assigning the lazy-initialized `responseData` in the last step
                // to avoid other threads accessing a half-initialized object.
                if (responseData == null) {
                    final LinkedHashMap<TopicIdPartition, ShareFetchResponseData.PartitionData> responseDataTmp = new LinkedHashMap<>();
                    data.responses().forEach(topicResponse -> {
                        String name = topicNames.get(topicResponse.topicId());
                        if (name != null) {
                            topicResponse.partitions().forEach(partitionData -> responseDataTmp.put(new TopicIdPartition(topicResponse.topicId(),
                                    new TopicPartition(name, partitionData.partitionIndex())), partitionData));
                        }
                    });
                    responseData = responseDataTmp;
                }
            }
        }
        return responseData;
    }
Possible error codes.
- {@link Errors#GROUP_AUTHORIZATION_FAILED}
- {@link Errors#TOPIC_AUTHORIZATION_FAILED}
- {@link Errors#UNKNOWN_TOPIC_OR_PARTITION}
- {@link Errors#NOT_LEADER_OR_FOLLOWER}
- {@link Errors#UNKNOWN_TOPIC_ID}
- {@link Errors#INVALID_RECORD_STATE}
- {@link Errors#KAFKA_STORAGE_ERROR}
- {@link Errors#CORRUPT_MESSAGE}
- {@link Errors#INVALID_REQUEST}
- {@link Errors#UNKNOWN_SERVER_ERROR}
clients/src/main/java/org/apache/kafka/common/requests/ShareFetchResponse.java