Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,23 @@ synchronized public CreateTopicsResult createTopics(Collection<NewTopic> newTopi
topicIds.put(topicName, topicId);
topicNames.put(topicId, topicName);
allTopics.put(topicName, new TopicMetadata(topicId, false, partitions, logDirs, newTopic.configs()));
future.complete(null);
future.complete(new CreateTopicsResult.TopicMetadataAndConfig(topicId, numberOfPartitions, replicationFactor, config(newTopic)));
createTopicResult.put(topicName, future);
}

return new CreateTopicsResult(createTopicResult);
}

private static Config config(NewTopic newTopic) {
Collection<ConfigEntry> configEntries = new ArrayList<>();
if (newTopic.configs() != null) {
for (Map.Entry<String, String> entry : newTopic.configs().entrySet()) {
configEntries.add(new ConfigEntry(entry.getKey(), entry.getValue()));
}
}
return new Config(configEntries);
}

@Override
synchronized public ListTopicsResult listTopics(ListTopicsOptions options) {
Map<String, TopicListing> topicListings = new HashMap<>();
Expand Down