faust.assignor.cluster_assignment

Cluster assignment.

faust.assignor.cluster_assignment.CopartMapping

alias of typing.MutableMapping

class faust.assignor.cluster_assignment.ClusterAssignment(subscriptions=None, assignments=None, *, __strict__=True, __faust=None, **kwargs) → None[source]

Cluster assignment state.

subscriptions

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

assignments

Describes a field.

Used for every field in Record so that they can be used in join’s /group_by etc.

Examples

>>> class Withdrawal(Record):
...    account_id: str
...    amount: float = 0.0
>>> Withdrawal.account_id
<FieldDescriptor: Withdrawal.account_id: str>
>>> Withdrawal.amount
<FieldDescriptor: Withdrawal.amount: float = 0.0>
Parameters
  • field (str) – Name of field.

  • type (Type) – Field value type.

  • required (bool) – Set to false if field is optional.

  • default (Any) – Default value when required=False.

Keyword Arguments
  • model (Type) – Model class the field belongs to.

  • parent (FieldDescriptorT) – parent field if any.

topics() → Set[str][source]
Return type

Set[str]

add_client(client: str, subscription: List[str], metadata: faust.assignor.client_assignment.ClientMetadata) → None[source]
Return type

None

copartitioned_assignments(copartitioned_topics: Set[str]) → MutableMapping[str, faust.assignor.client_assignment.CopartitionedAssignment][source]
Return type

MutableMapping[str, CopartitionedAssignment]

asdict()