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

move all group state transition rules into their states

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:
      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

            • Assignee:
              dengziming dengziming
              Reporter:
              dengziming dengziming
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: