This is an automated email from the ASF dual-hosted git repository.

gharris pushed a commit to branch 3.8
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.8 by this push:
     new 01722804271 KAFKA-17148: Remove print MetaPropertiesEnsemble from 
kafka-storage tool (#16607) (3.8) (#16617)
01722804271 is described below

commit 017228042716f9e76e4064a72b7e5070ce591335
Author: Greg Harris <[email protected]>
AuthorDate: Wed Jul 17 17:07:11 2024 -0700

    KAFKA-17148: Remove print MetaPropertiesEnsemble from kafka-storage tool 
(#16607) (3.8) (#16617)
    
    Reviewers: Chia-Ping Tsai <[email protected]>, Greg Harris 
<[email protected]>, Chris Egerton <[email protected]>
    
    Co-authored-by: Dmitry Werner <[email protected]>
---
 core/src/main/scala/kafka/tools/StorageTool.scala          | 1 -
 core/src/test/scala/unit/kafka/tools/StorageToolTest.scala | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/core/src/main/scala/kafka/tools/StorageTool.scala 
b/core/src/main/scala/kafka/tools/StorageTool.scala
index c9f51395852..fdc29c4b0c3 100644
--- a/core/src/main/scala/kafka/tools/StorageTool.scala
+++ b/core/src/main/scala/kafka/tools/StorageTool.scala
@@ -530,7 +530,6 @@ object StorageTool extends Logging {
     metaPropertiesEnsemble.verify(metaProperties.clusterId(), 
metaProperties.nodeId(),
       util.EnumSet.noneOf(classOf[VerificationFlag]))
 
-    stream.println(s"metaPropertiesEnsemble=$metaPropertiesEnsemble")
     val copier = new MetaPropertiesEnsemble.Copier(metaPropertiesEnsemble)
     if (!(ignoreFormatted || copier.logDirProps().isEmpty)) {
       val firstLogDir = copier.logDirProps().keySet().iterator().next()
diff --git a/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala 
b/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala
index 50a3bf12f02..e0b4807f38f 100644
--- a/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala
+++ b/core/src/test/scala/unit/kafka/tools/StorageToolTest.scala
@@ -183,7 +183,7 @@ Found problem:
       val bootstrapMetadata = 
StorageTool.buildBootstrapMetadata(MetadataVersion.latestTesting(), None, "test 
format command")
       assertEquals(0, StorageTool.
         formatCommand(new PrintStream(stream), Seq(tempDir.toString), 
metaProperties, bootstrapMetadata, MetadataVersion.latestTesting(), 
ignoreFormatted = false))
-      
assertTrue(stream.toString().split("\\r?\\n").exists(_.startsWith("Formatting 
%s".format(tempDir))))
+      assertTrue(stream.toString().startsWith("Formatting %s".format(tempDir)))
 
       try assertEquals(1, StorageTool.
         formatCommand(new PrintStream(new ByteArrayOutputStream()), 
Seq(tempDir.toString), metaProperties, bootstrapMetadata, 
MetadataVersion.latestTesting(), ignoreFormatted = false)) catch {
@@ -195,7 +195,7 @@ Found problem:
       val stream2 = new ByteArrayOutputStream()
       assertEquals(0, StorageTool.
         formatCommand(new PrintStream(stream2), Seq(tempDir.toString), 
metaProperties, bootstrapMetadata, MetadataVersion.latestTesting(), 
ignoreFormatted = true))
-      assertEquals(1, 
stream2.toString().split("\\r?\\n").count(_.startsWith("All of the log 
directories are already formatted")))
+      assertEquals("All of the log directories are already 
formatted.%n".format(), stream2.toString())
     } finally Utils.delete(tempDir)
   }
 

Reply via email to