ahvn.klstore.cascade_store module¶
- class ahvn.klstore.cascade_store.CascadeKLStore(stores=None, name=None, condition=None, *args, **kwargs)[源代码]¶
基类:
BaseKLStoreKLStore implementation that cascades through an ordered list of KLStores.
For get/has operations: tries each store in order until found. For remove/clear operations: operates on all stores. For upsert operations: raises an error, requiring upsert to individual stores. For iteration: returns deduplicated results from all stores.
- 参数:
stores (List[BaseKLStore]) -- Ordered list of KLStores to cascade through.
name (str)
condition (Callable | None)
- __init__(stores=None, name=None, condition=None, *args, **kwargs)[源代码]¶
Initialize CascadeKLStore with a list of stores.
- 参数:
stores (List[BaseKLStore]) -- Ordered list of KLStores.
name (
Optional[str]) -- Name of the KLStore instance. If None, defaults to "default".condition (
Optional[Callable]) -- Optional upsert/insert condition to apply to the KLStore. KLs that do not satisfy the condition will be ignored. If None, all KLs are accepted.*args -- Additional positional arguments for BaseKLStore.
**kwargs -- Additional keyword arguments for BaseKLStore.