Source code for fedn.network.storage.statestore.statestorebase

from abc import ABC, abstractmethod


[docs] class StateStoreBase(ABC): """ """ def __init__(self): pass
[docs] @abstractmethod def state(self): """Return the current state of the statestore.""" pass
[docs] @abstractmethod def transition(self, state): """Transition the statestore to a new state. :param state: The new state. :type state: str """ pass
[docs] @abstractmethod def set_latest_model(self, model_id): """Set the latest model id in the statestore. :param model_id: The model id. :type model_id: str """ pass
[docs] @abstractmethod def get_latest_model(self): """Get the latest model id from the statestore. :return: The model object. :rtype: ObjectId """ pass
[docs] @abstractmethod def is_inited(self): """Check if the statestore is initialized. :return: True if initialized, else False. :rtype: bool """ pass