jsancio commented on a change in pull request #11179:
URL: https://github.com/apache/kafka/pull/11179#discussion_r685275346



##########
File path: core/src/main/scala/kafka/raft/RaftManager.scala
##########
@@ -79,6 +80,11 @@ object KafkaRaftManager {
     Files.createDirectories(dir.toPath)
     dir
   }
+
+  private def deleteLogDirectory(logDir: File, logDirName: String): Unit = {
+    val dir = new Directory(new File(logDir.getAbsolutePath, logDirName))
+    dir.deleteRecursively()
+  }

Review comment:
       This code should not be in `core/src/main` since it is not used by 
`core/src/main`.

##########
File path: core/src/main/scala/kafka/raft/RaftManager.scala
##########
@@ -214,6 +220,12 @@ class KafkaRaftManager[T](
     KafkaRaftManager.createLogDirectory(new File(config.metadataLogDir), 
logDirName)
   }
 
+  // visible for testing cleanup
+  private[raft] def deleteDataDir(): Unit = {
+    val logDirName = Log.logDirName(topicPartition)
+    KafkaRaftManager.deleteLogDirectory(new File(config.metadataLogDir), 
logDirName)

Review comment:
       This code should not be in `core/src/main` since it is not used by 
`core/src/main`.




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