Yunyung commented on code in PR #20035:
URL: https://github.com/apache/kafka/pull/20035#discussion_r2166131960


##########
tools/src/test/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommandTest.java:
##########
@@ -445,24 +439,24 @@ public void testAlterLogDirReassignmentThrottle() throws 
Exception {
         produceMessages(topicPartition.topic(), topicPartition.partition(), 
700);
 
         int targetBrokerId = 0;
-        List<Integer> replicas = asList(0, 1, 2);
+        List<Integer> replicas = List.of(0, 1, 2);
         LogDirReassignment reassignment = 
buildLogDirReassignment(topicPartition, targetBrokerId, replicas);
 
         // Start the replica move with a low throttle so it does not complete
         long initialLogDirThrottle = 1L;
         runExecuteAssignment(false, reassignment.json, -1L, 
initialLogDirThrottle);
-        try (Admin admin = 
Admin.create(Collections.singletonMap(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG,
 clusterInstance.bootstrapServers()))) {
-            waitForLogDirThrottle(admin, new HashSet<>(singletonList(0)), 
initialLogDirThrottle);
+        try (Admin admin = 
Admin.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, 
clusterInstance.bootstrapServers()))) {
+            waitForLogDirThrottle(admin, new HashSet<>(List.of(0)), 
initialLogDirThrottle);

Review Comment:
   ```suggestion
               waitForLogDirThrottle(admin, Set.of(0), initialLogDirThrottle);
   ```



##########
tools/src/test/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommandTest.java:
##########
@@ -804,9 +798,9 @@ private void testCancellationAction(boolean 
useBootstrapServer) throws Interrupt
      * Remove a set of throttled partitions and reset the overall replication 
quota.
      */
     private void removeReplicationThrottleForPartitions(TopicPartition part) {
-        try (Admin admin = 
Admin.create(Collections.singletonMap(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG,
 clusterInstance.bootstrapServers()))) {
-            removePartitionReplicaThrottles(admin, new 
HashSet<>(singleton(part)));
-            assertDoesNotThrow(() -> throttleAllBrokersReplication(admin, 
asList(0, 1, 2, 3), Integer.MAX_VALUE));
+        try (Admin admin = 
Admin.create(Map.of(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, 
clusterInstance.bootstrapServers()))) {
+            removePartitionReplicaThrottles(admin, new 
HashSet<>(Set.of(part)));

Review Comment:
   ```suggestion
               removePartitionReplicaThrottles(admin, Set.of(part));
   ```



-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to