dengziming created KAFKA-9277:
---------------------------------
Summary: 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
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)