You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Guozhang Wang (Jira)" <ji...@apache.org> on 2019/12/23 23:37:00 UTC

[jira] [Resolved] (KAFKA-9277) move all group state transition rules into their states

     [ https://issues.apache.org/jira/browse/KAFKA-9277?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guozhang Wang resolved KAFKA-9277.
----------------------------------
    Fix Version/s: 2.5.0
       Resolution: Fixed

> move all group state transition rules into their states
> -------------------------------------------------------
>
>                 Key: KAFKA-9277
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9277
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: dengziming
>            Assignee: dengziming
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> 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]
> }
> ```



--
This message was sent by Atlassian Jira
(v8.3.4#803005)