Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions include/cassandra.h
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,13 @@ cass_cluster_set_latency_aware_routing_settings(CassCluster* cluster,
* 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", "server1.domain.com"
* Examples: "127.0.0.1" "127.0.0.1,127.0.0.2"
*
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] hosts A comma delimited list of addresses or names. An empty
* string will clear the whitelist hosts. The string is copied into the cluster
* @param[in] hosts 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.
*/
Expand Down Expand Up @@ -1278,13 +1278,13 @@ cass_cluster_set_whitelist_filtering_n(CassCluster* cluster,
* 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", "server1.domain.com"
* Examples: "127.0.0.1" "127.0.0.1,127.0.0.2"
*
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] hosts A comma delimited list of addresses or names. An empty
* string will clear the blacklist hosts. The string is copied into the cluster
* @param[in] hosts 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.
*/
Expand Down Expand Up @@ -1318,10 +1318,9 @@ cass_cluster_set_blacklist_filtering_n(CassCluster* cluster,
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] dcs 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.
* @param[in] dcs 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_EXPORT void
cass_cluster_set_whitelist_dc_filtering(CassCluster* cluster,
Expand Down Expand Up @@ -1353,10 +1352,9 @@ cass_cluster_set_whitelist_dc_filtering_n(CassCluster* cluster,
* @public @memberof CassCluster
*
* @param[in] cluster
* @param[in] dcs 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.
* @param[in] dcs 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_EXPORT void
cass_cluster_set_blacklist_dc_filtering(CassCluster* cluster,
Expand Down
38 changes: 37 additions & 1 deletion topics/configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ cass_cluster_set_latency_aware_routing_settings(cluster,
min_measured);
```

### Whitelist Filtering
### Filtering

#### Whitelist

This policy ensures that only hosts from the provided whitelist filter will
ever be used. Any host that is not contained within the whitelist will be
Expand All @@ -117,6 +119,40 @@ cass_cluster_set_whitelist_filtering(cluster,
cass_cluster_set_whitelist_filtering(cluster, "");
```

#### Blacklist

This policy is the inverse of the whitelist policy where hosts provided in the
blacklist filter will be ignored and a connection will not be established.

```c
/* Set the list of predefined hosts the driver is NOT allowed to connect to */
cass_cluster_set_blacklist_filtering(cluster,
"127.0.0.1, 127.0.0.3, 127.0.0.5");

/* The blacklist can be cleared (and disabled) by using an empty string */
cass_cluster_set_blacklist_filtering(cluster, "");
```

#### Datacenter

Filtering can also be performed on all hosts in a datacenter or multiple
datacenters when using the whitelist/blacklist datacenter filtering polices.

```c
/* Set the list of predefined datacenters the driver is allowed to connect to */
cass_cluster_set_whitelist_filtering(cluster, "dc2, dc4");

/* The datacenter whitelist can be cleared/disabled by using an empty string */
cass_cluster_set_whitelist_filtering(cluster, "");
```

```c
/* Set the list of predefined datacenters the driver is NOT allowed to connect to */
cass_cluster_set_blacklist_dc_filtering(cluster, "dc2, dc4");

/* The datacenter blacklist can be cleared/disabled by using an empty string */
cass_cluster_set_blacklist_dc_filtering(cluster, "");
```

### Connection Heartbeats

Expand Down