Skip to content

tdfs4ds.utils.manager_registry

tdfs4ds.utils.manager_registry

Registry of TimeManager / FilterManager objects (0.3.1.240, optional).

FS_MANAGER_REGISTRY (temporal) + FS_V_MANAGER_REGISTRY record one row per manager object: its view, the hidden table it reads (possibly another manager's, for a soft clone), what it was cloned from and how. The process <-> manager links stay in FS_TIME_MANAGER / FS_FILTER_MANAGER, unchanged.

The registry is optional, like the dataset _BUILD table:

  • created by setup() / connect(); a failed create is a warning, remembered for the process and not retried;
  • written best effort by TimeManager.load_time_steps / clone_timer / take_ownership and their FilterManager counterparts - a registry failure never fails the manager operation;
  • read by the Report's time drivers and by the lineage check, which fall back to inference (lineage + structure) without it. Older clients ignore it.

Managers created before it are backfilled by :func:register_managers.

logger module-attribute

logger = getLogger(__name__)

REGISTRY_NAME module-attribute

REGISTRY_NAME = 'FS_MANAGER_REGISTRY'

REGISTRY_VIEW module-attribute

REGISTRY_VIEW = 'FS_V_MANAGER_REGISTRY'

_UNAVAILABLE module-attribute

_UNAVAILABLE = {'flag': False}

COLUMNS module-attribute

COLUMNS = ('KIND', 'DATABASE_NAME', 'VIEW_NAME', 'TABLE_DATABASE_NAME', 'TABLE_NAME', 'CLONE_OF_DATABASE', 'CLONE_OF_VIEW', 'CLONE_MODE', 'CREATED_BY')

_lit

_lit(v) -> str

registry_ddl

registry_ddl() -> tuple

(create_table, create_view) statements.

manager_registry_creation

manager_registry_creation() -> bool

Create the registry if missing. Never raises; False when unavailable.

upsert_sql

upsert_sql(kind, database, view, table_database=None, table=None, clone_of_database=None, clone_of_view=None, clone_mode=None) -> str

The registry upsert (keyed on the primary index: database + view).

register_manager

register_manager(manager, kind: str, *, table_database=None, clone_of=None, clone_mode: Optional[str] = None) -> bool

Record manager (best effort; never raises, never fails the caller).

unregister_manager

unregister_manager(manager) -> bool

End the registry row of a dropped manager (best effort, never raises).

read_registry

read_registry(all_stores: bool = True)

Registry rows as a pandas DataFrame, or None when unavailable.

all_stores: also the registries of the attached read-only stores that have one (0.3.3.15; rows name their managers by absolute database, so a row is never mistaken for another store's). False: the primary's only, for what writes to it.

register_managers

register_managers(dry_run: bool = True, *, graph=None, proc_df=None)

Backfill the registry with the managers the store already uses.

Managers come from the process catalog (TIME_* / FILTER_*). For each, the lineage graph tells which hidden table its view reads: another manager's table is a soft clone of that manager; a table of its own is the manager itself. Hard clones (a copy of another manager's table) are not detectable from the lineage alone and are left as plain managers; the Report compares contents.

Returns a pandas DataFrame of the rows (ACTION = INSERT / OK); dry_run=False writes them.