'``executor_threads`` defines the number of threads in a pool for handling asynchronous tasks such as
extablishing connection pools or refreshing metadata.
Any of the mutable Cluster attributes may be set as keyword arguments to the constructor.'

def __init__(self, contact_points=['127.0.0.1'], port=9042, compression=True, auth_provider=None, load_balancing_policy=None, reconnection_policy=None, default_retry_policy=None, conviction_policy_factory=None, metrics_enabled=False, connection_class=None, ssl_options=None, sockopts=None, cql_version=None, protocol_version=_NOT_SET, executor_threads=2, max_schema_agreement_wait=10, control_connection_timeout=2.0, idle_heartbeat_interval=30, schema_event_refresh_window=2, topology_event_refresh_window=10, connect_timeout=5, schema_metadata_enabled=True, token_metadata_enabled=True, address_translator=None, status_event_refresh_window=2, prepare_on_all_hosts=True, reprepare_on_up=True, execution_profiles=None, allow_beta_protocol_version=False, timestamp_generator=None, idle_heartbeat_timeout=30):

    if (contact_points is not None):
        if isinstance(contact_points, six.string_types):
            raise TypeError('contact_points    should    not    be    a    string,    it    should    be    a    sequence    (e.g.    list)    of    strings')
        if (None in contact_points):
            raise ValueError('contact_points    should    not    contain    None    (it    can    resolve    to    localhost)')
        self.contact_points = contact_points
    self.port = port
    self.contact_points_resolved = [endpoint[4][0] for a in self.contact_points for endpoint in socket.getaddrinfo(a, self.port, socket.AF_UNSPEC, socket.SOCK_STREAM)]
    self.compression = compression
    if (protocol_version is not _NOT_SET):
        self.protocol_version = protocol_version
        self._protocol_version_explicit = True
    self.allow_beta_protocol_version = allow_beta_protocol_version
    self.auth_provider = auth_provider
    if (load_balancing_policy is not None):
        if isinstance(load_balancing_policy, type):
            raise TypeError('load_balancing_policy    should    not    be    a    class,    it    should    be    an    instance    of    that    class')
        self.load_balancing_policy = load_balancing_policy
    else:
        self._load_balancing_policy = default_lbp_factory()
    if (reconnection_policy is not None):
        if isinstance(reconnection_policy, type):
            raise TypeError('reconnection_policy    should    not    be    a    class,    it    should    be    an    instance    of    that    class')
        self.reconnection_policy = reconnection_policy
    if (default_retry_policy is not None):
        if isinstance(default_retry_policy, type):
            raise TypeError('default_retry_policy    should    not    be    a    class,    it    should    be    an    instance    of    that    class')
        self.default_retry_policy = default_retry_policy
    if (conviction_policy_factory is not None):
        if (not callable(conviction_policy_factory)):
            raise ValueError('conviction_policy_factory    must    be    callable')
        self.conviction_policy_factory = conviction_policy_factory
    if (address_translator is not None):
        if isinstance(address_translator, type):
            raise TypeError('address_translator    should    not    be    a    class,    it    should    be    an    instance    of    that    class')
        self.address_translator = address_translator
    if (connection_class is not None):
        self.connection_class = connection_class
    if (timestamp_generator is not None):
        if (not callable(timestamp_generator)):
            raise ValueError('timestamp_generator    must    be    callable')
        self.timestamp_generator = timestamp_generator
    else:
        self.timestamp_generator = MonotonicTimestampGenerator()
    self.profile_manager = ProfileManager()
    self.profile_manager.profiles[EXEC_PROFILE_DEFAULT] = ExecutionProfile(self.load_balancing_policy, self.default_retry_policy, Session._default_consistency_level, Session._default_serial_consistency_level, Session._default_timeout, Session._row_factory)
    if (load_balancing_policy or default_retry_policy):
        if execution_profiles:
            raise ValueError('Clusters    constructed    with    execution_profiles    should    not    specify    legacy    parameters    load_balancing_policy    or    default_retry_policy.    Configure    this    in    a    profile    instead.')
        self._config_mode = _ConfigMode.LEGACY
    elif execution_profiles:
        self.profile_manager.profiles.update(execution_profiles)
        self._config_mode = _ConfigMode.PROFILES
    self.metrics_enabled = metrics_enabled
    self.ssl_options = ssl_options
    self.sockopts = sockopts
    self.cql_version = cql_version
    self.max_schema_agreement_wait = max_schema_agreement_wait
    self.control_connection_timeout = control_connection_timeout
    self.idle_heartbeat_interval = idle_heartbeat_interval
    self.idle_heartbeat_timeout = idle_heartbeat_timeout
    self.schema_event_refresh_window = schema_event_refresh_window
    self.topology_event_refresh_window = topology_event_refresh_window
    self.status_event_refresh_window = status_event_refresh_window
    self.connect_timeout = connect_timeout
    self.prepare_on_all_hosts = prepare_on_all_hosts
    self.reprepare_on_up = reprepare_on_up
    self._listeners = set()
    self._listener_lock = Lock()
    self.sessions = WeakSet()
    self.metadata = Metadata()
    self.control_connection = None
    self._prepared_statements = WeakValueDictionary()
    self._prepared_statement_lock = Lock()
    self._user_types = defaultdict(dict)
    self._min_requests_per_connection = {HostDistance.LOCAL: DEFAULT_MIN_REQUESTS, HostDistance.REMOTE: DEFAULT_MIN_REQUESTS}
    self._max_requests_per_connection = {HostDistance.LOCAL: DEFAULT_MAX_REQUESTS, HostDistance.REMOTE: DEFAULT_MAX_REQUESTS}
    self._core_connections_per_host = {HostDistance.LOCAL: DEFAULT_MIN_CONNECTIONS_PER_LOCAL_HOST, HostDistance.REMOTE: DEFAULT_MIN_CONNECTIONS_PER_REMOTE_HOST}
    self._max_connections_per_host = {HostDistance.LOCAL: DEFAULT_MAX_CONNECTIONS_PER_LOCAL_HOST, HostDistance.REMOTE: DEFAULT_MAX_CONNECTIONS_PER_REMOTE_HOST}
    self.executor = ThreadPoolExecutor(max_workers=executor_threads)
    self.scheduler = _Scheduler(self.executor)
    self._lock = RLock()
    if self.metrics_enabled:
        from cassandra.metrics import Metrics
        self.metrics = Metrics(weakref.proxy(self))
    self.control_connection = ControlConnection(self, self.control_connection_timeout, self.schema_event_refresh_window, self.topology_event_refresh_window, self.status_event_refresh_window, schema_metadata_enabled, token_metadata_enabled)
