Skip to content

Commit e2ca96c

Browse files
authored
Merge pull request apache#840 from datastax/cassandra-12148
add CDCWriteException
2 parents b5cb3bf + d94cece commit e2ca96c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Features
3737
--------
3838
* Add idle_heartbeat_timeout cluster option to tune how long to wait for heartbeat responses. (PYTHON-762)
3939
* Add HostFilterPolicy (PYTHON-761)
40+
* Add new exception type for CDC (PYTHON-837)
4041

4142
Bug Fixes
4243
---------

cassandra/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,14 @@ def __init__(self, message, write_type=None, **kwargs):
387387
self.write_type = write_type
388388

389389

390+
class CDCWriteFailure(RequestExecutionException):
391+
"""
392+
Hit limit on data in CDC folder, writes are rejected
393+
"""
394+
def __init__(self, message):
395+
Exception.__init__(self, message)
396+
397+
390398
class CoordinationFailure(RequestExecutionException):
391399
"""
392400
Replicas sent a failure to the coordinator.

cassandra/protocol.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ def to_exception(self):
331331
return WriteFailure(self.summary_msg(), **self.info)
332332

333333

334+
class CDCWriteException(RequestExecutionException):
335+
summary = 'Failed to execute write due to CDC space exhaustion.'
336+
error_code = 0x1600
337+
338+
334339
class SyntaxException(RequestValidationException):
335340
summary = 'Syntax error in CQL query'
336341
error_code = 0x2000

docs/api/cassandra.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
.. autoexception:: RequestExecutionException()
3232
:members:
3333

34+
.. autoexception:: CDCWriteException()
35+
:members:
36+
3437
.. autoexception:: Unavailable()
3538
:members:
3639

0 commit comments

Comments
 (0)