faust.assignor.cluster_assignment

Cluster assignment.

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

Cluster assignment state.

subscriptions: MutableMapping[str, Sequence[str]]

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: MutableMapping[str, ClientAssignment]

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:

_GenericAlias[str]

add_client(client: str, subscription: List[str], metadata: ClientMetadata) None[source]
Return type:

None

copartitioned_assignments(copartitioned_topics: Set[str]) MutableMapping[str, CopartitionedAssignment][source]
Return type:

_GenericAlias[str, CopartitionedAssignment]

asdict()

Convert record to Python dictionary.