ApdbCassandraSchema¶
-
class
lsst.dax.apdb.ApdbCassandraSchema(session: cassandra.cluster.Session, schema_file: str, extra_schema_file: Optional[str] = None, prefix: str = '', packing: str = 'none', time_partition_tables: bool = False)¶ Bases:
lsst.dax.apdb.ApdbSchemaClass for management of APDB schema.
Parameters: - session :
cassandra.cluster.Session Cassandra session object
- schema_file :
str Name of the YAML schema file.
- extra_schema_file :
str, optional Name of the YAML schema file with extra column definitions.
- prefix :
str, optional Prefix to add to all schema elements.
- packing :
str Type of packing to apply to columns, string “none” disable packing, any other value enables it.
- time_partition_tables :
bool If True then schema will have a separate table for each time partition.
Methods Summary
clusteringColumns(table_name)Return a list of columns used for clustering. getColumnMap(table_name)Returns mapping of column names to Column definitions. makeSchema(drop, part_range, int]] = None)Create or re-create all tables. packedColumns(table_name)Return set of columns that are packed into BLOB. partitionColumns(table_name)Return a list of columns used for table partitioning. tableName(table_name)Return Cassandra table name for APDB table. Methods Documentation
-
clusteringColumns(table_name: lsst.dax.apdb.apdbSchema.ApdbTables) → List[str]¶ Return a list of columns used for clustering.
Parameters: - table_name :
ApdbTables Table name in APDB schema
Returns: - table_name :
-
getColumnMap(table_name: lsst.dax.apdb.apdbSchema.ApdbTables) → Mapping[str, lsst.dax.apdb.apdbSchema.ColumnDef]¶ Returns mapping of column names to Column definitions.
Parameters: - table_name :
ApdbTables One of known APDB table names.
Returns: - table_name :
-
makeSchema(drop: bool = False, part_range: Optional[Tuple[int, int]] = None) → None¶ Create or re-create all tables.
Parameters: - drop :
bool If True then drop tables before creating new ones.
- part_range :
tuple[int] orNone Start and end partition number for time partitions, end is not inclusive. Used to create per-partition DiaObject, DiaSource, and DiaForcedSource tables. If
Nonethen per-partition tables are not created.
- drop :
-
packedColumns(table_name: lsst.dax.apdb.apdbSchema.ApdbTables) → List[lsst.dax.apdb.apdbSchema.ColumnDef]¶ Return set of columns that are packed into BLOB.
Parameters: - table_name :
ApdbTables Name of the table.
Returns: - table_name :
-
partitionColumns(table_name: lsst.dax.apdb.apdbSchema.ApdbTables) → List[str]¶ Return a list of columns used for table partitioning.
Parameters: - table_name :
ApdbTables Table name in APDB schema
Returns: - table_name :
-
tableName(table_name: lsst.dax.apdb.apdbSchema.ApdbTables) → str¶ Return Cassandra table name for APDB table.
- session :