fiftyone.operators.store.store¶
Execution store class.
Classes:
|
Execution store. |
-
class
fiftyone.operators.store.store.
ExecutionStore
(store_name: str, store_service: fiftyone.operators.store.service.ExecutionStoreService)¶ Bases:
object
Execution store.
- Parameters
store_name – the name of the store
store_service – an
fiftyone.operators.store.service.ExecutionStoreService
Methods:
create
(store_name[, dataset_id])Lists all stores in the execution store.
get
(key)Retrieves a value from the store by its key.
set
(key, value[, ttl])Sets a value in the store with an optional TTL.
delete
(key)Deletes a key from the store.
has
(key)Checks if the store has a specific key.
clear
()Clears all the data in the store.
update_ttl
(key, new_ttl)Updates the TTL for a specific key.
get_metadata
(key)Retrieves the metadata for the given key.
Lists all keys in the store.
-
static
create
(store_name: str, dataset_id: Optional[bson.objectid.ObjectId] = None) → fiftyone.operators.store.store.ExecutionStore¶
-
list_stores
() → list¶ Lists all stores in the execution store.
- Returns
a list of store names
- Return type
list
-
get
(key: str) → Optional[Any]¶ Retrieves a value from the store by its key.
- Parameters
key – the key to retrieve the value for
- Returns
the value stored under the given key, or None if not found
-
set
(key: str, value: Any, ttl: Optional[int] = None) → None¶ Sets a value in the store with an optional TTL.
- Parameters
key – the key to store the value under
value – the value to store
ttl (None) – the time-to-live in seconds
-
delete
(key: str) → bool¶ Deletes a key from the store.
- Parameters
key – the key to delete.
- Returns
True/False whether the key was deleted
-
has
(key: str) → bool¶ Checks if the store has a specific key.
- Parameters
key – the key to check
- Returns
True/False whether the key exists
-
clear
() → None¶ Clears all the data in the store.
-
update_ttl
(key: str, new_ttl: int) → None¶ Updates the TTL for a specific key.
- Parameters
key – the key to update the TTL for
new_ttl – the new TTL in seconds
-
get_metadata
(key: str) → Optional[dict]¶ Retrieves the metadata for the given key.
- Parameters
key – the key to check
- Returns
a dict of metadata about the key
-
list_keys
() → list¶ Lists all keys in the store.
- Returns
a list of keys in the store