'Sets the maximum number of connections per Session that will be opened
for each host with :class:`~.HostDistance` equal to `host_distance`.
The default is 2 for :attr:`~HostDistance.LOCAL` and 1 for
:attr:`~HostDistance.REMOTE`.
If :attr:`~.Cluster.protocol_version` is set to 3 or higher, this
is not supported (there is always one connection per host, unless
the host is remote and :attr:`connect_to_remote_hosts` is :const:`False`)
and using this will result in an :exc:`~.UnsupporteOperation`.'

def set_max_connections_per_host(self, host_distance, max_connections):

    if (self.protocol_version >= 3):
        raise UnsupportedOperation('Cluster.set_max_connections_per_host()    only    has    an    effect    when    using    protocol_version    1    or    2.')
    self._max_connections_per_host[host_distance] = max_connections
