avalsa commented on a change in pull request #8221:
URL: https://github.com/apache/kafka/pull/8221#discussion_r412020510



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/PartitionGroup.java
##########
@@ -93,6 +96,29 @@ long partitionTimestamp(final TopicPartition partition) {
         return queue.partitionTime();
     }
 
+    // creates queues for new partitions, removes old queues, saves cached 
records for previously assigned partitions
+    void updatePartitions(final Set<TopicPartition> newInputPartitions, final 
Function<TopicPartition, RecordQueue> recordQueueCreator) {
+        final Set<TopicPartition> removedPartitions = new HashSet<>();
+        final Iterator<Map.Entry<TopicPartition, RecordQueue>> queuesIterator 
= partitionQueues.entrySet().iterator();
+        while (queuesIterator.hasNext()) {
+            final Map.Entry<TopicPartition, RecordQueue> queueEntry = 
queuesIterator.next();
+            final TopicPartition topicPartition = queueEntry.getKey();
+            if (newInputPartitions.contains(topicPartition)) {

Review comment:
       Yes, can rephrased as you offer.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to