nizhikov commented on a change in pull request #9196: URL: https://github.com/apache/kafka/pull/9196#discussion_r475188465
########## File path: tests/kafkatest/services/verifiable_consumer.py ########## @@ -386,33 +386,33 @@ def last_commit(self, tp): def total_consumed(self): with self.lock: - return sum(handler.total_consumed for handler in self.event_handlers.itervalues()) + return sum(handler.total_consumed for handler in iter(self.event_handlers.values())) def num_rebalances(self): with self.lock: - return max(handler.assigned_count for handler in self.event_handlers.itervalues()) + return max(handler.assigned_count for handler in iter(self.event_handlers.values())) def num_revokes_for_alive(self, keep_alive=1): with self.lock: - return max([handler.revoked_count for handler in self.event_handlers.itervalues() + return max([handler.revoked_count for handler in iter(self.event_handlers.values()) if handler.idx <= keep_alive]) def joined_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) if handler.state == ConsumerState.Joined] def rebalancing_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) if handler.state == ConsumerState.Rebalancing] def dead_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) if handler.state == ConsumerState.Dead] def alive_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) Review comment: fixed. ########## File path: tests/kafkatest/services/verifiable_consumer.py ########## @@ -386,33 +386,33 @@ def last_commit(self, tp): def total_consumed(self): with self.lock: - return sum(handler.total_consumed for handler in self.event_handlers.itervalues()) + return sum(handler.total_consumed for handler in iter(self.event_handlers.values())) def num_rebalances(self): with self.lock: - return max(handler.assigned_count for handler in self.event_handlers.itervalues()) + return max(handler.assigned_count for handler in iter(self.event_handlers.values())) def num_revokes_for_alive(self, keep_alive=1): with self.lock: - return max([handler.revoked_count for handler in self.event_handlers.itervalues() + return max([handler.revoked_count for handler in iter(self.event_handlers.values()) if handler.idx <= keep_alive]) def joined_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) if handler.state == ConsumerState.Joined] def rebalancing_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) if handler.state == ConsumerState.Rebalancing] def dead_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) Review comment: fixed. ########## File path: tests/kafkatest/services/verifiable_consumer.py ########## @@ -386,33 +386,33 @@ def last_commit(self, tp): def total_consumed(self): with self.lock: - return sum(handler.total_consumed for handler in self.event_handlers.itervalues()) + return sum(handler.total_consumed for handler in iter(self.event_handlers.values())) def num_rebalances(self): with self.lock: - return max(handler.assigned_count for handler in self.event_handlers.itervalues()) + return max(handler.assigned_count for handler in iter(self.event_handlers.values())) def num_revokes_for_alive(self, keep_alive=1): with self.lock: - return max([handler.revoked_count for handler in self.event_handlers.itervalues() + return max([handler.revoked_count for handler in iter(self.event_handlers.values()) if handler.idx <= keep_alive]) def joined_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) if handler.state == ConsumerState.Joined] def rebalancing_nodes(self): with self.lock: - return [handler.node for handler in self.event_handlers.itervalues() + return [handler.node for handler in iter(self.event_handlers.values()) Review comment: fixed. ########## File path: tests/kafkatest/services/verifiable_consumer.py ########## @@ -386,33 +386,33 @@ def last_commit(self, tp): def total_consumed(self): with self.lock: - return sum(handler.total_consumed for handler in self.event_handlers.itervalues()) + return sum(handler.total_consumed for handler in iter(self.event_handlers.values())) def num_rebalances(self): with self.lock: - return max(handler.assigned_count for handler in self.event_handlers.itervalues()) + return max(handler.assigned_count for handler in iter(self.event_handlers.values())) def num_revokes_for_alive(self, keep_alive=1): with self.lock: - return max([handler.revoked_count for handler in self.event_handlers.itervalues() + return max([handler.revoked_count for handler in iter(self.event_handlers.values()) Review comment: fixed. ---------------------------------------------------------------- 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