ApdbUpdateRecord#

class lsst.dax.apdb.ApdbUpdateRecord(*, update_time_ns: int, update_order: int)#

Bases: ABC

Abstract base class representing all types of update records saved to replica table.

Attributes Summary

apdb_table

Class variable defining APDB table that this update applies to, must be defined in all concrete subclasses.

update_order

Record order in the update.

update_time_ns

Time in nanoseconds since epoch when update happened.

update_type

Class variable defining type of the update, must be defined in all concrete subclasses and be unique.

Methods Summary

from_json(update_time_ns, update_order, json_str)

record_id()

Return a tuple of (field name, field value) pairs for fields that identify the record to which this update applies.

record_payload()

Return a tuple of (field name, field value) pairs for fields that represent updates being applied by this record.

to_json()

Attributes Documentation

apdb_table: ClassVar[ApdbTables] = <dataclasses._MISSING_TYPE object>#

Class variable defining APDB table that this update applies to, must be defined in all concrete subclasses.

update_order: int = <dataclasses._MISSING_TYPE object>#

Record order in the update.

update_time_ns: int = <dataclasses._MISSING_TYPE object>#

Time in nanoseconds since epoch when update happened.

update_type: ClassVar[str] = <dataclasses._MISSING_TYPE object>#

Class variable defining type of the update, must be defined in all concrete subclasses and be unique.

Methods Documentation

classmethod from_json(update_time_ns: int, update_order: int, json_str: str) ApdbUpdateRecord#
abstract record_id() tuple[tuple[str, int], ...]#

Return a tuple of (field name, field value) pairs for fields that identify the record to which this update applies.

Returns#

record_id_tupletuple [tuple [str, int], …]

Tuple of (field name, field value) pairs for fields that identify the record to which this update applies.

abstract record_payload() tuple[tuple[str, Any], ...]#

Return a tuple of (field name, field value) pairs for fields that represent updates being applied by this record.

Returns#

payload_tupletuple [tuple [str, Any], …]

Tuple of (field name, field value) pairs.

Notes#

Returned tuple contains the fields that are actually updated. Even if this class represents an update that modifies multiple fields, individual records can update a smaller set of fields.

to_json() str#