class documentation

Base class for execution store repositories.

Each instance of this repository has a context:

  • If a dataset_id is provided, it operates on stores associated with that dataset
  • If no dataset_id is provided, it operates on stores that are not associated with a dataset

To operate on all stores across all contexts, use the XXX_global() methods that this class provides.

Method __init__ Undocumented
Method cleanup Deletes all stores and keys associated with the current context.
Method count_keys Counts the keys in the specified store.
Method count_stores Counts the stores associated with the current context.
Method count_stores_global Counts stores across all datasets and the global context.
Method create_store Creates a store associated with the current context.
Method delete_key Deletes the document that matches the store name and key, if one exists.
Method delete_store Deletes the specified store.
Method delete_store_global Deletes the specified store across all datasets and the global context.
Method get_key Gets a key from the specified store.
Method get_store Gets a store associated with the current context.
Method has_key Determines whether a key exists in the specified store.
Method has_store Checks whether a store with the given name exists in the current context.
Method has_store_global Determines whether a store with the given name exists across all datasets and the global context.
Method list_keys Lists all keys in the specified store.
Method list_stores Lists the stores associated with the current context.
Method list_stores_global Lists stores across all datasets and the global context.
Method set_key Sets or updates a key in the specified store.
Method update_ttl Updates the TTL for a key.
Constant COLLECTION_NAME Undocumented
Instance Variable _collection Undocumented
Instance Variable _dataset_id Undocumented
def __init__(self, collection: Collection, dataset_id: ObjectId = None): (source)
def cleanup(self) -> int: (source)

Deletes all stores and keys associated with the current context.

def count_keys(self, store_name) -> int: (source)

Counts the keys in the specified store.

def count_stores(self) -> int: (source)

Counts the stores associated with the current context.

def count_stores_global(self) -> int: (source)

Counts stores across all datasets and the global context.

def create_store(self, store_name, metadata: dict[str, Any] = None) -> StoreDocument: (source)

Creates a store associated with the current context.

def delete_key(self, store_name, key) -> bool: (source)

Deletes the document that matches the store name and key, if one exists.

def delete_store(self, store_name) -> int: (source)

Deletes the specified store.

def delete_store_global(self, store_name) -> int: (source)

Deletes the specified store across all datasets and the global context.

def get_key(self, store_name, key) -> KeyDocument: (source)

Gets a key from the specified store.

def get_store(self, store_name) -> StoreDocument: (source)

Gets a store associated with the current context.

def has_key(self, store_name, key) -> bool: (source)

Determines whether a key exists in the specified store.

def has_store(self, store_name) -> bool: (source)

Checks whether a store with the given name exists in the current context.

def has_store_global(self, store_name): (source)

Determines whether a store with the given name exists across all datasets and the global context.

def list_keys(self, store_name) -> list[str]: (source)

Lists all keys in the specified store.

def list_stores(self) -> list[str]: (source)

Lists the stores associated with the current context.

def list_stores_global(self) -> list[StoreDocument]: (source)

Lists stores across all datasets and the global context.

def set_key(self, store_name, key, value, ttl=None) -> KeyDocument: (source)

Sets or updates a key in the specified store.

def update_ttl(self, store_name, key, ttl) -> bool: (source)

Updates the TTL for a key.

COLLECTION_NAME: str = (source)

Undocumented

Value
'execution_store'
_collection = (source)

Undocumented

_dataset_id = (source)

Undocumented