default CL is now LOCAL_QUORUM
PYTHON-416
This commit is contained in:
@@ -1474,13 +1474,17 @@ class Session(object):
|
|||||||
.. versionadded:: 2.0.0
|
.. versionadded:: 2.0.0
|
||||||
"""
|
"""
|
||||||
|
|
||||||
default_consistency_level = ConsistencyLevel.ONE
|
default_consistency_level = ConsistencyLevel.LOCAL_QUORUM
|
||||||
"""
|
"""
|
||||||
The default :class:`~ConsistencyLevel` for operations executed through
|
The default :class:`~ConsistencyLevel` for operations executed through
|
||||||
this session. This default may be overridden by setting the
|
this session. This default may be overridden by setting the
|
||||||
:attr:`~.Statement.consistency_level` on individual statements.
|
:attr:`~.Statement.consistency_level` on individual statements.
|
||||||
|
|
||||||
.. versionadded:: 1.2.0
|
.. versionadded:: 1.2.0
|
||||||
|
|
||||||
|
.. versionchanged:: 3.0.0
|
||||||
|
|
||||||
|
default changed from ONE to LOCAL_QUORUM
|
||||||
"""
|
"""
|
||||||
|
|
||||||
max_trace_wait = 2.0
|
max_trace_wait = 2.0
|
||||||
|
|||||||
@@ -98,6 +98,9 @@
|
|||||||
|
|
||||||
.. autoattribute:: default_timeout
|
.. autoattribute:: default_timeout
|
||||||
|
|
||||||
|
.. autoattribute:: default_consistency_level
|
||||||
|
:annotation: = LOCAL_QUORUM
|
||||||
|
|
||||||
.. autoattribute:: row_factory
|
.. autoattribute:: row_factory
|
||||||
|
|
||||||
.. autoattribute:: default_fetch_size
|
.. autoattribute:: default_fetch_size
|
||||||
|
|||||||
@@ -327,8 +327,12 @@ The consistency level used for a query determines how many of the
|
|||||||
replicas of the data you are interacting with need to respond for
|
replicas of the data you are interacting with need to respond for
|
||||||
the query to be considered a success.
|
the query to be considered a success.
|
||||||
|
|
||||||
By default, :attr:`.ConsistencyLevel.ONE` will be used for all queries. To
|
By default, :attr:`.ConsistencyLevel.LOCAL_QUORUM` will be used for all queries.
|
||||||
specify a different consistency level, you will need to wrap your queries
|
This is to provide unsurprising default behavior with respect to read-after-write
|
||||||
|
consistency. However, many applications will prefer :attr:`.ConsistencyLevel.ONE`
|
||||||
|
to maximize performance and availability.
|
||||||
|
You can specify a different default for the session on :attr:`.Session.default_consistency_level`.
|
||||||
|
To specify a different consistency level per request, you will need to wrap your queries
|
||||||
in a :class:`~.SimpleStatement`:
|
in a :class:`~.SimpleStatement`:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|||||||
Reference in New Issue
Block a user