lsst.dax.apdb g9290983e33+d2d81de7f7
 
Loading...
Searching...
No Matches
lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica Class Reference
Inheritance diagram for lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica:
lsst.dax.apdb.apdbReplica.ApdbReplica

Public Member Functions

 __init__ (self, ApdbCassandra apdb)
 
VersionTuple schemaVersion (self)
 
VersionTuple apdbReplicaImplementationVersion (cls)
 
bool hasChunkSubPartitions (cls, VersionTuple version)
 
bool hasUpdateRecordChunks (cls, VersionTuple version)
 
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)
 
- Public Member Functions inherited from lsst.dax.apdb.apdbReplica.ApdbReplica
ApdbReplica from_config (cls, ApdbConfig config)
 
ApdbReplica from_uri (cls, ResourcePathExpression uri)
 

Protected Member Functions

Timer _timer (self, str name, *, Mapping[str, str|int]|None tags=None)
 

Protected Attributes

 _apdb = apdb
 

Detailed Description

Implementation of `ApdbReplica` for Cassandra backend.

Parameters
----------
apdb : `ApdbCassandra`
    Instance of ApbdCassandra for database.

Member Function Documentation

◆ _timer()

Timer lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica._timer ( self,
str name,
* ,
Mapping[str, str | int] | None tags = None )
protected
Create `Timer` instance given its name.

◆ apdbReplicaImplementationVersion()

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

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

Reimplemented from lsst.dax.apdb.apdbReplica.ApdbReplica.

◆ deleteReplicaChunks()

None lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.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 from lsst.dax.apdb.apdbReplica.ApdbReplica.

◆ getReplicaChunks()

list[ReplicaChunk] | None lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.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 from lsst.dax.apdb.apdbReplica.ApdbReplica.

◆ getTableDataChunks()

ApdbTableData lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.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 from lsst.dax.apdb.apdbReplica.ApdbReplica.

◆ getUpdateRecordChunks()

Sequence[ApdbUpdateRecord] lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.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 from lsst.dax.apdb.apdbReplica.ApdbReplica.

◆ hasChunkSubPartitions()

bool lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.hasChunkSubPartitions ( cls,
VersionTuple version )
Return True if replica chunk tables have sub-partitions.

◆ hasUpdateRecordChunks()

bool lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.hasUpdateRecordChunks ( cls,
VersionTuple version )
Return True if ApdbUpdateRecordChunks should exists.

◆ schemaVersion()

VersionTuple lsst.dax.apdb.cassandra.apdbCassandraReplica.ApdbCassandraReplica.schemaVersion ( self)
Return version number of the database schema.

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

Reimplemented from lsst.dax.apdb.apdbReplica.ApdbReplica.


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