LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
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.