You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/06/03 21:52:48 UTC

[GitHub] [kafka] sarahgonsalves223 opened a new pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

sarahgonsalves223 opened a new pull request #8795:
URL: https://github.com/apache/kafka/pull/8795


   In kafka.log.LogCleanerManagerTest we have two calls to .get(something).nonEmpty, which is equivalent to .contains(something). Making changes to simplify these calls.
   
   Reviewers: Jakob Homan jghoman@gmail.com
   
   This is a newbie ticket to get used to the contribution flow.
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

Posted by GitBox <gi...@apache.org>.
ijuma commented on pull request #8795:
URL: https://github.com/apache/kafka/pull/8795#issuecomment-638550319


   ok to test


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] sarahgonsalves223 commented on pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

Posted by GitBox <gi...@apache.org>.
sarahgonsalves223 commented on pull request #8795:
URL: https://github.com/apache/kafka/pull/8795#issuecomment-638481270


   @jghoman


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] hachikuji commented on a change in pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

Posted by GitBox <gi...@apache.org>.
hachikuji commented on a change in pull request #8795:
URL: https://github.com/apache/kafka/pull/8795#discussion_r436401217



##########
File path: core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala
##########
@@ -571,12 +571,12 @@ class LogCleanerManagerTest extends Logging {
     cleanerManager.setCleaningState(topicPartition, LogCleaningInProgress)
     cleanerManager.doneCleaning(topicPartition, log.dir, 1)
     assertTrue(cleanerManager.cleaningState(topicPartition).isEmpty)
-    assertTrue(cleanerManager.allCleanerCheckpoints.get(topicPartition).nonEmpty)
+    assertTrue(cleanerManager.allCleanerCheckpoints.contains(topicPartition))

Review comment:
       I think we could make the assertion a little stronger and fix this at the same time. We expect the checkpoint to be exactly the `endOffset` provided in `doneCleaning`. So maybe we could do something like this?
   ```scala
       val endOffset = 1L
       cleanerManager.doneCleaning(topicPartition, log.dir, endOffset)
       assertTrue(cleanerManager.cleaningState(topicPartition).isEmpty)
       assertEquals(Some(endOffset), cleanerManager.allCleanerCheckpoints.get(topicPartition))
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] jghoman commented on pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

Posted by GitBox <gi...@apache.org>.
jghoman commented on pull request #8795:
URL: https://github.com/apache/kafka/pull/8795#issuecomment-639881166






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] abbccdda commented on a change in pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

Posted by GitBox <gi...@apache.org>.
abbccdda commented on a change in pull request #8795:
URL: https://github.com/apache/kafka/pull/8795#discussion_r449259997



##########
File path: core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala
##########
@@ -571,12 +571,12 @@ class LogCleanerManagerTest extends Logging {
     cleanerManager.setCleaningState(topicPartition, LogCleaningInProgress)
     cleanerManager.doneCleaning(topicPartition, log.dir, 1)
     assertTrue(cleanerManager.cleaningState(topicPartition).isEmpty)
-    assertTrue(cleanerManager.allCleanerCheckpoints.get(topicPartition).nonEmpty)
+    assertTrue(cleanerManager.allCleanerCheckpoints.contains(topicPartition))

Review comment:
       +1




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] abbccdda commented on pull request #8795: KAFKA-10095: Simplify calls in LogCleanerManagerTest

Posted by GitBox <gi...@apache.org>.
abbccdda commented on pull request #8795:
URL: https://github.com/apache/kafka/pull/8795#issuecomment-654583118


   @sarahgonsalves223 Could you address @hachikuji 's comment?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org