Was this page helpful?
An execution profile object provides a mechanism to group together a set of configuration options and reuse them across different statement executions. This feature is useful when dealing with different query workloads.
Public Functions
Creates a new execution profile.
See also
Returns a execution profile that must be freed.
Frees a execution profile instance.
profile – [in]
Sets the timeout waiting for a response from a node.
Default: Disabled (uses the cluster request timeout)
See also
profile – [in]
timeout_ms – [in] Request timeout in milliseconds. Use 0 for no timeout or CASS_UINT64_MAX to disable.
CASS_OK if successful, otherwise an error occurred.
Sets the consistency level.
Default: Disabled (uses the default consistency)
See also
profile – [in]
consistency – [in]
CASS_OK if successful, otherwise an error occurred.
Sets the serial consistency level.
Default: Disabled (uses the default serial consistency)
profile – [in]
serial_consistency – [in]
CASS_OK if successful, otherwise an error occurred.
Configures the execution profile to use round-robin load balancing.
The driver discovers all nodes in a cluster and cycles through them per request. All are considered ‘local’.
Note: Profile-based load balancing policy is disabled by default; cluster load balancing policy is used when profile does not contain a policy.
profile – [in]
CASS_OK if successful, otherwise an error occurred.
Configures the execution profile 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: Profile-based load balancing policy is disabled by default; cluster load balancing policy is used when profile does not contain a policy.
The remote DC settings for DC-aware are not suitable for most scenarios that require DC failover. There is also unhandled gap between replication factor number of nodes failing and the full cluster failing. Only the remote DC settings are being deprecated.
profile – [in]
local_dc – [in] The primary data center to try first
used_hosts_per_remote_dc – [in] The number of hosts used in each remote DC if no hosts are available in the local dc (deprecated)
allow_remote_dcs_for_local_cl – [in] Allows remote hosts to be used if no local dc hosts are available and the consistency level is LOCAL_ONE or LOCAL_QUORUM (deprecated)
CASS_OK if successful, otherwise an error occurred.
Same as cass_execution_profile_set_load_balance_dc_aware(), but with lengths for string parameters.
The remote DC settings for DC-aware are not suitable for most scenarios that require DC failover. There is also unhandled gap between replication factor number of nodes failing and the full cluster failing. Only the remote DC settings are being deprecated.
profile – [in]
local_dc – [in]
local_dc_length – [in]
used_hosts_per_remote_dc – [in] (deprecated)
allow_remote_dcs_for_local_cl – [in] (deprecated)
Configures the execution profile to use token-aware request routing or not.
Important: Token-aware routing depends on keyspace metadata. For this reason enabling token-aware routing will also enable retrieving and updating keyspace schema metadata.
Default: cass_true (enabled).
This routing policy composes the base routing policy, routing requests first to replicas on nodes considered ‘local’ by the base load balancing policy.
Note: Execution profiles use the cluster-level load balancing policy unless enabled. This setting is not applicable unless a load balancing policy is enabled on the execution profile.
profile – [in]
enabled – [in]
CASS_OK if successful, otherwise an error occurred.
Configures the execution profile’s token-aware routing to randomly shuffle replicas. This can reduce the effectiveness of server-side caching, but it can better distribute load over replicas for a given partition key.
Note: Token-aware routing must be enabled and a load balancing policy must be enabled on the execution profile for the setting to be applicable.
Default: cass_true (enabled).
profile – [in]
enabled – [in]
CASS_OK if successful, otherwise an error occurred.
Configures the execution profile to use latency-aware request routing or not.
Note: Execution profiles use the cluster-level load balancing policy unless enabled. This setting is not applicable unless a load balancing policy is enabled on the execution profile.
Default: cass_false (disabled).
This routing policy is a top-level routing policy. It uses the base routing policy to determine locality (dc-aware) and/or placement (token-aware) before considering the latency.
profile – [in]
enabled – [in]
CASS_OK if successful, otherwise an error occurred.
Configures the execution profile’s settings for latency-aware request routing.
Note: Execution profiles use the cluster-level load balancing policy unless enabled. This setting is not applicable unless a load balancing policy is enabled on the execution profile.
Defaults:
exclusion_threshold: 2.0
scale_ms: 100 milliseconds
retry_period_ms: 10,000 milliseconds (10 seconds)
update_rate_ms: 100 milliseconds
min_measured: 50
profile – [in]
exclusion_threshold – [in] Controls how much worse the latency must be compared to the average latency of the best performing node before it penalized.
scale_ms – [in] Controls the weight given to older latencies when calculating the average latency of a node. A bigger scale will give more weight to older latency measurements.
retry_period_ms – [in] The amount of time a node is penalized by the policy before being given a second chance when the current average latency exceeds the calculated threshold (exclusion_threshold * best_average_latency).
update_rate_ms – [in] The rate at which the best average latency is recomputed.
min_measured – [in] The minimum number of measurements per-host required to be considered by the policy.
CASS_OK if successful, otherwise an error occurred.
Sets/Appends whitelist hosts for the execution profile. The first call sets the whitelist hosts and any subsequent calls appends additional hosts. Passing an empty string will clear and disable the whitelist. White space is striped from the hosts.
This policy filters requests to all other policies, only allowing requests to the hosts contained in the whitelist. Any host not in the whitelist will be ignored and a connection will not be established. This policy is useful for ensuring that the driver will only connect to a predefined set of hosts.
Examples: “127.0.0.1” “127.0.0.1,127.0.0.2”
Note: Execution profiles use the cluster-level load balancing policy unless enabled. This setting is not applicable unless a load balancing policy is enabled on the execution profile.
profile – [in]
hosts – [in] A comma delimited list of addresses. An empty string will clear the whitelist hosts. The string is copied into the cluster configuration; the memory pointed to by this parameter can be freed after this call.
CASS_OK if successful, otherwise an error occurred.
Same as cass_execution_profile_set_whitelist_filtering(), but with lengths for string parameters.
profile – [in]
hosts – [in]
hosts_length – [in]
Sets/Appends blacklist hosts for the execution profile. The first call sets the blacklist hosts and any subsequent calls appends additional hosts. Passing an empty string will clear and disable the blacklist. White space is striped from the hosts.
This policy filters requests to all other policies, only allowing requests to the hosts not contained in the blacklist. Any host in the blacklist will be ignored and a connection will not be established. This policy is useful for ensuring that the driver will not connect to a predefined set of hosts.
Examples: “127.0.0.1” “127.0.0.1,127.0.0.2”
Note: Execution profiles use the cluster-level load balancing policy unless enabled. This setting is not applicable unless a load balancing policy is enabled on the execution profile.
profile – [in]
hosts – [in] A comma delimited list of addresses. An empty string will clear the blacklist hosts. The string is copied into the cluster configuration; the memory pointed to by this parameter can be freed after this call.
CASS_OK if successful, otherwise an error occurred.
Same as cass_execution_profile_set_blacklist_filtering(), but with lengths for string parameters.
profile – [in]
hosts – [in]
hosts_length – [in]
same as cass_execution_profile_set_blacklist_filtering_hosts()
Same as cass_execution_profile_set_whitelist_filtering(), but whitelist all hosts of a dc.
Examples: “dc1”, “dc1,dc2”
profile – [in]
dcs – [in] A comma delimited list of dcs. An empty string will clear the whitelist dcs. The string is copied into the cluster configuration; the memory pointed to by this parameter can be freed after this call.
CASS_OK if successful, otherwise an error occurred.
Same as cass_execution_profile_set_whitelist_dc_filtering(), but with lengths for string parameters.
profile – [in]
dcs – [in]
dcs_length – [in]
Same as cass_execution_profile_set_blacklist_filtering(), but blacklist all hosts of a dc.
Examples: “dc1”, “dc1,dc2”
profile – [in]
dcs – [in] A comma delimited list of dcs. An empty string will clear the blacklist dcs. The string is copied into the cluster configuration; the memory pointed to by this parameter can be freed after this call.
CASS_OK if successful, otherwise an error occurred.
Same as cass_execution_profile_set_blacklist_dc_filtering(), but with lengths for string parameters.
profile – [in]
dcs – [in]
dcs_length – [in]
Sets the execution profile’s retry policy.
Note: Profile-based retry policy is disabled by default; cluster retry policy is used when profile does not contain a policy unless the retry policy was explicitly set on the batch/statement request.
See also
profile – [in]
retry_policy – [in] NULL will clear retry policy from execution profile
CASS_OK if successful, otherwise an error occurred.
Enable constant speculative executions with the supplied settings for the execution profile.
Note: Profile-based speculative execution policy is disabled by default; cluster speculative execution policy is used when profile does not contain a policy.
profile – [in]
constant_delay_ms – [in]
max_speculative_executions – [in]
CASS_OK if successful, otherwise an error occurred
Disable speculative executions for the execution profile.
Note: Profile-based speculative execution policy is disabled by default; cluster speculative execution policy is used when profile does not contain a policy.
profile – [in]
CASS_OK if successful, otherwise an error occurred
Was this page helpful?
On this page
CassExecProfile
CassExecProfile::cass_execution_profile_new()
CassExecProfile::cass_execution_profile_free()
CassExecProfile::cass_execution_profile_set_request_timeout()
CassExecProfile::cass_execution_profile_set_consistency()
CassExecProfile::cass_execution_profile_set_serial_consistency()
CassExecProfile::cass_execution_profile_set_load_balance_round_robin()
CassExecProfile::cass_execution_profile_set_load_balance_dc_aware()
CassExecProfile::cass_execution_profile_set_load_balance_dc_aware_n()
CassExecProfile::cass_execution_profile_set_token_aware_routing()
CassExecProfile::cass_execution_profile_set_token_aware_routing_shuffle_replicas()
CassExecProfile::cass_execution_profile_set_latency_aware_routing()
CassExecProfile::cass_execution_profile_set_latency_aware_routing_settings()
CassExecProfile::cass_execution_profile_set_whitelist_filtering()
CassExecProfile::cass_execution_profile_set_whitelist_filtering_n()
CassExecProfile::cass_execution_profile_set_blacklist_filtering()
CassExecProfile::cass_execution_profile_set_blacklist_filtering_n()
CassExecProfile::cass_execution_profile_set_whitelist_dc_filtering()
CassExecProfile::cass_execution_profile_set_whitelist_dc_filtering_n()
CassExecProfile::cass_execution_profile_set_blacklist_dc_filtering()
CassExecProfile::cass_execution_profile_set_blacklist_dc_filtering_n()
CassExecProfile::cass_execution_profile_set_retry_policy()
CassExecProfile::cass_execution_profile_set_constant_speculative_execution_policy()
CassExecProfile::cass_execution_profile_set_no_speculative_execution_policy()