Latest commit. Removing file unexpectedly included in previous PR. Git stats 5, commits. Failed to load latest commit information. View code. The driver supports Python 2. Note: DataStax products do not support big-endian systems. If a specific version of CQL should be used, this may be set to that string version. Otherwise, the highest CQL version supported by the server will be automatically used.
See ProtocolVersion for more information about versions. If not set in the constructor, the driver will automatically downgrade version based on a negotiation with the server, but it is most efficient to set this to the maximum supported by your version of Cassandra.
Setting this will also prevent conflicting versions negotiated if your cluster is upgraded. Controls compression for communications between the driver and Cassandra. If left as the default of True , either lz4 or snappy compression may be used, depending on what is supported by both the driver and Cassandra.
If both are fully supported, lz4 will be preferred. An instance of policies. LoadBalancingPolicy or one of its subclasses. Default local DC will be chosen from contact points. Defaults to an instance of ExponentialReconnectionPolicy with a base delay of one second and a max delay of ten minutes. A default policies. A factory function which creates instances of policies.
Defaults to policies. AddressTranslator instance to be used in translating server node addresses to driver connection addresses. Whether or not metric collection is enabled. If enabled, metrics will be an instance of Metrics. An instance of cassandra. An optional ssl. SSLContext instance which will be used when new sockets are created. This should be used when client encryption is enabled in Cassandra.
An optional dict which will be used as kwargs for ssl. Note also that this functionality was not built into Python standard library until 2. To enable this mechanism in earlier versions, patch ssl. An optional list of tuples which will be used as arguments to socket. It was not found generally beneficial for this driver.
The maximum duration in seconds that the driver will wait for schema agreement across the cluster. Defaults to ten seconds. These are the current options:. EventletConnection requires monkey-patching - see doc for details. GeventConnection requires monkey-patching - see doc for details.
By default, AsyncoreConnection will be used, which uses the asyncore module in the Python standard library. If gevent or eventlet monkey-patching is detected, the corresponding connection class will be used automatically. AsyncioConnection , which uses the asyncio module in the Python standard library, is also available, but currently experimental.
Note that it requires asyncio features that were only introduced in the 3. A timeout, in seconds, for queries made by the control connection, such as querying the current schema and information about nodes in the cluster. If set to None , there will be no timeout for these queries. Interval, in seconds, on which to heartbeat idle connections. This helps keep connections open through network devices that expire idle connections. It also helps discover bad connections early in low-traffic scenarios.
Setting to zero disables heartbeats. Timeout, in seconds, on which the heartbeat wait for idle connection responses. Lowering this value can help to discover bad connections earlier. The driver delays a random amount of time in the range [0. This serves two purposes:. Remove redundant refreshes. Redundant events arriving within the delay period are discarded, and only one refresh is executed.
Setting this negative will disable schema refreshes in response to push events refreshes will still occur in response to schema change responses to DDL statements executed by Sessions of this Cluster.
This can cause a rush of connections and queries if not mitigated with this factor. This can reasonably be disabled on long-running applications with numerous clients preparing statements on startup, where a randomized initial condition of the load balancing policy can be expected to distribute prepares from different clients across the cluster.
May be used to avoid overwhelming a node on return, or if it is supposed that the node was only marked down due to network. If statements are not reprepared, they are prepared on the first execution, causing an extra roundtrip for one or more client requests.
This timeout covers the entire connection negotiation, including TCP establishment, options passing, and authentication. When disabled, the driver does not populate Cluster. This can be used to speed initial connection, and reduce load on client and server during operation. Turning this off gives away token aware request routing, and programmatic inspection of the metadata model. When disabled, the driver does not query node token information on connect, or on topology change events.
It is most useful in large clusters using vnodes, where the token map can be expensive to compute. Turning this off gives away token aware request routing, and programmatic inspection of the token ring. An object, shared between all sessions created by this cluster instance, that generates timestamps when client-side timestamp generation is enabled. By default, each Cluster uses a new MonotonicTimestampGenerator. Applications can set this value for custom timestamp behavior.
See the documentation for Session. An EndPointFactory instance to use internally when creating a socket connection to a node. You can ignore this unless you need a special connection mechanism.
The zip file will be temporarily extracted in the same directory to load the configuration and certificates. Creates and returns a new Session object. If keyspace is specified, that keyspace will be the default keyspace for operations on the Session.
Default is False , which means it will return when the first successful connection is established. Remaining pools are added asynchronously. Closes all sessions and connection associated with this Cluster. To ensure all connections are properly closed, you should always call shutdown on a Cluster instance when you are done with it.
Registers a class to use to represent a particular user-defined type. This should happen automatically by running the command above. Please note that official RPMs for Apache Cassandra only have been available recently and are not tested thoroughly on all platforms yet. We appreciate your feedback and support and ask you to post details on any issues in the corresponding Jira ticket.
Downloading Cassandra. Sep 11, Aug 7, Jul 25, Jul 11, Jun 10, May 28, May 6, May 8, Apr 16, Mar 4, Oct 22, Oct 10, Download the file for your platform.
If you're not sure which to choose, learn more about installing packages. Warning Some features may not work without JavaScript. Please try enabling it if you encounter problems. Search PyPI Search. Latest version Released: Mar 18, DataStax Driver for Apache Cassandra. Navigation Project description Release history Download files. Project links Homepage. Maintainers absurdfarce ds-pypi-svc jeffdinotodatastax. Project description Project details Release history Download files Project description A modern, feature-rich and highly-tunable Python client library for Apache Cassandra 2.
The driver supports Python 2. Note: DataStax products do not support big-endian systems.
0コメント