LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+b2075782a9,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+a60788ef87,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+a60788ef87,g591dd9f2cf+ba8caea58f,g5ec818987f+864ee9cddb,g858d7b2824+9ee1ab4172,g876c692160+a40945ebb7,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+5e309b7bc6,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+aa12a14d27,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+d0da15e3be,gba4ed39666+1ac82b564f,gbb8dafda3b+5dfd9c994b,gbeb006f7da+97157f9740,gc28159a63d+c6dfa2ddaf,gc86a011abf+9ee1ab4172,gcf0d15dbbd+a60788ef87,gdaeeff99f8+1cafcb7cd4,gdc0c513512+9ee1ab4172,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,geb961e4c1e+f9439d1e6f,gee10cc3b42+90ebb246c7,gf1cff7945b+9ee1ab4172,w.2024.12
LSST Data Management Base Package
|
Public Member Functions | |
__init__ (self, cassandra.cluster.Session session, str keyspace, str schema_file, str schema_name="ApdbSchema", str prefix="", bool time_partition_tables=False, bool use_insert_id=False) | |
bool | has_insert_id (self) |
bool | empty (self) |
str | tableName (self, ApdbTables|ExtraTables table_name) |
str | keyspace (self) |
Mapping[str, simple.Column] | getColumnMap (self, ApdbTables|ExtraTables table_name) |
list[str] | apdbColumnNames (self, ApdbTables|ExtraTables table_name) |
list[str] | partitionColumns (self, ApdbTables|ExtraTables table_name) |
list[str] | clusteringColumns (self, ApdbTables|ExtraTables table_name) |
None | makeSchema (self, bool drop=False, tuple[int, int]|None part_range=None) |
Protected Member Functions | |
Mapping[ApdbTables, simple.Table] | _apdb_tables_schema (self, bool time_partition_tables) |
Mapping[ExtraTables, simple.Table] | _extra_tables_schema (self) |
bool | _check_insert_id (self) |
None | _makeTableSchema (self, ApdbTables|ExtraTables table, bool drop=False, tuple[int, int]|None part_range=None) |
list[str] | _tableColumns (self, ApdbTables|ExtraTables table_name) |
simple.Table | _table_schema (self, ApdbTables|ExtraTables table) |
Protected Attributes | |
_session | |
_keyspace | |
_prefix | |
_time_partition_tables | |
_use_insert_id | |
_apdb_tables | |
_extra_tables | |
_has_insert_id | |
Static Protected Attributes | |
dict | _type_map |
list | _time_partitioned_tables |
list | _spatially_partitioned_tables = [ApdbTables.DiaObjectLast] |
Class for management of APDB schema. Parameters ---------- session : `cassandra.cluster.Session` Cassandra session object schema_file : `str` Name of the YAML schema file. schema_name : `str`, optional Name of the schema in YAML files. prefix : `str`, optional Prefix to add to all schema elements. time_partition_tables : `bool` If True then schema will have a separate table for each time partition.
Definition at line 88 of file apdbCassandraSchema.py.
lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.__init__ | ( | self, | |
cassandra.cluster.Session | session, | ||
str | keyspace, | ||
str | schema_file, | ||
str | schema_name = "ApdbSchema", | ||
str | prefix = "", | ||
bool | time_partition_tables = False, | ||
bool | use_insert_id = False ) |
Reimplemented from lsst.dax.apdb.apdbSchema.ApdbSchema.
Definition at line 130 of file apdbCassandraSchema.py.
|
protected |
Generate schema for regular APDB tables.
Definition at line 152 of file apdbCassandraSchema.py.
|
protected |
Check whether database has tables for tracking insert IDs.
Definition at line 286 of file apdbCassandraSchema.py.
|
protected |
Generate schema for extra tables.
Definition at line 211 of file apdbCassandraSchema.py.
|
protected |
Definition at line 436 of file apdbCassandraSchema.py.
|
protected |
Return schema definition for a table.
Definition at line 514 of file apdbCassandraSchema.py.
|
protected |
Return set of columns in a table Parameters ---------- table_name : `ApdbTables` Name of the table. Returns ------- column_defs : `list` List of strings in the format "column_name type".
Definition at line 473 of file apdbCassandraSchema.py.
list[str] lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.apdbColumnNames | ( | self, | |
ApdbTables | ExtraTables | table_name ) |
Return a list of columns names for a table as defined in APDB schema. Parameters ---------- table_name : `ApdbTables` or `ExtraTables` Enum for a table in APDB schema. Returns ------- columns : `list` of `str` Names of regular columns in the table.
Definition at line 360 of file apdbCassandraSchema.py.
list[str] lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.clusteringColumns | ( | self, | |
ApdbTables | ExtraTables | table_name ) |
Return a list of columns used for clustering. Parameters ---------- table_name : `ApdbTables` Table name in APDB schema Returns ------- columns : `list` of `str` Names of columns for used for clustering.
Definition at line 393 of file apdbCassandraSchema.py.
bool lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.empty | ( | self | ) |
Return True if database schema is empty. Returns ------- empty : `bool` `True` if none of the required APDB tables exist in the database, `False` if all required tables exist. Raises ------ InconsistentSchemaError Raised when some of the required tables exist but not all.
Definition at line 294 of file apdbCassandraSchema.py.
Mapping[str, simple.Column] lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.getColumnMap | ( | self, | |
ApdbTables | ExtraTables | table_name ) |
Return mapping of column names to Column definitions. Parameters ---------- table_name : `ApdbTables` One of known APDB table names. Returns ------- column_map : `dict` Mapping of column names to `ColumnDef` instances.
Definition at line 343 of file apdbCassandraSchema.py.
bool lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.has_insert_id | ( | self | ) |
Whether insert ID tables are to be used (`bool`).
Definition at line 280 of file apdbCassandraSchema.py.
str lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.keyspace | ( | self | ) |
Return Cassandra keyspace for APDB tables.
Definition at line 339 of file apdbCassandraSchema.py.
None lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.makeSchema | ( | self, | |
bool | drop = False, | ||
tuple[int, int] | None | part_range = None ) |
Create or re-create all tables. Parameters ---------- drop : `bool` If True then drop tables before creating new ones. part_range : `tuple` [ `int` ] or `None` Start and end partition number for time partitions, end is not inclusive. Used to create per-partition DiaObject, DiaSource, and DiaForcedSource tables. If `None` then per-partition tables are not created.
Definition at line 409 of file apdbCassandraSchema.py.
list[str] lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.partitionColumns | ( | self, | |
ApdbTables | ExtraTables | table_name ) |
Return a list of columns used for table partitioning. Parameters ---------- table_name : `ApdbTables` Table name in APDB schema Returns ------- columns : `list` of `str` Names of columns used for partitioning.
Definition at line 377 of file apdbCassandraSchema.py.
str lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.tableName | ( | self, | |
ApdbTables | ExtraTables | table_name ) |
Return Cassandra table name for APDB table.
Definition at line 335 of file apdbCassandraSchema.py.
|
protected |
Definition at line 149 of file apdbCassandraSchema.py.
|
protected |
Definition at line 150 of file apdbCassandraSchema.py.
|
protected |
Definition at line 283 of file apdbCassandraSchema.py.
|
protected |
Definition at line 143 of file apdbCassandraSchema.py.
|
protected |
Definition at line 144 of file apdbCassandraSchema.py.
|
protected |
Definition at line 142 of file apdbCassandraSchema.py.
|
staticprotected |
Definition at line 128 of file apdbCassandraSchema.py.
|
protected |
Definition at line 145 of file apdbCassandraSchema.py.
|
staticprotected |
Definition at line 123 of file apdbCassandraSchema.py.
|
staticprotected |
Definition at line 105 of file apdbCassandraSchema.py.
|
protected |
Definition at line 146 of file apdbCassandraSchema.py.