Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
None
-
None
Description
n.b. This is a newbie ticket designed to be an introduction to contributing for the assignee.
In MirrorSourceConnector::refreshTopicPartitions we have places where we create a new HashSet and then addAll to the set. We can replace both with a direct call to the copy constructor.
void refreshTopicPartitions() throws InterruptedException, ExecutionException { knownSourceTopicPartitions = findSourceTopicPartitions(); knownTargetTopicPartitions = findTargetTopicPartitions(); List<TopicPartition> upstreamTargetTopicPartitions = knownTargetTopicPartitions.stream() .map(x -> new TopicPartition(replicationPolicy.upstreamTopic(x.topic()), x.partition())) .collect(Collectors.toList()); Set<TopicPartition> newTopicPartitions = new HashSet<>(); newTopicPartitions.addAll(knownSourceTopicPartitions); newTopicPartitions.removeAll(upstreamTargetTopicPartitions); Set<TopicPartition> deadTopicPartitions = new HashSet<>(); deadTopicPartitions.addAll(upstreamTargetTopicPartitions);
Attachments
Issue Links
- links to