faust.assignor.client_assignment
¶
Client Assignment.
- class faust.assignor.client_assignment.CopartitionedAssignment(actives: Optional[Set[int]] = None, standbys: Optional[Set[int]] = None, topics: Optional[Set[str]] = None)[source]¶
Copartitioned Assignment.
- class faust.assignor.client_assignment.ClientAssignment(actives, standbys, *, __strict__=True, __faust=None, **kwargs)[source]¶
Client Assignment data model.
- actives: MutableMapping[str, List[int]]¶
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:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- standbys: MutableMapping[str, List[int]]¶
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:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- add_copartitioned_assignment(assignment: CopartitionedAssignment) None [source]¶
- Return type:
None
- copartitioned_assignment(topics: Set[str]) CopartitionedAssignment [source]¶
- Return type:
- asdict()¶
Convert record to Python dictionary.
- class faust.assignor.client_assignment.ClientMetadata(assignment, url, changelog_distribution, external_topic_distribution=None, topic_groups=None, *, __strict__=True, __faust=None, **kwargs)[source]¶
Client Metadata data model.
- assignment: 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:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- changelog_distribution: MutableMapping[str, MutableMapping[str, List[int]]]¶
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:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- asdict()¶
Convert record to Python dictionary.
- external_topic_distribution: MutableMapping[str, MutableMapping[str, List[int]]]¶
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:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- topic_groups: Mapping[str, int]¶
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:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.