deprecate whitelist LBP
This commit is contained in:
@@ -9,6 +9,10 @@ Bug Fixes
|
||||
---------
|
||||
* is_idempotent flag is not propagated from PreparedStatement to BoundStatement (PYTHON-736)
|
||||
|
||||
Other
|
||||
-----
|
||||
* Deprecate WhiteListRoundRobinPolicy (PYTHON-759)
|
||||
|
||||
3.10.0
|
||||
======
|
||||
May 24, 2017
|
||||
|
||||
@@ -17,6 +17,7 @@ import logging
|
||||
from random import randint, shuffle
|
||||
from threading import Lock
|
||||
import socket
|
||||
from warnings import warn
|
||||
|
||||
from cassandra import ConsistencyLevel, OperationTimedOut
|
||||
|
||||
@@ -396,6 +397,10 @@ class TokenAwarePolicy(LoadBalancingPolicy):
|
||||
|
||||
class WhiteListRoundRobinPolicy(RoundRobinPolicy):
|
||||
"""
|
||||
|wlrrp| **is deprecated. It will be removed in 4.0.** It can effectively be
|
||||
reimplemented using :class:`.HostFilterPolicy`. For more information, see
|
||||
PYTHON-758_.
|
||||
|
||||
A subclass of :class:`.RoundRobinPolicy` which evenly
|
||||
distributes queries across all nodes in the cluster,
|
||||
regardless of what datacenter the nodes may be in, but
|
||||
@@ -405,12 +410,24 @@ class WhiteListRoundRobinPolicy(RoundRobinPolicy):
|
||||
https://datastax-oss.atlassian.net/browse/JAVA-145
|
||||
Where connection errors occur when connection
|
||||
attempts are made to private IP addresses remotely
|
||||
|
||||
.. |wlrrp| raw:: html
|
||||
|
||||
<b><code>WhiteListRoundRobinPolicy</code></b>
|
||||
|
||||
.. _PYTHON-758: https://datastax-oss.atlassian.net/browse/PYTHON-758
|
||||
|
||||
"""
|
||||
def __init__(self, hosts):
|
||||
"""
|
||||
The `hosts` parameter should be a sequence of hosts to permit
|
||||
connections to.
|
||||
"""
|
||||
msg = ('WhiteListRoundRobinPolicy is deprecated. '
|
||||
'It will be removed in 4.0.')
|
||||
warn(msg, DeprecationWarning)
|
||||
# DeprecationWarnings are silent by default so we also log the message
|
||||
log.warning(msg)
|
||||
|
||||
self._allowed_hosts = hosts
|
||||
self._allowed_hosts_resolved = [endpoint[4][0] for a in self._allowed_hosts
|
||||
|
||||
Reference in New Issue
Block a user