faust.assignor.partition_assignor

Partition assignor.

faust.assignor.partition_assignor.MemberAssignmentMapping

alias of typing.MutableMapping

faust.assignor.partition_assignor.MemberMetadataMapping

alias of typing.MutableMapping

faust.assignor.partition_assignor.MemberSubscriptionMapping

alias of typing.MutableMapping

faust.assignor.partition_assignor.ClientMetadataMapping

alias of typing.MutableMapping

faust.assignor.partition_assignor.ClientAssignmentMapping

alias of typing.MutableMapping

faust.assignor.partition_assignor.CopartitionedGroups

alias of typing.MutableMapping

class faust.assignor.partition_assignor.PartitionAssignor(app: faust.types.app.AppT, replicas: int = 0) → None[source]

PartitionAssignor handles internal topic creation.

Further, this assignor needs to be sticky and potentially redundant

Notes

Interface copied from https://github.com/dpkp/kafka-python/blob/master/ kafka/coordinator/assignors/abstract.py

group_for_topic(topic: str) → int[source]
Return type:int
changelog_distribution
Return type:MutableMapping[str, MutableMapping[str, List[int]]]
on_assignment(assignment: kafka.coordinator.protocol.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]) → kafka.coordinator.protocol.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: kafka.cluster.ClusterMetadata, member_metadata: MutableMapping[str, kafka.coordinator.protocol.ConsumerProtocolMemberMetadata]) → MutableMapping[str, kafka.coordinator.protocol.ConsumerProtocolMemberAssignment][source]

Perform group assignment given cluster metadata and member subscriptions

Parameters:
  • cluster (ClusterMetadata) – metadata for use in assignment
  • (dict of {member_id (members) – MemberMetadata}): decoded metadata for each member in the group.
Return type:

MutableMapping[str, ConsumerProtocolMemberAssignment]

Returns:

{member_id: MemberAssignment}

Return type:

dict

name

.name should be a string identifying the assignor :rtype: str

version
Return type:int
assigned_standbys() → Set[faust.types.tuples.TP][source]
Return type:Set[TP]
assigned_actives() → Set[faust.types.tuples.TP][source]
Return type:Set[TP]
table_metadata(topic: str) → MutableMapping[str, MutableMapping[str, List[int]]][source]
Return type:MutableMapping[str, MutableMapping[str, List[int]]]
tables_metadata() → MutableMapping[str, MutableMapping[str, List[int]]][source]
Return type:MutableMapping[str, MutableMapping[str, List[int]]]
key_store(topic: str, key: bytes) → yarl.URL[source]
Return type:URL
is_active(tp: faust.types.tuples.TP) → bool[source]
Return type:bool
is_standby(tp: faust.types.tuples.TP) → bool[source]
Return type:bool