Function cassandra_cpp_sys::cass_cluster_set_load_balance_dc_aware [] [src]

pub unsafe extern "C" fn cass_cluster_set_load_balance_dc_aware(
    cluster: *mut CassCluster,
    local_dc: *const c_char,
    used_hosts_per_remote_dc: c_uint,
    allow_remote_dcs_for_local_cl: cass_bool_t
) -> CassError

Configures the cluster to use DC-aware load balancing. For each query, all live nodes in a primary 'local' DC are tried first, followed by any node from other DCs.

Note: This is the default, and does not need to be called unless switching an existing from another policy or changing settings. Without further configuration, a default local_dc is chosen from the first connected contact point, and no remote hosts are considered in query plans. If relying on this mechanism, be sure to use only contact points from the local DC.

@public @memberof CassCluster

@param[in] cluster @param[in] local_dc The primary data center to try first @param[in] used_hosts_per_remote_dc The number of host used in each remote DC if no hosts are available in the local dc @param[in] allow_remote_dcs_for_local_cl Allows remote hosts to be used if no local dc hosts are available and the consistency level is LOCAL_ONE or LOCAL_QUORUM @return CASS_OK if successful, otherwise an error occurred