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

move all group state transition rules into their states

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.5.0
    • None
    • None

    Description

      Today the `GroupMetadata` maintain a validPreviousStates map of all GroupState:

      ```

      private val validPreviousStates: Map[GroupState, Set[GroupState]] =
      Map(Dead -> Set(Stable, PreparingRebalance, CompletingRebalance, Empty, Dead),
      CompletingRebalance -> Set(PreparingRebalance),
      Stable -> Set(CompletingRebalance),
      PreparingRebalance -> Set(Stable, CompletingRebalance, Empty),
      Empty -> Set(PreparingRebalance))

      ```

      It would be cleaner to move all state transition rules into their states :

      ```

      private[group] sealed trait GroupState

      { val validPreviousStates: Set[GroupState] }

      ```

      Attachments

        Activity

          People

            dengziming Deng Ziming
            dengziming Deng Ziming
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: