AbstractCoordinator

AbstractCoordinator is a contract for…​FIXME

Note
ConsumerCoordinator is the default AbstractCoordinator in Apache Kafka’s Consumer API.
package org.apache.kafka.clients.consumer.internals;

abstract class AbstractCoordinator {
  void onJoinComplete(
    int generation,
    String memberId,
    String protocol,
    ByteBuffer memberAssignment);
  void onJoinPrepare(int generation, String memberId);
  Map<String, ByteBuffer> performAssignment(
    String leaderId,
    String protocol,
    Map<String, ByteBuffer> allMemberMetadata);
  ...FIXME
}
Table 1. AbstractCoordinator Contract
Method Description

onJoinComplete

Used exclusively when AbstractCoordinator is requested to joinGroupIfNeeded (and the request to initiateJoinGroup succeeded)

onJoinPrepare

Used exclusively when AbstractCoordinator is requested to joinGroupIfNeeded (and needsJoinPrepare flag is on)

performAssignment

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

joinFuture

RequestFuture<ByteBuffer> for…​FIXME

needsJoinPrepare

Controls when to execute onJoinPrepare while performing joinGroupIfNeeded

rejoinNeeded

Controls when to…​FIXME

Creating AbstractCoordinator Instance

AbstractCoordinator takes the following when created:

  • LogContext

  • ConsumerNetworkClient

  • Group ID

  • rebalanceTimeoutMs

  • sessionTimeoutMs

  • heartbeatIntervalMs

  • Metrics

  • Metric group prefix

  • Time

  • retryBackoffMs

  • leaveGroupOnClose flag

joinGroupIfNeeded Method

void joinGroupIfNeeded()

joinGroupIfNeeded…​FIXME

Note
joinGroupIfNeeded is used exclusively when AbstractCoordinator is requested to ensureActiveGroup.

initiateJoinGroup Internal Method

synchronized RequestFuture<ByteBuffer> initiateJoinGroup()

initiateJoinGroup…​FIXME

Note
initiateJoinGroup is used exclusively when AbstractCoordinator is requested to joinGroupIfNeeded (when a rejoin is needed or still in progress and incomplete).

ensureActiveGroup Method

void ensureActiveGroup()

ensureActiveGroup…​FIXME

Note
ensureActiveGroup is used when ConsumerCoordinator is requested to poll for coordinator events

results matching ""

    No results matching ""