faust.assignor.partition_assignor
¶
Partition assignor.
- class faust.assignor.partition_assignor.PartitionAssignor(app: AppT, replicas: int = 0)[source]¶
PartitionAssignor handles internal topic creation.
Further, this assignor needs to be sticky and potentially redundant In addition, it tracks external topic assignments as well (to support topic routes)
Notes
Interface copied from
kafka.coordinator.assignors.abstract
.- property changelog_distribution: MutableMapping[str, MutableMapping[str, List[int]]]¶
- property external_topic_distribution: MutableMapping[str, MutableMapping[str, List[int]]]¶
- on_assignment(assignment: ConsumerProtocolMemberMetadata) None [source]¶
Callback that runs on each assignment.
This method can be used to update internal state, if any, of the partition assignor.
- Parameters:
assignment (MemberAssignment) – the member’s assignment
- Return type:
None
- metadata(topics: Set[str]) ConsumerProtocolMemberMetadata [source]¶
Generate ProtocolMetadata to be submitted via JoinGroupRequest.
- Parameters:
topics (set) – a member’s subscribed topics
- Return type:
ConsumerProtocolMemberMetadata
- Returns:
MemberMetadata struct
- assign(cluster: ClusterMetadata, member_metadata: MutableMapping[str, ConsumerProtocolMemberMetadata]) MutableMapping[str, ConsumerProtocolMemberAssignment] [source]¶
Perform group assignment given cluster metadata and member subscriptions
- table_metadata(topic: str) MutableMapping[str, MutableMapping[str, List[int]]] [source]¶
- tables_metadata() MutableMapping[str, MutableMapping[str, List[int]]] [source]¶
- external_topics_metadata() MutableMapping[str, MutableMapping[str, List[int]]] [source]¶