kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: MINOR: Remove redundant try block in LogCleaner (#5776)
Date Sat, 20 Oct 2018 16:41:01 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 9e088eb  MINOR: Remove redundant try block in LogCleaner (#5776)
9e088eb is described below

commit 9e088eb120a5c4950e8107e08875fdb4e12f4bef
Author: Dhruvil Shah <dhruvil@confluent.io>
AuthorDate: Sat Oct 20 09:40:41 2018 -0700

    MINOR: Remove redundant try block in LogCleaner (#5776)
    
    Reviewers: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>, Ismael Juma <ismael@juma.me.uk>
---
 core/src/main/scala/kafka/log/LogCleaner.scala | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/core/src/main/scala/kafka/log/LogCleaner.scala b/core/src/main/scala/kafka/log/LogCleaner.scala
index 0416325..aca8154 100644
--- a/core/src/main/scala/kafka/log/LogCleaner.scala
+++ b/core/src/main/scala/kafka/log/LogCleaner.scala
@@ -321,12 +321,9 @@ class LogCleaner(initialConfig: CleanerConfig,
         }
         val deletable: Iterable[(TopicPartition, Log)] = cleanerManager.deletableLogs()
         try {
-          deletable.foreach {
-            case (topicPartition, log) =>
-              try {
-                currentLog = Some(log)
-                log.deleteOldSegments()
-              }
+          deletable.foreach { case (topicPartition, log) =>
+            currentLog = Some(log)
+            log.deleteOldSegments()
           }
         } finally  {
           cleanerManager.doneDeleting(deletable.map(_._1))


Mime
View raw message