ApdbReplica

class lsst.dax.apdb.ApdbReplica

Bases: ABC

Abstract interface for APDB replication methods.

Methods Summary

apdbReplicaImplementationVersion()

Return version number for current ApdbReplica implementation.

deleteReplicaChunks(chunks)

Remove replication chunks from the database.

from_config(config)

Create ApdbReplica instance from configuration object.

from_uri(uri)

Make ApdbReplica instance from a serialized configuration.

getDiaForcedSourcesChunks(chunks)

Return catalog of DiaForcedSource records from given replica chunks.

getDiaObjectsChunks(chunks)

Return catalog of DiaObject records from given replica chunks.

getDiaSourcesChunks(chunks)

Return catalog of DiaSource records from given replica chunks.

getReplicaChunks()

Return collection of replication chunks known to the database.

Methods Documentation

abstract classmethod apdbReplicaImplementationVersion() VersionTuple

Return version number for current ApdbReplica implementation.

Returns:
versionVersionTuple

Version of the code defined in implementation class.

abstract deleteReplicaChunks(chunks: Iterable[int]) None

Remove replication chunks from the database.

Parameters:
chunksIterable [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.

classmethod from_config(config: ApdbConfig) ApdbReplica

Create ApdbReplica instance from configuration object.

Parameters:
configApdbConfig

Configuration object, type of this object determines type of the ApdbReplica implementation.

Returns:
replicaApdbReplica

Instance of ApdbReplica class.

classmethod from_uri(uri: str | ParseResult | ResourcePath | Path) ApdbReplica

Make ApdbReplica instance from a serialized configuration.

Parameters:
uriResourcePathExpression

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:
replicaApdbReplica

Instance of ApdbReplica class, the type of the returned instance is determined by configuration.

abstract getDiaForcedSourcesChunks(chunks: Iterable[int]) ApdbTableData

Return catalog of DiaForcedSource records from given replica chunks.

Parameters:
chunksIterable [int]

Chunk identifiers to return.

Returns:
dataApdbTableData

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.

abstract getDiaObjectsChunks(chunks: Iterable[int]) ApdbTableData

Return catalog of DiaObject records from given replica chunks.

Parameters:
chunksIterable [int]

Chunk identifiers to return.

Returns:
dataApdbTableData

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.

abstract getDiaSourcesChunks(chunks: Iterable[int]) ApdbTableData

Return catalog of DiaSource records from given replica chunks.

Parameters:
chunksIterable [int]

Chunk identifiers to return.

Returns:
dataApdbTableData

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.

abstract getReplicaChunks() list[lsst.dax.apdb.apdbReplica.ReplicaChunk] | None

Return collection of replication chunks known to the database.

Returns:
chunkslist [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.