baseplate.context.cassandra
¶
Configuration Parsing¶
-
baseplate.context.cassandra.
cluster_from_config
(app_config, prefix='cassandra.', **kwargs)¶ Make a Cluster from a configuration dictionary.
The keys useful to
cluster_from_config()
should be prefixed, e.g.cassandra.contact_points
etc. Theprefix
argument specifies the prefix used to filter keys. Each key is mapped to a corresponding keyword argument on theCluster
constructor. Any keyword arguments given to this function will be passed through to theCluster
constructor. Keyword arguments take precedence over the configuration file.Supported keys:
contact_points
(required): comma delimited list of contact points to try connecting for cluster discoveryport
: The server-side port to open connections to.
Classes¶
-
class
baseplate.context.cassandra.
CassandraContextFactory
(session)¶ Cassandra session context factory.
This factory will attach a proxy object which acts like a
cassandra.cluster.Session
to an attribute on the context object. Theexecute
,execute_async
orprepare
methods will automatically record diagnostic information.Parameters: session (cassandra.cluster.Session) – A configured session object.
-
class
baseplate.context.cassandra.
CQLMapperContextFactory
(session)¶ CQLMapper ORM connection context factory.
This factory will attach a new CQLMapper
cqlmapper.connection.Connection
to an attribute on the context object. This Connection object will use the same proxy object that CassandraContextFactory attaches to a context to run queries so the execute command will automatically record diagnostic information.Parameters: session (cassandra.cluster.Session) – A configured session object.