faust.tables.objects

Storing objects in tables.

This is also used to store data structures such as sets/lists.

class faust.tables.objects.ChangeloggedObject(manager: faust.tables.objects.ChangeloggedObjectManager, key: Any) → None[source]

A changelogged object in a ChangeloggedObjectManager store.

abstract sync_from_storage(value: Any) → None[source]

Sync value from storage.

Return type

None

abstract as_stored_value() → Any[source]

Return value as represented in storage.

Return type

Any

abstract apply_changelog_event(operation: int, value: Any) → None[source]

Apply event in changelog topic to local table state.

Return type

None

class faust.tables.objects.ChangeloggedObjectManager(table: faust.tables.table.Table, **kwargs: Any) → None[source]

Store of changelogged objects.

send_changelog_event(key: Any, operation: int, value: Any) → None[source]

Send changelog event to the tables changelog topic.

Return type

None

async on_start() → None[source]

Call when the changelogged object manager starts.

Return type

None

async on_stop() → None[source]

Call when the changelogged object manager stops.

Return type

None

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

Get the last persisted offset for changelog topic partition.

Return type

Optional[int]

set_persisted_offset(tp: faust.types.tuples.TP, offset: int) → None[source]

Set the last persisted offset for changelog topic partition.

Return type

None

async on_rebalance(table: faust.types.tables.CollectionT, 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 table recovery is completed after rebalancing.

Return type

None

sync_from_storage() → None[source]

Sync set contents from storage.

Return type

None

flush_to_storage() → None[source]

Flush set contents to storage.

Return type

None

logger = <Logger faust.tables.objects (WARNING)>
reset_state() → None[source]

Reset table local state.

Return type

None

property storage

Return underlying storage used by this set table. :rtype: StoreT[~KT, ~VT]

apply_changelog_batch(batch: Iterable[faust.types.events.EventT], to_key: Callable[Any, Any], to_value: Callable[Any, Any]) → None[source]

Apply batch of changelog events to local state.

Return type

None