Skip to content

Commit fd4bf24

Browse files
Michael Feromikefero
authored andcommitted
doc: Client configuration information and options
1 parent 74f2b84 commit fd4bf24

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

doc/features/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Apache Cassandra] includes the following features:
66
* [DSE plaintext and GSSAPI authentication](/features/authentication)
77
* [DSE geospatial types](/features/geotypes/)
88
* [DSE graph integration](/features/graph/)
9+
* [Client configuration](/features/client_configuration/)
910

1011
This documentation only includes DSE specific features. Documentation for the
1112
core driver can be found [here](http://datastax.github.io/cpp-driver/).
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Client Configuration
2+
3+
Client configuration allows an application to provide additional metadata to
4+
the cluster which can be useful for troubleshooting and performing diagnostics.
5+
In addition to the optional application metadata the cluster will automatically
6+
be provided with the driver's name, driver's version, and a unique session
7+
identifier.
8+
9+
## Application Options (Optional)
10+
11+
Application name and version metadata can be provided to the cluster during
12+
configuration. This information can be used to isolate specific applications on
13+
the server-side when troubleshooting or performing diagnostics on clusters that
14+
support multiple applications.
15+
16+
```c
17+
CassCluster* cluster = cass_cluster_new();
18+
19+
/* Assign a name for the application connecting to the cluster */
20+
cass_cluster_set_application_name(cluster, "Application Name");
21+
22+
/* Assign a version for the application connecting to the cluster */
23+
cass_cluster_set_application_version(cluster, "1.0.0");
24+
25+
/* ... */
26+
27+
cass_cluster_free(cluster);
28+
```
29+
30+
## Client Identification
31+
32+
Each session is assigned a unique identifier (UUID) which can be used to
33+
identify specific client connections server-side. The identifier can also be
34+
retrieved client-side using the following function:
35+
36+
```c
37+
CassSession* session = cass_session_new();
38+
39+
/* Retrieve the session's unique identifier */
40+
CassUuid client_id = cass_session_get_client_id(session);
41+
42+
/* ... */
43+
44+
cass_session_free(session);
45+
```
46+
47+
**Note**: A session's unique identifier is constant for its lifetime and does
48+
not change when re-establishing connection to a cluster.

include/dse.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,9 @@ cass_session_execute_dse_graph(CassSession* session,
549549
* Get the client id.
550550
*
551551
* This can help with debugging issues in large clusters where there are a lot
552-
* of client connections. This UUID is randomly generated by the driver when
553-
* establishing a session connection.
552+
* of client connections. A session's unique identifier (UUID) is constant for
553+
* its lifetime and does not change when re-establishing connection to a
554+
* cluster.
554555
*
555556
* @dse{6.0.0+}
556557
*

0 commit comments

Comments
 (0)