LSST Applications g00274db5b6+edbf708997,g00d0e8bbd7+edbf708997,g199a45376c+5137f08352,g1fd858c14a+1d4b6db739,g262e1987ae+f4d9505c4f,g29ae962dfc+7156fb1a53,g2cef7863aa+73c82f25e4,g35bb328faa+edbf708997,g3e17d7035e+5b3adc59f5,g3fd5ace14f+852fa6fbcb,g47891489e3+6dc8069a4c,g53246c7159+edbf708997,g64539dfbff+9f17e571f4,g67b6fd64d1+6dc8069a4c,g74acd417e5+ae494d68d9,g786e29fd12+af89c03590,g7ae74a0b1c+a25e60b391,g7aefaa3e3d+536efcc10a,g7cc15d900a+d121454f8d,g87389fa792+a4172ec7da,g89139ef638+6dc8069a4c,g8d7436a09f+28c28d8d6d,g8ea07a8fe4+db21c37724,g92c671f44c+9f17e571f4,g98df359435+b2e6376b13,g99af87f6a8+b0f4ad7b8d,gac66b60396+966efe6077,gb88ae4c679+7dec8f19df,gbaa8f7a6c5+38b34f4976,gbf99507273+edbf708997,gc24b5d6ed1+9f17e571f4,gca7fc764a6+6dc8069a4c,gcc769fe2a4+97d0256649,gd7ef33dd92+6dc8069a4c,gdab6d2f7ff+ae494d68d9,gdbb4c4dda9+9f17e571f4,ge410e46f29+6dc8069a4c,geaed405ab2+e194be0d2b,w.2025.47
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.dax.apdb.apdbReplica.ApdbReplica Class Reference
Inheritance diagram for lsst.dax.apdb.apdbReplica.ApdbReplica:
lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica

Public Member Functions

ApdbReplica from_config (cls, ApdbConfig config)
 
ApdbReplica from_uri (cls, ResourcePathExpression uri)
 
VersionTuple apdbReplicaImplementationVersion (cls)
 
VersionTuple schemaVersion (self)
 
list[ReplicaChunk]|None getReplicaChunks (self)
 
None deleteReplicaChunks (self, Iterable[int] chunks)
 
ApdbTableData getTableDataChunks (self, ApdbTables table, Iterable[int] chunks)
 
Sequence[ApdbUpdateRecordgetUpdateRecordChunks (self, Iterable[int] chunks)
 

Detailed Description

Abstract interface for APDB replication methods.

Definition at line 123 of file apdbReplica.py.

Member Function Documentation

◆ apdbReplicaImplementationVersion()

VersionTuple lsst.dax.apdb.apdbReplica.ApdbReplica.apdbReplicaImplementationVersion ( cls)
Return version number for current ApdbReplica implementation.

Returns
-------
version : `VersionTuple`
    Version of the code defined in implementation class.

Reimplemented in lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica, and lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica.

Definition at line 168 of file apdbReplica.py.

168 def apdbReplicaImplementationVersion(cls) -> VersionTuple:
169 """Return version number for current ApdbReplica implementation.
170
171 Returns
172 -------
173 version : `VersionTuple`
174 Version of the code defined in implementation class.
175 """
176 raise NotImplementedError()
177

◆ deleteReplicaChunks()

None lsst.dax.apdb.apdbReplica.ApdbReplica.deleteReplicaChunks ( self,
Iterable[int] chunks )
Remove replication chunks from the database.

Parameters
----------
chunks : `~collections.abc.Iterable` [`int`]
    Chunk identifiers to remove.

Notes
-----
This method causes Apdb to forget about specified chunks. If there
are any auxiliary data associated with the identifiers, it is also
removed from database (but data in regular tables is not removed).
This method should be called after successful transfer of data from
APDB to PPDB to free space used by replicas.

Reimplemented in lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica, and lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica.

Definition at line 203 of file apdbReplica.py.

203 def deleteReplicaChunks(self, chunks: Iterable[int]) -> None:
204 """Remove replication chunks from the database.
205
206 Parameters
207 ----------
208 chunks : `~collections.abc.Iterable` [`int`]
209 Chunk identifiers to remove.
210
211 Notes
212 -----
213 This method causes Apdb to forget about specified chunks. If there
214 are any auxiliary data associated with the identifiers, it is also
215 removed from database (but data in regular tables is not removed).
216 This method should be called after successful transfer of data from
217 APDB to PPDB to free space used by replicas.
218 """
219 raise NotImplementedError()
220

◆ from_config()

ApdbReplica lsst.dax.apdb.apdbReplica.ApdbReplica.from_config ( cls,
ApdbConfig config )
Create ApdbReplica instance from configuration object.

Parameters
----------
config : `ApdbConfig`
    Configuration object, type of this object determines type of the
    ApdbReplica implementation.

Returns
-------
replica : `ApdbReplica`
    Instance of `ApdbReplica` class.

Definition at line 127 of file apdbReplica.py.

127 def from_config(cls, config: ApdbConfig) -> ApdbReplica:
128 """Create ApdbReplica instance from configuration object.
129
130 Parameters
131 ----------
132 config : `ApdbConfig`
133 Configuration object, type of this object determines type of the
134 ApdbReplica implementation.
135
136 Returns
137 -------
138 replica : `ApdbReplica`
139 Instance of `ApdbReplica` class.
140 """
141 return make_apdb_replica(config)
142

◆ from_uri()

ApdbReplica lsst.dax.apdb.apdbReplica.ApdbReplica.from_uri ( cls,
ResourcePathExpression uri )
Make ApdbReplica instance from a serialized configuration.

Parameters
----------
uri : `~lsst.resources.ResourcePathExpression`
    URI or local file path pointing to a file with serialized
    configuration, or a string with a "label:" prefix. In the latter
    case, the configuration will be looked up from an APDB index file
    using the label name that follows the prefix. The APDB index file's
    location is determined by the ``DAX_APDB_INDEX_URI`` environment
    variable.

Returns
-------
replica : `ApdbReplica`
    Instance of `ApdbReplica` class, the type of the returned instance
    is determined by configuration.

Definition at line 144 of file apdbReplica.py.

144 def from_uri(cls, uri: ResourcePathExpression) -> ApdbReplica:
145 """Make ApdbReplica instance from a serialized configuration.
146
147 Parameters
148 ----------
149 uri : `~lsst.resources.ResourcePathExpression`
150 URI or local file path pointing to a file with serialized
151 configuration, or a string with a "label:" prefix. In the latter
152 case, the configuration will be looked up from an APDB index file
153 using the label name that follows the prefix. The APDB index file's
154 location is determined by the ``DAX_APDB_INDEX_URI`` environment
155 variable.
156
157 Returns
158 -------
159 replica : `ApdbReplica`
160 Instance of `ApdbReplica` class, the type of the returned instance
161 is determined by configuration.
162 """
163 config = ApdbConfig.from_uri(uri)
164 return make_apdb_replica(config)
165

◆ getReplicaChunks()

list[ReplicaChunk] | None lsst.dax.apdb.apdbReplica.ApdbReplica.getReplicaChunks ( self)
Return collection of replication chunks known to the database.

Returns
-------
chunks : `list` [`ReplicaChunk`] or `None`
    List of chunks, they may be time-ordered if database supports
    ordering. `None` is returned if database is not configured for
    replication.

Reimplemented in lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica, and lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica.

Definition at line 190 of file apdbReplica.py.

190 def getReplicaChunks(self) -> list[ReplicaChunk] | None:
191 """Return collection of replication chunks known to the database.
192
193 Returns
194 -------
195 chunks : `list` [`ReplicaChunk`] or `None`
196 List of chunks, they may be time-ordered if database supports
197 ordering. `None` is returned if database is not configured for
198 replication.
199 """
200 raise NotImplementedError()
201

◆ getTableDataChunks()

ApdbTableData lsst.dax.apdb.apdbReplica.ApdbReplica.getTableDataChunks ( self,
ApdbTables table,
Iterable[int] chunks )
Return catalog of new records for a table from given replica chunks.

Parameters
----------
table : `ApdbTables`
    Table for which to return the data. Acceptable tables are
    `ApdbTables.DiaObject`, `ApdbTables.DiaSource`, and
    `ApdbTables.DiaForcedSource`.
chunks : `~collections.abc.Iterable` [`int`]
    Chunk identifiers to return.

Returns
-------
data : `ApdbTableData`
    Catalog containing table records. In addition to all regular
    columns it will contain ``apdb_replica_chunk`` column.

Notes
-----
This method returns new records that have been added to the table by
`Apdb.store()` method. Updates to the records that happen at later time
are available from `getTableUpdateChunks` method.

This part of API may not be very stable and can change before the
implementation finalizes.

Reimplemented in lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica, and lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica.

Definition at line 222 of file apdbReplica.py.

222 def getTableDataChunks(self, table: ApdbTables, chunks: Iterable[int]) -> ApdbTableData:
223 """Return catalog of new records for a table from given replica chunks.
224
225 Parameters
226 ----------
227 table : `ApdbTables`
228 Table for which to return the data. Acceptable tables are
229 `ApdbTables.DiaObject`, `ApdbTables.DiaSource`, and
230 `ApdbTables.DiaForcedSource`.
231 chunks : `~collections.abc.Iterable` [`int`]
232 Chunk identifiers to return.
233
234 Returns
235 -------
236 data : `ApdbTableData`
237 Catalog containing table records. In addition to all regular
238 columns it will contain ``apdb_replica_chunk`` column.
239
240 Notes
241 -----
242 This method returns new records that have been added to the table by
243 `Apdb.store()` method. Updates to the records that happen at later time
244 are available from `getTableUpdateChunks` method.
245
246 This part of API may not be very stable and can change before the
247 implementation finalizes.
248 """
249 raise NotImplementedError()
250

◆ getUpdateRecordChunks()

Sequence[ApdbUpdateRecord] lsst.dax.apdb.apdbReplica.ApdbReplica.getUpdateRecordChunks ( self,
Iterable[int] chunks )
Return the list of record updates from given replica chunks.

Parameters
----------
chunks : `~collections.abc.Iterable` [`int`]
    Chunk identifiers to return.

Returns
-------
records : `~collections.abc.Sequence` [`ApdbUpdateRecord`]
    Collection of update records. Records will be sorted according
    their update time and update order.

Reimplemented in lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica, and lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica.

Definition at line 252 of file apdbReplica.py.

252 def getUpdateRecordChunks(self, chunks: Iterable[int]) -> Sequence[ApdbUpdateRecord]:
253 """Return the list of record updates from given replica chunks.
254
255 Parameters
256 ----------
257 chunks : `~collections.abc.Iterable` [`int`]
258 Chunk identifiers to return.
259
260 Returns
261 -------
262 records : `~collections.abc.Sequence` [`ApdbUpdateRecord`]
263 Collection of update records. Records will be sorted according
264 their update time and update order.
265 """
266 raise NotImplementedError()

◆ schemaVersion()

VersionTuple lsst.dax.apdb.apdbReplica.ApdbReplica.schemaVersion ( self)
Return version number of the database schema.

Returns
-------
version : `VersionTuple`
    Version of the database schema.

Reimplemented in lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica, and lsst.dax.apdb.sql.apdbSqlReplica.ApdbSqlReplica.

Definition at line 179 of file apdbReplica.py.

179 def schemaVersion(self) -> VersionTuple:
180 """Return version number of the database schema.
181
182 Returns
183 -------
184 version : `VersionTuple`
185 Version of the database schema.
186 """
187 raise NotImplementedError()
188

The documentation for this class was generated from the following file: