LSST Applications g06d8191974+b5247657d3,g180d380827+b23588344e,g2079a07aa2+86d27d4dc4,g2305ad1205+0130fb9023,g29320951ab+7714a6b20a,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g33d1c0ed96+0e5473021a,g3a166c0a6a+0e5473021a,g3ddfee87b4+8783ab7716,g48712c4677+72a8b1060b,g487adcacf7+bbaada240a,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ecccb6240b,g5a732f18d5+53520f316c,g5ea96fc03c+33ab2bc355,g64a986408d+b5247657d3,g858d7b2824+b5247657d3,g8a8a8dda67+585e252eca,g99cad8db69+1453026da9,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,gb0e22166c9+60f28cb32d,gba4ed39666+c2a2e4ac27,gbb8dafda3b+3751ca9c65,gc120e1dc64+c91d1388df,gc28159a63d+0e5473021a,gc3e9b769f7+241adb7c58,gcf0d15dbbd+8783ab7716,gdaeeff99f8+f9a426f77a,ge6526c86ff+acdbe9a537,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gff1a9f87cc+b5247657d3,w.2024.17
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 enable_replica=False) | |
bool | has_replica_chunks (self) |
bool | empty (self) |
str | tableName (self, ApdbTables|ExtraTables table_name) |
str | keyspace (self) |
Mapping[str, schema_model.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, int|None replication_factor=None) |
Protected Member Functions | |
Mapping[ApdbTables, schema_model.Table] | _apdb_tables_schema (self, bool time_partition_tables) |
Mapping[ExtraTables, schema_model.Table] | _extra_tables_schema (self) |
bool | _check_replica_chunks (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) |
schema_model.Table | _table_schema (self, ApdbTables|ExtraTables table) |
Protected Attributes | |
_session | |
_keyspace | |
_prefix | |
_time_partition_tables | |
_enable_replica | |
_apdb_tables | |
_extra_tables | |
_has_replica_chunks | |
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 keyspace : `str` Keyspace name for all tables. 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. enable_replica : `bool`, optional If `True` then use additional tables for replica chunks.
Definition at line 82 of file apdbCassandraSchema.py.
lsst.dax.apdb.cassandra.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 | enable_replica = False ) |
Reimplemented from lsst.dax.apdb.apdbSchema.ApdbSchema.
Definition at line 129 of file apdbCassandraSchema.py.
|
protected |
Generate schema for regular APDB tables.
Definition at line 151 of file apdbCassandraSchema.py.
|
protected |
Check whether database has tables for tracking insert IDs.
Definition at line 314 of file apdbCassandraSchema.py.
|
protected |
Generate schema for extra tables.
Definition at line 212 of file apdbCassandraSchema.py.
|
protected |
Definition at line 478 of file apdbCassandraSchema.py.
|
protected |
Return schema definition for a table.
Definition at line 556 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 515 of file apdbCassandraSchema.py.
list[str] lsst.dax.apdb.cassandra.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 388 of file apdbCassandraSchema.py.
list[str] lsst.dax.apdb.cassandra.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 421 of file apdbCassandraSchema.py.
bool lsst.dax.apdb.cassandra.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 322 of file apdbCassandraSchema.py.
Mapping[str, schema_model.Column] lsst.dax.apdb.cassandra.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 371 of file apdbCassandraSchema.py.
bool lsst.dax.apdb.cassandra.apdbCassandraSchema.ApdbCassandraSchema.has_replica_chunks | ( | self | ) |
Whether insert ID tables are to be used (`bool`).
Definition at line 308 of file apdbCassandraSchema.py.
str lsst.dax.apdb.cassandra.apdbCassandraSchema.ApdbCassandraSchema.keyspace | ( | self | ) |
Return Cassandra keyspace for APDB tables.
Definition at line 367 of file apdbCassandraSchema.py.
None lsst.dax.apdb.cassandra.apdbCassandraSchema.ApdbCassandraSchema.makeSchema | ( | self, | |
*bool | drop = False, | ||
tuple[int, int] | None | part_range = None, | ||
int | None | replication_factor = None ) |
Create or re-create all tables. Parameters ---------- drop : `bool` If True then drop tables before creating new ones. Note that only tables are dropped and not the whole keyspace. 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. replication_factor : `int`, optional Replication factor used when creating new keyspace, if keyspace already exists its replication factor is not changed.
Definition at line 437 of file apdbCassandraSchema.py.
list[str] lsst.dax.apdb.cassandra.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 405 of file apdbCassandraSchema.py.
str lsst.dax.apdb.cassandra.apdbCassandraSchema.ApdbCassandraSchema.tableName | ( | self, | |
ApdbTables | ExtraTables | table_name ) |
Return Cassandra table name for APDB table.
Definition at line 363 of file apdbCassandraSchema.py.
|
protected |
Definition at line 148 of file apdbCassandraSchema.py.
|
protected |
Definition at line 145 of file apdbCassandraSchema.py.
|
protected |
Definition at line 149 of file apdbCassandraSchema.py.
|
protected |
Definition at line 311 of file apdbCassandraSchema.py.
|
protected |
Definition at line 142 of file apdbCassandraSchema.py.
|
protected |
Definition at line 143 of file apdbCassandraSchema.py.
|
protected |
Definition at line 141 of file apdbCassandraSchema.py.
|
staticprotected |
Definition at line 127 of file apdbCassandraSchema.py.
|
protected |
Definition at line 144 of file apdbCassandraSchema.py.
|
staticprotected |
Definition at line 122 of file apdbCassandraSchema.py.
|
staticprotected |
Definition at line 104 of file apdbCassandraSchema.py.