Browse Source

KAFKA-15232: Move ToolsUtils to tools (#14066)

Reviewers: Mickael Maison <mickael.maison@gmail.com>
pull/14069/head
Federico Valeri 1 year ago committed by GitHub
parent
commit
1bf73d89d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java
  2. 1
      tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java
  3. 1
      tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java
  4. 3
      tools/src/main/java/org/apache/kafka/tools/ToolsUtils.java
  5. 9
      tools/src/main/java/org/apache/kafka/tools/TransactionsCommand.java

1
tools/src/main/java/org/apache/kafka/tools/ConsumerPerformance.java

@ -31,7 +31,6 @@ import org.apache.kafka.common.utils.Exit; @@ -31,7 +31,6 @@ import org.apache.kafka.common.utils.Exit;
import org.apache.kafka.common.utils.Utils;
import org.apache.kafka.server.util.CommandDefaultOptions;
import org.apache.kafka.server.util.CommandLineUtils;
import org.apache.kafka.server.util.ToolsUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

1
tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java

@ -29,7 +29,6 @@ import org.apache.kafka.clients.admin.QuorumInfo; @@ -29,7 +29,6 @@ import org.apache.kafka.clients.admin.QuorumInfo;
import org.apache.kafka.common.KafkaException;
import org.apache.kafka.common.utils.Exit;
import org.apache.kafka.common.utils.Utils;
import org.apache.kafka.server.util.ToolsUtils;
import java.io.File;
import java.io.IOException;

1
tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java

@ -44,7 +44,6 @@ import net.sourceforge.argparse4j.inf.Namespace; @@ -44,7 +44,6 @@ import net.sourceforge.argparse4j.inf.Namespace;
import org.apache.kafka.common.utils.Exit;
import org.apache.kafka.common.utils.ThroughputThrottler;
import org.apache.kafka.common.utils.Utils;
import org.apache.kafka.server.util.ToolsUtils;
public class ProducerPerformance {

3
server-common/src/main/java/org/apache/kafka/server/util/ToolsUtils.java → tools/src/main/java/org/apache/kafka/tools/ToolsUtils.java

@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.kafka.server.util;
package org.apache.kafka.tools;
import org.apache.kafka.common.Metric;
import org.apache.kafka.common.MetricName;
@ -26,7 +26,6 @@ import java.util.TreeMap; @@ -26,7 +26,6 @@ import java.util.TreeMap;
import java.util.stream.Collectors;
public class ToolsUtils {
/**
* print out the metrics in alphabetical order
* @param metrics the metrics to be printed out

9
tools/src/main/java/org/apache/kafka/tools/TransactionsCommand.java

@ -66,7 +66,6 @@ import static java.util.Arrays.asList; @@ -66,7 +66,6 @@ import static java.util.Arrays.asList;
import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
import static net.sourceforge.argparse4j.impl.Arguments.store;
import static org.apache.kafka.server.util.ToolsUtils.prettyPrintTable;
public abstract class TransactionsCommand {
private static final Logger log = LoggerFactory.getLogger(TransactionsCommand.class);
@ -336,7 +335,7 @@ public abstract class TransactionsCommand { @@ -336,7 +335,7 @@ public abstract class TransactionsCommand {
);
}).collect(Collectors.toList());
prettyPrintTable(HEADERS, rows, out);
ToolsUtils.prettyPrintTable(HEADERS, rows, out);
}
}
@ -414,7 +413,7 @@ public abstract class TransactionsCommand { @@ -414,7 +413,7 @@ public abstract class TransactionsCommand {
Utils.join(result.topicPartitions(), ",")
);
prettyPrintTable(HEADERS, singletonList(row), out);
ToolsUtils.prettyPrintTable(HEADERS, singletonList(row), out);
}
}
@ -469,7 +468,7 @@ public abstract class TransactionsCommand { @@ -469,7 +468,7 @@ public abstract class TransactionsCommand {
}
}
prettyPrintTable(HEADERS, rows, out);
ToolsUtils.prettyPrintTable(HEADERS, rows, out);
}
}
@ -671,7 +670,7 @@ public abstract class TransactionsCommand { @@ -671,7 +670,7 @@ public abstract class TransactionsCommand {
));
}
prettyPrintTable(HEADERS, rows, out);
ToolsUtils.prettyPrintTable(HEADERS, rows, out);
}
private Map<String, TransactionDescription> describeTransactions(

Loading…
Cancel
Save