private static void clearAllThrottles(Admin adminClient,
                                          List<Entry<TopicPartition, List<Integer>>> targetParts
    ) throws ExecutionException, InterruptedException {
        Set<Integer> brokers = adminClient.describeCluster().nodes().get().stream().map(Node::id).collect(Collectors.toSet());
        targetParts.forEach(t -> brokers.addAll(t.getValue()));

        System.out.printf("Clearing broker-level throttles on broker%s %s%n",
            brokers.size() == 1 ? "" : "s", brokers.stream().map(Object::toString).collect(Collectors.joining(",")));
        clearBrokerLevelThrottles(adminClient, brokers);

        Set<String> topics = targetParts.stream().map(t -> t.getKey().topic()).collect(Collectors.toSet());
        System.out.printf("Clearing topic-level throttles on topic%s %s%n",
            topics.size() == 1 ? "" : "s", String.join(",", topics));
        clearTopicLevelThrottles(adminClient, topics);
    }
Clear all topic-level and broker-level throttles.

@param adminClient     The AdminClient to use.
@param targetParts     The target partitions loaded from the JSON file.
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java