class documentation
class InMemoryExecutionStoreRepo(ExecutionStoreRepo): (source)
Constructor: InMemoryExecutionStoreRepo(dataset_id)
In-memory implementation of execution store repository.
Method | __init__ |
Initialize the execution store repository. |
Method | cleanup |
Delete all stores in the global store collection. |
Method | clear |
Clear all keys with either a ttl or policy="eviction". |
Method | count |
Count the number of keys in a store. |
Method | count |
Count the number of stores in the store collection. |
Method | count |
Count the number of stores in the global store collection. |
Method | create |
Create a store in the store collection. |
Method | delete |
Delete a key from a store. |
Method | delete |
Delete a store. |
Method | delete |
Delete a store from the global store collection. |
Method | get |
Get a key from a store. |
Method | get |
Get a store from the store collection. |
Method | has |
Check if a key exists in a store. |
Method | has |
Check if a store exists in the store collection. |
Method | has |
Check if a store exists in the global store collection. |
Method | list |
List all keys in a store. |
Method | list |
List all stores in the store collection. |
Method | list |
List all stores in the global store collection. |
Method | set |
Set a cache key in a store. |
Method | set |
Set a key in a store. |
Method | update |
Undocumented |
Method | update |
Update the TTL of a key. |
Method | _doc |
Undocumented |
Instance Variable | _docs |
Undocumented |
Inherited from ExecutionStoreRepo
:
Instance Variable | _dataset |
Undocumented |
def create_store(self, store_name:
str
, metadata: dict[ str, Any] | None
= None, policy: str
= 'persist') -> StoreDocument
:
(source)
¶
Get a key from a store.
Parameters | |
storestr | the name of the store to get the key from |
key:str | the key to get |
Returns | |
Optional[KeyDocument] | the key document, or None if the key does not exist |
Get a store from the store collection.
Parameters | |
storestr | the name of the store to get |
Returns | |
Optional[StoreDocument] | the store document, or None if the store does not exist |
def set_key(self, store_name:
str
, key: str
, value: Any
, ttl: int | None
= None, policy: str
= 'persist') -> KeyDocument
:
(source)
¶
Set a key in a store.
Parameters | |
storestr | The name of the store to set the key in. |
key:str | The key to set. |
value:Any | The value to associate with the key. |
ttl:Optional[int] | Optional TTL (in seconds) after which the key will expire and be automatically removed. |
policy:str | The eviction policy for the key. One of: - "persist" (default): Key is persistent until deleted. - "evict": Key is eligible for eviction or cache clearing. |
Returns | |
KeyDocument | The created or updated key document. |