Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10095

In LogCleanerManagerTest replace get().nonEmpty call with contains

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: log cleaner, unit tests
    • Labels:

      Description

      n.b. This is a newbie ticket designed to be an introduction to contributing for the assignee.

      In kafka.log.LogCleanerManagerTest we have two calls to .get(something).nonEmpty, which is equivalent to .contains(something). We should simplify these calls.

       

          cleanerManager.doneCleaning(topicPartition, log.dir, 1)
          assertTrue(cleanerManager.cleaningState(topicPartition).isEmpty)
          assertTrue(cleanerManager.allCleanerCheckpoints.get(topicPartition).nonEmpty)
      
          cleanerManager.setCleaningState(topicPartition, LogCleaningAborted)
          cleanerManager.doneCleaning(topicPartition, log.dir, 1)
          assertEquals(LogCleaningPaused(1), cleanerManager.cleaningState(topicPartition).get)
          assertTrue(cleanerManager.allCleanerCheckpoints.get(topicPartition).nonEmpty)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sarahgonsalves223@gmail.com Sarah Gonsalves
                Reporter:
                jghoman Jakob Homan
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: