fiftyone.operators.store.models¶
Execution store models.
Classes:
|
Defines the eviction policy for a key in the execution store. |
|
Model representing a key in the store. |
|
Model representing a Store. |
-
class
fiftyone.operators.store.models.
KeyPolicy
(value)¶ Bases:
str
,enum.Enum
Defines the eviction policy for a key in the execution store.
PERSIST
: The key is stored persistently and will never be automatically removed. It must be explicitly deleted.EVICT
: The key is considered cacheable and may be removed automatically if a TTL is set, or manually viaclear_cache()
.
Attributes:
-
PERSIST
= 'persist'¶
-
EVICT
= 'evict'¶
-
class
fiftyone.operators.store.models.
KeyDocument
(store_name: str, key: str, value: Any, _id: Optional[Any] = None, dataset_id: Optional[bson.objectid.ObjectId] = None, created_at: datetime.datetime = <factory>, updated_at: Optional[datetime.datetime] = None, expires_at: Optional[datetime.datetime] = None, policy: fiftyone.operators.store.models.KeyPolicy = <KeyPolicy.PERSIST: 'persist'>)¶ Bases:
object
Model representing a key in the store.
Attributes:
Methods:
get_expiration
(ttl)Gets the expiration date for a key with the given TTL.
from_dict
(doc)Creates a KeyDocument from a dictionary.
to_mongo_dict
([exclude_id])Serializes the document to a MongoDB dictionary.
-
store_name
: str¶
-
key
: str¶
-
value
: Any¶
-
dataset_id
: Optional[bson.objectid.ObjectId] = None¶
-
created_at
: datetime.datetime¶
-
updated_at
: Optional[datetime.datetime] = None¶
-
expires_at
: Optional[datetime.datetime] = None¶
-
policy
: fiftyone.operators.store.models.KeyPolicy = 'persist'¶
-
static
get_expiration
(ttl: Optional[int]) → Optional[datetime.datetime]¶ Gets the expiration date for a key with the given TTL.
-
classmethod
from_dict
(doc: dict) → fiftyone.operators.store.models.KeyDocument¶ Creates a KeyDocument from a dictionary.
-
to_mongo_dict
(exclude_id: bool = True) → dict¶ Serializes the document to a MongoDB dictionary.
-
-
class
fiftyone.operators.store.models.
StoreDocument
(store_name: str, key: str = '__store__', value: Optional[dict] = None, _id: Optional[Any] = None, dataset_id: Optional[bson.objectid.ObjectId] = None, created_at: datetime.datetime = <factory>, updated_at: Optional[datetime.datetime] = None, expires_at: Optional[datetime.datetime] = None, policy: fiftyone.operators.store.models.KeyPolicy = <KeyPolicy.PERSIST: 'persist'>)¶ Bases:
fiftyone.operators.store.models.KeyDocument
Model representing a Store.
Attributes:
The metadata associated with the store.
Methods:
from_dict
(doc)Creates a KeyDocument from a dictionary.
get_expiration
(ttl)Gets the expiration date for a key with the given TTL.
to_mongo_dict
([exclude_id])Serializes the document to a MongoDB dictionary.
-
key
: str = '__store__'¶
-
value
: Optional[dict] = None¶
-
property
metadata
¶ The metadata associated with the store.
-
dataset_id
: Optional[bson.objectid.ObjectId] = None¶
-
expires_at
: Optional[datetime.datetime] = None¶
-
classmethod
from_dict
(doc: dict) → fiftyone.operators.store.models.KeyDocument¶ Creates a KeyDocument from a dictionary.
-
static
get_expiration
(ttl: Optional[int]) → Optional[datetime.datetime]¶ Gets the expiration date for a key with the given TTL.
-
policy
: fiftyone.operators.store.models.KeyPolicy = 'persist'¶
-
to_mongo_dict
(exclude_id: bool = True) → dict¶ Serializes the document to a MongoDB dictionary.
-
updated_at
: Optional[datetime.datetime] = None¶
-
store_name
: str¶
-
created_at
: datetime.datetime¶
-