faust.tables.base
¶
Base class Collection for Table and future data structures.
-
class
faust.tables.base.
Collection
(app: faust.types.app.AppT, *, name: str = None, default: Callable[Any] = None, store: Union[str, yarl.URL] = None, schema: faust.types.serializers.SchemaT = None, key_type: Union[Type[faust.types.models.ModelT], Type[bytes], Type[str]] = None, value_type: Union[Type[faust.types.models.ModelT], Type[bytes], Type[str]] = None, partitions: int = None, window: faust.types.windows.WindowT = None, changelog_topic: faust.types.topics.TopicT = None, help: str = None, on_recover: Callable[Awaitable[None]] = None, on_changelog_event: Callable[faust.types.events.EventT, Awaitable[None]] = None, recovery_buffer_size: int = 1000, standby_buffer_size: int = None, extra_topic_configs: Mapping[str, Any] = None, recover_callbacks: Set[Callable[Awaitable[None]]] = None, options: Mapping[str, Any] = None, use_partitioner: bool = False, on_window_close: Callable[[Any, Any], None] = None, **kwargs: Any) → None[source]¶ Base class for changelog-backed data structures stored in Kafka.
-
property
data
¶ Underlying table storage.
-
on_recover
(fun: Callable[Awaitable[None]]) → Callable[Awaitable[None]][source]¶ Add function as callback to be called on table recovery.
-
persisted_offset
(tp: faust.types.tuples.TP) → Optional[int][source]¶ Return the last persisted offset for topic partition.
-
async
need_active_standby_for
(tp: faust.types.tuples.TP) → bool[source]¶ Return
False
if we have access to partition data.- Return type
-
send_changelog
(partition: Optional[int], key: Any, value: Any, key_serializer: Union[faust.types.codecs.CodecT, str, None] = None, value_serializer: Union[faust.types.codecs.CodecT, str, None] = None) → faust.types.tuples.FutureMessage[source]¶ Send modification event to changelog topic.
- Return type
-
partition_for_key
(key: Any) → Optional[int][source]¶ Return partition number for table key. c
- Note:
If
use_partitioner
is enabled this always returnsNone
.- Returns:
- Optional[int]: specific partition or
None
if the producer should select partition using its partitioner.
- Optional[int]: specific partition or
-
join
(*fields: faust.types.models.FieldDescriptorT) → faust.types.streams.StreamT[source]¶ Right join of this table and another stream/table.
- Return type
StreamT
[+T_co]
-
left_join
(*fields: faust.types.models.FieldDescriptorT) → faust.types.streams.StreamT[source]¶ Left join of this table and another stream/table.
- Return type
StreamT
[+T_co]
-
inner_join
(*fields: faust.types.models.FieldDescriptorT) → faust.types.streams.StreamT[source]¶ Inner join of this table and another stream/table.
- Return type
StreamT
[+T_co]
-
outer_join
(*fields: faust.types.models.FieldDescriptorT) → faust.types.streams.StreamT[source]¶ Outer join of this table and another stream/table.
- Return type
StreamT
[+T_co]
-
combine
(*nodes: faust.types.streams.JoinableT, **kwargs: Any) → faust.types.streams.StreamT[source]¶ Combine tables and streams.
- Return type
StreamT
[+T_co]
-
contribute_to_stream
(active: faust.types.streams.StreamT) → None[source]¶ Contribute table to stream join.
- Return type
None
-
async
remove_from_stream
(stream: faust.types.streams.StreamT) → None[source]¶ Remove table from stream join after stream stopped.
- Return type
None
-
async
on_rebalance
(assigned: Set[faust.types.tuples.TP], revoked: Set[faust.types.tuples.TP], newly_assigned: Set[faust.types.tuples.TP]) → None[source]¶ Call when cluster is rebalancing.
- Return type
None
-
async
on_recovery_completed
(active_tps: Set[faust.types.tuples.TP], standby_tps: Set[faust.types.tuples.TP]) → None[source]¶ Call when recovery has completed after rebalancing.
- Return type
None
-
async
call_recover_callbacks
() → None[source]¶ Call any configured recovery callbacks after rebalancing.
- Return type
None
-
async
on_changelog_event
(event: faust.types.events.EventT) → None[source]¶ Call when a new changelog event is received.
- Return type
None
-
logger
= <Logger faust.tables.base (WARNING)>¶
-
property