faust.stores.memory
¶
In-memory table storage.
- class faust.stores.memory.Store(url: Union[str, URL], app: AppT, table: CollectionT, *, table_name: str = '', key_type: Optional[Union[Type[ModelT], Type[bytes], Type[str]]] = None, value_type: Optional[Union[Type[ModelT], Type[bytes], Type[str]]] = None, key_serializer: Optional[Union[CodecT, str]] = None, value_serializer: Optional[Union[CodecT, str]] = None, options: Optional[Mapping[str, Any]] = None, **kwargs: Any)[source]¶
Table storage using an in-memory dictionary.
- apply_changelog_batch(batch: Iterable[EventT], to_key: Callable[[Any], Any], to_value: Callable[[Any], Any]) None [source]¶
Apply batch of changelog events to in-memory table.
- Return type:
None
- async on_recovery_completed(active_tps: Set[TP], standby_tps: Set[TP]) None [source]¶
Signal that table recovery completed.
- Return type:
None
- persisted_offset(tp: TP) Optional[int] [source]¶
Return the persisted offset.
This always returns
None
when using the in-memory store.- Return type:
_UnionGenericAlias
[int
,None
]
- reset_state() None [source]¶
Remove local file system state.
This does nothing when using the in-memory store.
- Return type:
None
- async backup_partition(tp: Union[TP, int], flush: bool = True, purge: bool = False, keep: int = 1) None [source]¶
Backup partition from this store.
This does nothing when using the in-memory store.
- Return type:
None
- restore_backup(tp: Union[TP, int], latest: bool = True, backup_id: int = 0) None [source]¶
Restore partition backup from this store.
This does nothing when using the in-memory store.
- Return type:
None
- logger: logging.Logger = <Logger faust.stores.memory (WARNING)>¶