DatastoreRegistryBridgeManager

class lsst.daf.butler.registry.interfaces.DatastoreRegistryBridgeManager(*, opaque: OpaqueTableStorageManager, universe: DimensionUniverse, registry_schema_version: VersionTuple | None = None)

Bases: VersionedExtension

An abstract base class that defines the interface between Registry and Datastore when a new Datastore is constructed.

Parameters:
opaqueOpaqueTableStorageManager

Manager object for opaque table storage in the Registry.

universeDimensionUniverse

All dimensions know to the Registry.

registry_schema_versionVersionTuple or None, optional

Version of registry schema.

Notes

Datastores are passed an instance of DatastoreRegistryBridgeManager at construction, and should use it to obtain and keep any of the following:

  • a DatastoreRegistryBridge instance to record in the Registry what is present in the datastore (needed by all datastores that are not just forwarders);

  • one or more OpaqueTableStorage instance if they wish to store internal records in the Registry database;

  • the DimensionUniverse, if they need it to (e.g.) construct or validate filename templates.

Methods Summary

clone(*, db, opaque)

Make an independent copy of this manager instance bound to new instances of Database and other managers.

findDatastores(ref)

Retrieve datastore locations for a given dataset.

initialize(db, context, *, opaque, datasets, ...)

Construct an instance of the manager.

refresh()

Ensure all other operations on this manager are aware of any collections that may have been registered by other clients since it was initialized or last refreshed.

register(name, *[, ephemeral])

Register a new Datastore associated with this Registry.

Methods Documentation

abstract clone(*, db: Database, opaque: OpaqueTableStorageManager) DatastoreRegistryBridgeManager

Make an independent copy of this manager instance bound to new instances of Database and other managers.

Parameters:
dbDatabase

New Database object to use when instantiating the manager.

opaqueOpaqueTableStorageManager

New OpaqueTableStorageManager object to use when instantiating the manager.

Returns:
instanceDatastoreRegistryBridgeManager

New manager instance with the same configuration as this instance, but bound to a new Database object.

abstract findDatastores(ref: DatasetRef | FakeDatasetRef) Iterable[str]

Retrieve datastore locations for a given dataset.

Parameters:
refDatasetIdRef

A reference to the dataset for which to retrieve storage information.

Returns:
datastoresIterable [ str ]

All the matching datastores holding this dataset. Empty if the dataset does not exist anywhere.

Raises:
AmbiguousDatasetError

Raised if ref.id is None.

abstract classmethod initialize(db: Database, context: StaticTablesContext, *, opaque: OpaqueTableStorageManager, datasets: type[DatasetRecordStorageManager], universe: DimensionUniverse, registry_schema_version: VersionTuple | None = None) DatastoreRegistryBridgeManager

Construct an instance of the manager.

Parameters:
dbDatabase

Interface to the underlying database engine and namespace.

contextStaticTablesContext

Context object obtained from Database.declareStaticTables; used to declare any tables that should always be present in a layer implemented with this manager.

opaqueOpaqueTableStorageManager

Registry manager object for opaque (to Registry) tables, provided to allow Datastores to store their internal information inside the Registry database.

datasetssubclass of DatasetRecordStorageManager

Concrete class that will be used to manage the core dataset tables in this registry; should be used only to create foreign keys to those tables.

universeDimensionUniverse

All dimensions known to the registry.

registry_schema_versionVersionTuple or None

Schema version of this extension as defined in registry.

Returns:
managerDatastoreRegistryBridgeManager

An instance of a concrete DatastoreRegistryBridgeManager subclass.

abstract refresh() None

Ensure all other operations on this manager are aware of any collections that may have been registered by other clients since it was initialized or last refreshed.

abstract register(name: str, *, ephemeral: bool = True) DatastoreRegistryBridge

Register a new Datastore associated with this Registry.

This method should be called by all Datastore classes aside from those that only forward storage to other datastores.

Parameters:
namestr

Name of the datastore, as it should appear in Registry tables.

ephemeralbool, optional

If True (False is default), return a bridge object that is backed by storage that will not last past the end of the current process. This should be used whenever the same is true of the dataset’s artifacts.

Returns:
bridgeDatastoreRegistryBridge

Object that provides the interface this Datastore should use to communicate with the Registry.