lsst.dax.apdb g0340944789+119922d7c1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema Class Reference
Inheritance diagram for lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema:
lsst.dax.apdb.apdbSchema.ApdbSchema

Public Member Functions

def __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)
 
str tableName (self, ApdbTables|ExtraTables table_name)
 
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, Optional[Tuple[int, int]] part_range=None)
 
- Public Member Functions inherited from lsst.dax.apdb.apdbSchema.ApdbSchema
def __init__ (self, str schema_file, str schema_name="ApdbSchema")
 
Union[type, str] column_dtype (self, Type[felis.types.FelisType] felis_type)
 

Additional Inherited Members

- Public Attributes inherited from lsst.dax.apdb.apdbSchema.ApdbSchema
 tableSchemas
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def 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 
)

Member Function Documentation

◆ apdbColumnNames()

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.

◆ clusteringColumns()

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.

◆ getColumnMap()

Mapping[str, simple.Column] lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.getColumnMap (   self,
ApdbTables | ExtraTables  table_name 
)
Returns 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.

◆ has_insert_id()

bool lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.has_insert_id (   self)
Whether insert ID tables are to be used (`bool`).

◆ makeSchema()

None lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.makeSchema (   self,
bool   drop = False,
Optional[Tuple[int, int]]   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.

◆ partitionColumns()

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.

◆ tableName()

str lsst.dax.apdb.apdbCassandraSchema.ApdbCassandraSchema.tableName (   self,
ApdbTables | ExtraTables  table_name 
)
Return Cassandra table name for APDB table.

The documentation for this class was generated from the following file: