class documentation

Execution store.

Parameters
store_namethe name of the store
store_servicean fiftyone.operators.store.service.ExecutionStoreService
default_policythe default eviction policy for the store.
Static Method create Undocumented
Method __init__ Undocumented
Method clear Clears all the data in the store.
Method clear_cache Clears the cache for the store.
Method delete Deletes a key from the store.
Method get Retrieves a value from the store by its key.
Method get_metadata Retrieves the metadata for the given key.
Method has Checks if the store has a specific key.
Method list_keys Lists all keys in the store.
Method list_stores Lists all stores in the execution store.
Method set Sets the value of a key in the specified store.
Method set_cache Sets a value in the store with the eviction policy set to "evict".
Method update_policy Updates the eviction policy for a specific key.
Method update_ttl Updates the TTL for a specific key.
Instance Variable store_name Undocumented
Instance Variable _default_policy Undocumented
Instance Variable _store_service Undocumented
@staticmethod
def create(store_name: str, dataset_id: ObjectId | None = None, default_policy: str = 'persist', collection_name: str | None = None) -> ExecutionStore: (source)

Undocumented

def __init__(self, store_name: str, store_service: ExecutionStoreService, default_policy: str = 'persist'): (source)

Undocumented

def clear(self): (source)

Clears all the data in the store.

def clear_cache(self): (source)

Clears the cache for the store.

This will remove all keys that are eligible for eviction.

def delete(self, key: str) -> bool: (source)

Deletes a key from the store.

Parameters
key:strthe key to delete.
Returns
boolTrue/False whether the key was deleted
def get(self, key: str) -> Any | None: (source)

Retrieves a value from the store by its key.

Parameters
key:strthe key to retrieve the value for
Returns
Any | Nonethe value stored under the given key, or None if not found
def get_metadata(self, key: str) -> dict | None: (source)

Retrieves the metadata for the given key.

Parameters
key:strthe key to check
Returns
dict | Nonea dict of metadata about the key
def has(self, key: str) -> bool: (source)

Checks if the store has a specific key.

Parameters
key:strthe key to check
Returns
boolTrue/False whether the key exists
def list_keys(self) -> list[str]: (source)

Lists all keys in the store.

Returns
list[str]a list of keys in the store
def list_stores(self) -> list[str]: (source)

Lists all stores in the execution store.

Returns
lista list of store names
def set(self, key: str, value: Any, ttl: int | None = None, policy=None): (source)

Sets the value of a key in the specified store.

Parameters
key:strthe key to set
value:Anythe value to set
ttl:Nonean optional TTL in seconds
policy:persistthe eviction policy for the key. Can be "persist" or "evict". If "persist", the key will never be automatically removed. If "evict", the key may be removed automatically if a TTL is set, or manually via clear_cache.
Returns
a fiftyone.store.models.KeyDocument
def set_cache(self, key: str, value: Any, ttl: int | None = None): (source)

Sets a value in the store with the eviction policy set to "evict".

Parameters
key:strthe key to store the value under
value:Anythe value to store
ttl:Nonethe time-to-live in seconds
def update_policy(self, key: str, policy: str): (source)

Updates the eviction policy for a specific key.

Parameters
key:strthe key to update the policy for
policy:strthe new policy, either "persist" or "evict"
def update_ttl(self, key: str, new_ttl: int): (source)

Updates the TTL for a specific key.

Parameters
key:strthe key to update the TTL for
new_ttl:intthe new TTL in seconds
store_name: str = (source)

Undocumented

_default_policy: str = (source)

Undocumented

Undocumented