LSST Applications g180d380827+6621f76652,g2079a07aa2+86d27d4dc4,g2305ad1205+f5a9e323a1,g2bbee38e9b+c6a8a0fb72,g337abbeb29+c6a8a0fb72,g33d1c0ed96+c6a8a0fb72,g3a166c0a6a+c6a8a0fb72,g3ddfee87b4+9a10e1fe7b,g48712c4677+c9a099281a,g487adcacf7+f2e03ea30b,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+aead732c78,g64a986408d+eddffb812c,g858d7b2824+eddffb812c,g864b0138d7+aa38e45daa,g974c55ee3d+f37bf00e57,g99cad8db69+119519a52d,g9c22b2923f+e2510deafe,g9ddcbc5298+9a081db1e4,ga1e77700b3+03d07e1c1f,gb0e22166c9+60f28cb32d,gb23b769143+eddffb812c,gba4ed39666+c2a2e4ac27,gbb8dafda3b+27317ec8e9,gbd998247f1+585e252eca,gc120e1dc64+5817c176a8,gc28159a63d+c6a8a0fb72,gc3e9b769f7+6707aea8b4,gcf0d15dbbd+9a10e1fe7b,gdaeeff99f8+f9a426f77a,ge6526c86ff+6a2e01d432,ge79ae78c31+c6a8a0fb72,gee10cc3b42+585e252eca,gff1a9f87cc+eddffb812c,v27.0.0.rc1
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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)
 
list[ReplicaChunk]|None getReplicaChunks (self)
 
None deleteReplicaChunks (self, Iterable[int] chunks)
 
ApdbTableData getDiaObjectsChunks (self, Iterable[int] chunks)
 
ApdbTableData getDiaSourcesChunks (self, Iterable[int] chunks)
 
ApdbTableData getDiaForcedSourcesChunks (self, Iterable[int] chunks)
 

Detailed Description

Abstract interface for APDB replication methods.

Definition at line 109 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 163 of file apdbReplica.py.

163 def apdbReplicaImplementationVersion(cls) -> VersionTuple:
164 """Return version number for current ApdbReplica implementation.
165
166 Returns
167 -------
168 version : `VersionTuple`
169 Version of the code defined in implementation class.
170 """
171 raise NotImplementedError()
172

◆ 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 187 of file apdbReplica.py.

187 def deleteReplicaChunks(self, chunks: Iterable[int]) -> None:
188 """Remove replication chunks from the database.
189
190 Parameters
191 ----------
192 chunks : `~collections.abc.Iterable` [`int`]
193 Chunk identifiers to remove.
194
195 Notes
196 -----
197 This method causes Apdb to forget about specified chunks. If there
198 are any auxiliary data associated with the identifiers, it is also
199 removed from database (but data in regular tables is not removed).
200 This method should be called after successful transfer of data from
201 APDB to PPDB to free space used by replicas.
202 """
203 raise NotImplementedError()
204

◆ 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 113 of file apdbReplica.py.

113 def from_config(cls, config: ApdbConfig) -> ApdbReplica:
114 """Create ApdbReplica instance from configuration object.
115
116 Parameters
117 ----------
118 config : `ApdbConfig`
119 Configuration object, type of this object determines type of the
120 ApdbReplica implementation.
121
122 Returns
123 -------
124 replica : `ApdbReplica`
125 Instance of `ApdbReplica` class.
126 """
127 return make_apdb_replica(config)
128

◆ 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 130 of file apdbReplica.py.

130 def from_uri(cls, uri: ResourcePathExpression) -> ApdbReplica:
131 """Make ApdbReplica instance from a serialized configuration.
132
133 Parameters
134 ----------
135 uri : `~lsst.resources.ResourcePathExpression`
136 URI or local file path pointing to a file with serialized
137 configuration, or a string with a "label:" prefix. In the latter
138 case, the configuration will be looked up from an APDB index file
139 using the label name that follows the prefix. The APDB index file's
140 location is determined by the ``DAX_APDB_INDEX_URI`` environment
141 variable.
142
143 Returns
144 -------
145 replica : `ApdbReplica`
146 Instance of `ApdbReplica` class, the type of the returned instance
147 is determined by configuration.
148 """
149 if isinstance(uri, str) and uri.startswith("label:"):
150 tag, _, label = uri.partition(":")
151 index = ApdbIndex()
152 # Current format for config files is "pex_config"
153 format = "pex_config"
154 uri = index.get_apdb_uri(label, format)
155 path = ResourcePath(uri)
156 config_str = path.read().decode()
157 # Assume that this is ApdbConfig, make_apdb will raise if not.
158 config = cast(ApdbConfig, Config._fromPython(config_str))
159 return make_apdb_replica(config)
160

◆ getDiaForcedSourcesChunks()

ApdbTableData lsst.dax.apdb.apdbReplica.ApdbReplica.getDiaForcedSourcesChunks ( self,
Iterable[int] chunks )
Return catalog of DiaForcedSource records from given replica chunks.

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

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

Notes
-----
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 250 of file apdbReplica.py.

250 def getDiaForcedSourcesChunks(self, chunks: Iterable[int]) -> ApdbTableData:
251 """Return catalog of DiaForcedSource records from given replica chunks.
252
253 Parameters
254 ----------
255 chunks : `~collections.abc.Iterable` [`int`]
256 Chunk identifiers to return.
257
258 Returns
259 -------
260 data : `ApdbTableData`
261 Catalog containing DiaForcedSource records. In addition to all
262 regular columns it will contain ``apdb_replica_chunk`` column.
263
264 Notes
265 -----
266 This part of API may not be very stable and can change before the
267 implementation finalizes.
268 """
269 raise NotImplementedError()

◆ getDiaObjectsChunks()

ApdbTableData lsst.dax.apdb.apdbReplica.ApdbReplica.getDiaObjectsChunks ( self,
Iterable[int] chunks )
Return catalog of DiaObject records from given replica chunks.

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

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

Notes
-----
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 206 of file apdbReplica.py.

206 def getDiaObjectsChunks(self, chunks: Iterable[int]) -> ApdbTableData:
207 """Return catalog of DiaObject records from given replica chunks.
208
209 Parameters
210 ----------
211 chunks : `~collections.abc.Iterable` [`int`]
212 Chunk identifiers to return.
213
214 Returns
215 -------
216 data : `ApdbTableData`
217 Catalog containing DiaObject records. In addition to all regular
218 columns it will contain ``apdb_replica_chunk`` column.
219
220 Notes
221 -----
222 This part of API may not be very stable and can change before the
223 implementation finalizes.
224 """
225 raise NotImplementedError()
226

◆ getDiaSourcesChunks()

ApdbTableData lsst.dax.apdb.apdbReplica.ApdbReplica.getDiaSourcesChunks ( self,
Iterable[int] chunks )
Return catalog of DiaSource records from given replica chunks.

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

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

Notes
-----
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 228 of file apdbReplica.py.

228 def getDiaSourcesChunks(self, chunks: Iterable[int]) -> ApdbTableData:
229 """Return catalog of DiaSource records from given replica chunks.
230
231 Parameters
232 ----------
233 chunks : `~collections.abc.Iterable` [`int`]
234 Chunk identifiers to return.
235
236 Returns
237 -------
238 data : `ApdbTableData`
239 Catalog containing DiaSource records. In addition to all regular
240 columns it will contain ``apdb_replica_chunk`` column.
241
242 Notes
243 -----
244 This part of API may not be very stable and can change before the
245 implementation finalizes.
246 """
247 raise NotImplementedError()
248

◆ 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 174 of file apdbReplica.py.

174 def getReplicaChunks(self) -> list[ReplicaChunk] | None:
175 """Return collection of replication chunks known to the database.
176
177 Returns
178 -------
179 chunks : `list` [`ReplicaChunk`] or `None`
180 List of chunks, they may be time-ordered if database supports
181 ordering. `None` is returned if database is not configured for
182 replication.
183 """
184 raise NotImplementedError()
185

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