baseplate.context.cassandra¶
Configuration Parsing¶
-
baseplate.context.cassandra.cluster_from_config(app_config, prefix=u'cassandra.', **kwargs)¶ Make a Cluster from a configuration dictionary.
The keys useful to
cluster_from_config()should be prefixed, e.g.cassandra.contact_pointsetc. Theprefixargument specifies the prefix used to filter keys. Each key is mapped to a corresponding keyword argument on theClusterconstructor. Any keyword arguments given to this function will be passed through to theClusterconstructor. 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.Sessionto an attribute on the context object. Theexecute,execute_asyncorpreparemethods 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.Connectionto 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.