Skip to content

PYTHON-1422 Add explicit driver support for NODE_LOCAL CL #1245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions cassandra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ class ConsistencyLevel(object):
one response.
"""

NODE_LOCAL = 11
"""
Experimental consistency level for querying only the local node.
"""

@staticmethod
def is_serial(cl):
return cl == ConsistencyLevel.SERIAL or cl == ConsistencyLevel.LOCAL_SERIAL
Expand All @@ -108,7 +113,8 @@ def is_serial(cl):
ConsistencyLevel.EACH_QUORUM: 'EACH_QUORUM',
ConsistencyLevel.SERIAL: 'SERIAL',
ConsistencyLevel.LOCAL_SERIAL: 'LOCAL_SERIAL',
ConsistencyLevel.LOCAL_ONE: 'LOCAL_ONE'
ConsistencyLevel.LOCAL_ONE: 'LOCAL_ONE',
ConsistencyLevel.NODE_LOCAL: 'NODE_LOCAL'
}

ConsistencyLevel.name_to_value = {
Expand All @@ -122,7 +128,8 @@ def is_serial(cl):
'EACH_QUORUM': ConsistencyLevel.EACH_QUORUM,
'SERIAL': ConsistencyLevel.SERIAL,
'LOCAL_SERIAL': ConsistencyLevel.LOCAL_SERIAL,
'LOCAL_ONE': ConsistencyLevel.LOCAL_ONE
'LOCAL_ONE': ConsistencyLevel.LOCAL_ONE,
'NODE_LOCAL': ConsistencyLevel.NODE_LOCAL
}


Expand Down