tdfs4ds.serve.time_drivers¶
tdfs4ds.serve.time_drivers
¶
Report section "Time drivers": which TimeManager drives each process, and how synchronised processes are (0.3.1.240).
Three layers, like store_consistency: :func:collect_time_drivers is the only
I/O, :func:time_driver_model is pure, :func:render_time_drivers returns HTML.
Per process: the declared TimeManager (FS_TIME_MANAGER), the one its view reads
(lineage, deep), a status, the manager's current business date and the last business
date the process completed.
================= ======================================================================
status meaning
================= ======================================================================
OK declared and read: run(pid) computes at the manager's date
UNDECLARED read, not declared: run(pid) stamps the real time
MISMATCH declares one manager, reads another
DECLARED_UNUSED declared, not read: values carry a date they were not computed at
NONE no TimeManager (real time or FEATURE_STORE_TIME)
UNKNOWN the lineage graph does not know the process view
================= ======================================================================
Synchronisation groups: processes on the same manager view share one cursor (synchronised); managers reading the same hidden table are soft clones (same dates, own cursors); managers whose tables hold the same dates are hard clones (copies); the rest are independent.
STATUS_LABELS
module-attribute
¶
STATUS_LABELS = {'OK': 'declared and read', 'UNDECLARED': 'read but not declared', 'MISMATCH': 'declares another manager than it reads', 'DECLARED_UNUSED': 'declared but not read', 'NONE': 'no TimeManager', 'UNKNOWN': 'not in the lineage graph'}
FIXES
module-attribute
¶
FIXES = {'UNDECLARED': "tdfs4ds.link_time_managers(process_ids=['{pid}'], dry_run=False)", 'MISMATCH': "tdfs4ds.link_time_managers(process_ids=['{pid}'], dry_run=False)", 'DECLARED_UNUSED': 'make the view read {declared}, or run it without a TimeManager', 'UNKNOWN': "tdfs4ds.rebuild_lineage_graph(objects=['{view}'], check=True)"}
GROUP_LABELS
module-attribute
¶
GROUP_LABELS = {'synchronised': 'Synchronised - one manager, one cursor', 'soft_clones': 'Same timeline, own cursors (soft clones)', 'hard_clones': 'Copies of a timeline (hard clones)', 'independent': 'Independent'}
time_driver_model
¶
time_driver_model(processes, graph=None, registry=None, manager_dates=None, content_keys=None, last_business=None, domain_clocks=None) -> Dict[str, Any]
Pure model. manager_dates: {view_node: 'YYYY-MM-DD'}; content_keys:
{view_node: hash}; last_business: {pid: date}; domain_clocks:
{data_domain: {database, view, table_database, table}} (0.3.6.0).
collect_time_drivers
¶
collect_time_drivers(processes, followup=None, max_managers: int = 50, graph=None, as_of=None) -> Dict[str, Any]
Read what the model needs (lineage graph, registry, manager dates, contents).
graph: an already loaded lineage graph (else it is read, at as_of when given). Manager dates are always the cursors' current dates.
render_time_drivers
¶
HTML body (uses the consistency section's CSS classes).