PartitionAssignor Contract

PartitionAssignor is the abstraction of partition assignors that are identified by name and can perform partition assignment.

Table 1. PartitionAssignor Contract
Method Description

assign

Map<String, Assignment> assign(
  Cluster metadata,
  Map<String, Subscription> subscriptions)

Used exclusively when ConsumerCoordinator is requested to performAssignment

name

String name()

Used when ConsumerCoordinator is requested to metadata, lookupAssignor, and performAssignment (only for logging purposes)

onAssignment

void onAssignment(Assignment assignment)

Used exclusively when ConsumerCoordinator is requested to onJoinComplete

subscription

Subscription subscription(Set<String> topics)

Used exclusively when ConsumerCoordinator is requested to metadata

Table 2. PartitionAssignors (Direct Implementations)
PartitionAssignor Description

AbstractPartitionAssignor

Extension for collecting partition counts

StreamsPartitionAssignor

Default PartitionAssignor in Kafka Streams

results matching ""

    No results matching ""