syft.core.store.store_interface

Classes

ObjectStore()

ObjectStore is the common interface for all the stores that a Node can handle.

class syft.core.store.store_interface.ObjectStore[source]

Bases: abc.ABC

ObjectStore is the common interface for all the stores that a Node can handle. This should provide a dict-like interface on handling data on a worker. Indexing should be always done by using UID objects, while de-indexed value should always be a SerizableObject.

keys()[source]

Method to return all indexes from the store.

Returns

an iterable containing the keys of the store.

Return type

Iterable[UID]

values()[source]

Method to return all values from the store.

Returns

an iterable containing the keys of the store.

Return type

Iterable[StorableObject]

delete(key)[source]

We should write custom deletion code so we can check if the item exists and then ensure deletion is called at a single place and that full __delitem__ is used where possible instead of the weaker del ref count. Also, care needs to be taken to not capture the deleted item in the Exception stack trace so it doesn’t keep the item around longer.

Method to remove an object from the store based on its UID.

Parameters

key (UID) – the key at which to delete the object.

Raises

ValueError – if the key is not present in the store.

clear()[source]

Clears all storage owned by the store.