GroupMetadata — Metadata of Consumer Group

GroupMetadata is the metadata of a consumer group.

GroupMetadata takes the following to be created:

GroupMetadata uses the states to describe the state of a consumer group.

Table 1. States of Consumer Group
State Description

CompletingRebalance

Dead

Empty

PreparingRebalance

Stable

GroupMetadata defines validPreviousStates internal registry of the valid previous states per state.

Table 2. Valid Previous States
State Valid Previous States

Dead

Stable, PreparingRebalance, CompletingRebalance, Empty, Dead

CompletingRebalance

PreparingRebalance

Stable

CompletingRebalance

PreparingRebalance

Stable, CompletingRebalance, Empty

Empty

PreparingRebalance

GroupMetadata is created when:

Table 3. GroupMetadata’s Internal Properties (e.g. Registries, Counters and Flags)
Name Description

generationId

Starts at 0

leaderId

ID of the Kafka Consumer that is the leader of the consumer group

Starts empty (None) and is initialized in loadGroup, add or remove

Used when isLeader and leaderOrNull

members

Members of the consumer group (as MemberMetadata per member ID)

Registering Consumer with Consumer Group — add Method

add(
  member: MemberMetadata,
  callback: JoinCallback = null): Unit

add…​FIXME

Note

add is used when:

Loading Consumer Group Metadata — loadGroup Factory Method

loadGroup(
  groupId: String,
  initialState: GroupState,
  generationId: Int,
  protocolType: String,
  protocol: String,
  leaderId: String,
  currentStateTimestamp: Option[Long],
  members: Iterable[MemberMetadata],
  time: Time): GroupMetadata

loadGroup…​FIXME

Note
loadGroup is used exclusively when GroupMetadataManager is requested to readGroupMessageValue.

Unregistering Consumer from Consumer Group — remove Method

remove(memberId: String): Unit

remove…​FIXME

Note
remove is used when GroupCoordinator is requested to removeMemberAndUpdateGroup and onCompleteJoin.

Changing State of Consumer Group — transitionTo Method

transitionTo(groupState: GroupState): Unit

transitionTo…​FIXME

Note
transitionTo is used when…​FIXME

initNextGeneration Method

initNextGeneration(): Unit

initNextGeneration…​FIXME

Note
initNextGeneration is used exclusively when GroupCoordinator is requested to onCompleteJoin.

Asserting No Offets in Use — hasOffsets Method

hasOffsets: Boolean

hasOffsets…​FIXME

Note
hasOffsets is used exclusively when GroupMetadataManager is requested to cleanupGroupMetadata

results matching ""

    No results matching ""