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, 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, **kwargs) → 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.

Return type

Callable[[], Awaitable[None]]

info() → Mapping[str, Any][source]

Return table attributes as dictionary.

Return type

Mapping[str, Any]

persisted_offset(tp: faust.types.tuples.TP) → Optional[int][source]

Return the last persisted offset for topic partition.

Return type

Optional[int]

reset_state() → None[source]

Reset local state.

Return type

None

join(*fields) → faust.types.streams.StreamT[source]

Right join of this table and another stream/table.

Return type

StreamT[+T_co]

left_join(*fields) → faust.types.streams.StreamT[source]

Left join of this table and another stream/table.

Return type

StreamT[+T_co]

inner_join(*fields) → faust.types.streams.StreamT[source]

Inner join of this table and another stream/table.

Return type

StreamT[+T_co]

outer_join(*fields) → faust.types.streams.StreamT[source]

Outer join of this table and another stream/table.

Return type

StreamT[+T_co]

clone(**kwargs) → Any[source]

Clone table instance.

Return type

Any

combine(*nodes, **kwargs) → 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

property label

Return human-readable label used to represent this table. :rtype: str

property shortlabel

Return short label used to represent this table in logs. :rtype: str

logger = <Logger faust.tables.base (WARNING)>
property changelog_topic

Return the changelog topic used by this table. :rtype: TopicT[]

apply_changelog_batch(batch: Iterable[faust.types.events.EventT]) → None[source]

Apply batch of events from changelog topic local table storage.

Return type

None