def set_max_requests_per_connection(self, host_distance, max_requests):
        """
        Sets a threshold for concurrent requests per connection, above which new
        connections will be created to a host (up to max connections;
        see :meth:`~Cluster.set_max_connections_per_host`).

        Pertains to connection pool management in protocol versions {1,2}.
        """
        if self.protocol_version >= 3:
            raise UnsupportedOperation(
                "Cluster.set_max_requests_per_connection() only has an effect "
                "when using protocol_version 1 or 2.")
        self._max_requests_per_connection[host_distance] = max_requests
dataset/ETHPy150Open datastax/python-driver/cassandra/cluster.py/Cluster.set_max_requests_per_connection/original