OpaqueTableStorageManager¶
- class lsst.daf.butler.registry.interfaces.OpaqueTableStorageManager(*, registry_schema_version: VersionTuple | None = None)¶
Bases:
VersionedExtensionAn interface that manages the opaque tables in a
Registry.OpaqueTableStorageManagerprimarily serves as a container and factory forOpaqueTableStorageinstances, which each provide access to the records for a different (logical) opaque table.- Parameters:
- registry_schema_version
VersionTupleorNone, optional Version of registry schema.
- registry_schema_version
Notes
Opaque tables are primarily used by
Datastoreinstances to manage their internal data in the same database that hold theRegistry, but are not limited to this.While an opaque table in a multi-layer
Registrymay in fact be the union of multiple tables in different layers, we expect this to be rare, asRegistrylayers will typically correspond to different leafDatastoreinstances (each with their own opaque table) in aChainedDatastore.Methods Summary
clone(db)Make an independent copy of this manager instance bound to a new
Databaseinstance.get(name)Return an object that provides access to the records associated with an opaque logical table.
initialize(db, context[, ...])Construct an instance of the manager.
register(name, spec)Ensure that this layer can hold records for the given opaque logical table, creating new tables as necessary.
Methods Documentation
- abstract clone(db: Database) OpaqueTableStorageManager¶
Make an independent copy of this manager instance bound to a new
Databaseinstance.- Parameters:
- Returns:
- instance
OpaqueTableStorageManager New manager instance with the same configuration as this instance, but bound to a new Database object.
- instance
- abstract get(name: str) OpaqueTableStorage | None¶
Return an object that provides access to the records associated with an opaque logical table.
- Parameters:
- name
str Name of the logical table.
- name
- Returns:
- records
OpaqueTableStorageorNone The object representing the records for the given table in this layer, or
Noneif there are no records for that table in this layer.
- records
Notes
Opaque tables must be registered with the layer (see
register) by the same client before they can safely be retrieved withget. Unlike most other manager classes, the set of opaque tables cannot be obtained from an existing data repository.
- abstract classmethod initialize(db: Database, context: StaticTablesContext, registry_schema_version: VersionTuple | None = None) OpaqueTableStorageManager¶
Construct an instance of the manager.
- Parameters:
- db
Database Interface to the underlying database engine and namespace.
- context
StaticTablesContext Context object obtained from
Database.declareStaticTables; used to declare any tables that should always be present in a layer implemented with this manager.- registry_schema_version
VersionTupleorNone Schema version of this extension as defined in registry.
- db
- Returns:
- manager
OpaqueTableStorageManager An instance of a concrete
OpaqueTableStorageManagersubclass.
- manager
- abstract register(name: str, spec: TableSpec) OpaqueTableStorage¶
Ensure that this layer can hold records for the given opaque logical table, creating new tables as necessary.
- Parameters:
- name
str Name of the logical table.
- spec
TableSpec Schema specification for the table to be created.
- name
- Returns:
- records
OpaqueTableStorage The object representing the records for the given element in this layer.
- records
Notes
This operation may not be invoked within a transaction context block.