diff --git a/cassandra/policies.py b/cassandra/policies.py index 0b7c3f8b..c4c1be84 100644 --- a/cassandra/policies.py +++ b/cassandra/policies.py @@ -121,11 +121,28 @@ class DCAwareRoundRobinPolicy(LoadBalancingPolicy): self._dc_live_hosts.setdefault(host.datacenter, set()).discard(host) -class SimpleConvictionPolicy(object): +class ConvictionPolicy(object): def __init__(self, host): self.host = host + def add_failure(connection_exc): + """ + Implementations should return ``True`` if the host should be + convicted, ``False`` otherwise. + """ + raise NotImplemented() + + def reset(self): + """ + Implementations should clear out any convictions or state regarding + the host. + """ + raise NotImplemented() + + +class SimpleConvictionPolicy(ConvictionPolicy): + def add_failure(connection_exc): return True