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[ApdbUpdateRecord] | getUpdateRecordChunks (self, Iterable[int] chunks) |
Abstract interface for APDB replication methods.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.
| 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.