faust.tables.recovery
¶
Table recovery after rebalancing.
- exception faust.tables.recovery.RebalanceAgain[source]¶
During rebalance, another rebalance happened.
- class faust.tables.recovery.Recovery(app: AppT, tables: TableManagerT, **kwargs: Any)[source]¶
Service responsible for recovering tables from changelog topics.
- num_samples_required_for_estimate = 1000¶
Number of entries in _processing_times before we can give an estimate of time remaining.
- tables: _TableManager¶
- tp_to_table: MutableMapping[TP, CollectionT]¶
Mapping from topic partition to table
- completed: Event¶
- buffers: MutableMapping[CollectionT, List[EventT]]¶
Changelog event buffers by table. These are filled by background task _slurp_changelog, and need to be flushed before starting new recovery/stopping.
- buffer_sizes: MutableMapping[TP, int]¶
Cache of max buffer size by topic partition..
- actives_for_table: MutableMapping[CollectionT, Set[TP]]¶
- standbys_for_table: MutableMapping[CollectionT, Set[TP]]¶
- property signal_recovery_start: Event¶
Event used to signal that recovery has started. :rtype:
Event
- property signal_recovery_end: Event¶
Event used to signal that recovery has ended. :rtype:
Event
- add_active(table: CollectionT, tp: TP) None [source]¶
Add changelog partition to be used for active recovery.
- Return type:
None
- add_standby(table: CollectionT, tp: TP) None [source]¶
Add changelog partition to be used for standby recovery.
- Return type:
None
- on_partitions_revoked(revoked: Set[TP]) None [source]¶
Call when rebalancing and partitions are revoked.
- Return type:
None
- async on_rebalance(assigned: Set[TP], revoked: Set[TP], newly_assigned: Set[TP], generation_id: int = 0) None [source]¶
Call when cluster is rebalancing.
- Return type:
None
- async on_recovery_completed(generation_id: int = 0) None [source]¶
Call when active table recovery is completed.
- Return type:
None
- logger: logging.Logger = <Logger faust.tables.recovery (WARNING)>¶
- active_remaining() Counter[TP] [source]¶
Return counter of remaining changes by active partition.
- Return type:
_GenericAlias
[TP
]
- standby_remaining() Counter[TP] [source]¶
Return counter of remaining changes by standby partition.
- Return type:
_GenericAlias
[TP
]
- active_remaining_total() int [source]¶
Return number of changes remaining for actives to be up-to-date.
- Return type:
- standby_remaining_total() int [source]¶
Return number of changes remaining for standbys to be up-to-date.
- Return type:
- active_stats() Mapping[TP, RecoveryStats] [source]¶
Return current active recovery statistics.
- Return type:
_GenericAlias
[TP
,RecoveryStats
]
- standby_stats() Mapping[TP, RecoveryStats] [source]¶
Return current standby recovery statistics.
- Return type:
_GenericAlias
[TP
,RecoveryStats
]