plynx.db.node_cache_manager

Cache Manager and utils.

Module Contents

class plynx.db.node_cache_manager.NodeCacheManager[source]

The Node cache interface.

The cache is defined by Node’s
  • original_node_id
  • inputs
  • parameters
static get(node: Node)[source]

Pull NodeCache if exists.

Args:
node (Node): Node object
Return:
(NodeCache) NodeCache or None
static post(node: Node, run_id: ObjectId)[source]

Create NodeCache instance in the database.

Args:
node (Node): Node object run_id (ObjectId, str): Run ID
Return:
True if cache saved else False
static _make_query(start_datetime: Optional[datetime.datetime] = None, end_datetime: Optional[datetime.datetime] = None, non_protected_only: bool = False)[source]

Make sample query.

Args:
start_datetime (datetime, None): Start datetime or None if selecting from beginning end_datetime (datetime, None): End datetime or None if selecting until now
Return:
Iterator on the list of dict-like objects
static get_list(start_datetime: Optional[datetime.datetime] = None, end_datetime: Optional[datetime.datetime] = None, non_protected_only: bool = False)[source]

List of NodeCache objects.

Args:
start_datetime (datetime, None): Start datetime or None if selecting from beginning end_datetime (datetime, None): End datetime or None if selecting until now
Return:
Iterator on the list of dict-like objects
static clean_up()[source]

Remove NodeCache objects with flag removed set