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: ChangeloggedObjectManager, key: Any)[source]

A changelogged object in a ChangeloggedObjectManager store.

manager: ChangeloggedObjectManager
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: Table, **kwargs: Any)[source]

Store of changelogged objects.

ValueType: ClassVar[Type[ChangeloggedObject]]
table: Table
data: MutableMapping
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

persisted_offset(tp: TP) Optional[int][source]

Get the last persisted offset for changelog topic partition.

Return type:

_UnionGenericAlias[int, None]

set_persisted_offset(tp: TP, offset: int) None[source]

Set the last persisted offset for changelog topic partition.

Return type:

None

async on_rebalance(table: CollectionT, assigned: Set[TP], revoked: Set[TP], newly_assigned: Set[TP]) None[source]

Call when cluster is rebalancing.

Return type:

None

async on_recovery_completed(active_tps: Set[TP], standby_tps: Set[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

reset_state() None[source]

Reset table local state.

Return type:

None

property storage: StoreT

Return underlying storage used by this set table. :rtype: StoreT

apply_changelog_batch(batch: Iterable[EventT], to_key: Callable[[Any], Any], to_value: Callable[[Any], Any]) None[source]

Apply batch of changelog events to local state.

Return type:

None

logger: logging.Logger = <Logger faust.tables.objects (WARNING)>
async backup_partition(tp, flush: bool = True, purge: bool = False, keep: int = 1) None[source]
Return type:

None

restore_backup(tp, latest: bool = True, backup_id: int = 0) None[source]
Return type:

None