Merge branch '1.x'
Conflicts: CHANGELOG.rst cassandra/decoder.py
This commit is contained in:
@@ -15,6 +15,9 @@ Bug Fixes
|
|||||||
named_tuple_factory (PYTHON-56)
|
named_tuple_factory (PYTHON-56)
|
||||||
* Ensure replication factors are ints for NetworkTopologyStrategy
|
* Ensure replication factors are ints for NetworkTopologyStrategy
|
||||||
to avoid TypeErrors (github #120)
|
to avoid TypeErrors (github #120)
|
||||||
|
* Pass WriteType instance to RetryPolicy.on_write_timeout() instead
|
||||||
|
of the string name of the write type. This caused write timeout
|
||||||
|
errors to always be rethrown instead of retrying. (github #123)
|
||||||
|
|
||||||
Other
|
Other
|
||||||
-----
|
-----
|
||||||
|
@@ -572,6 +572,14 @@ class WriteType(object):
|
|||||||
internally before a BATCH write.
|
internally before a BATCH write.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
WriteType.name_to_value = {
|
||||||
|
'SIMPLE': WriteType.SIMPLE,
|
||||||
|
'BATCH': WriteType.BATCH,
|
||||||
|
'UNLOGGED_BATCH': WriteType.UNLOGGED_BATCH,
|
||||||
|
'COUNTER': WriteType.COUNTER,
|
||||||
|
'BATCH_LOG': WriteType.BATCH_LOG,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class RetryPolicy(object):
|
class RetryPolicy(object):
|
||||||
"""
|
"""
|
||||||
|
@@ -30,6 +30,7 @@ from cassandra.cqltypes import (AsciiType, BytesType, BooleanType,
|
|||||||
InetAddressType, IntegerType, ListType,
|
InetAddressType, IntegerType, ListType,
|
||||||
LongType, MapType, SetType, TimeUUIDType,
|
LongType, MapType, SetType, TimeUUIDType,
|
||||||
UTF8Type, UUIDType, lookup_casstype)
|
UTF8Type, UUIDType, lookup_casstype)
|
||||||
|
from cassandra.policies import WriteType
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -233,7 +234,7 @@ class WriteTimeoutErrorMessage(RequestExecutionException):
|
|||||||
'consistency': read_consistency_level(f),
|
'consistency': read_consistency_level(f),
|
||||||
'received_responses': read_int(f),
|
'received_responses': read_int(f),
|
||||||
'required_responses': read_int(f),
|
'required_responses': read_int(f),
|
||||||
'write_type': read_string(f),
|
'write_type': WriteType.name_to_value[read_string(f)],
|
||||||
}
|
}
|
||||||
|
|
||||||
def to_exception(self):
|
def to_exception(self):
|
||||||
|
Reference in New Issue
Block a user