policies.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:deb-python-cassandra-driver 作者: openstack 项目源码 文件源码
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. '
               'It can effectively be reimplemented using HostFilterPolicy.')
        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
                                        for endpoint in socket.getaddrinfo(a, None, socket.AF_UNSPEC, socket.SOCK_STREAM)]

        RoundRobinPolicy.__init__(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号