This is an automated email from the ASF dual-hosted git repository.
mck pushed a commit to branch cassandra-4.1
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/cassandra-4.1 by this push:
new af82b941a8 Restore 4.1's doc update for virtual table
system_views.clients
af82b941a8 is described below
commit af82b941a88f511605578d8eaa9b3d04634c34ac
Author: Tibor Répási <[email protected]>
AuthorDate: Mon Mar 6 15:10:14 2023 +0100
Restore 4.1's doc update for virtual table system_views.clients
patch by Tibor Répási; reviewed by Ekaterina Dimitrova, Michael Semb Wever
for CASSANDRA-18303, CASSANDRA-17344
---
.../cassandra/pages/operating/virtualtables.adoc | 94 +++++++++++++++++++---
1 file changed, 81 insertions(+), 13 deletions(-)
diff --git a/doc/modules/cassandra/pages/operating/virtualtables.adoc
b/doc/modules/cassandra/pages/operating/virtualtables.adoc
index b18ba31316..2963ecbe38 100644
--- a/doc/modules/cassandra/pages/operating/virtualtables.adoc
+++ b/doc/modules/cassandra/pages/operating/virtualtables.adoc
@@ -106,18 +106,80 @@ We shall discuss some of the virtual tables in more
detail next.
=== Clients Virtual Table
The `clients` virtual table lists all active connections (connected
-clients) including their ip address, port, connection stage, driver
+clients) including their ip address, port, client_options, connection stage,
driver
name, driver version, hostname, protocol version, request count, ssl
enabled, ssl protocol and user name:
....
-cqlsh:system_views> select * from system_views.clients;
- address | port | connection_stage | driver_name | driver_version |
hostname | protocol_version | request_count | ssl_cipher_suite | ssl_enabled |
ssl_protocol | username
------------+-------+------------------+-------------+----------------+-----------+------------------+---------------+------------------+-------------+--------------+-----------
- 127.0.0.1 | 50628 | ready | null | null |
localhost | 4 | 55 | null | False |
null | anonymous
- 127.0.0.1 | 50630 | ready | null | null |
localhost | 4 | 70 | null | False |
null | anonymous
+cqlsh> EXPAND ON ;
+Now Expanded output is enabled
+cqlsh> SELECT * FROM system_views.clients;
+
+@ Row 1
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ address | 127.0.0.1
+ port | 50687
+ client_options | {'CQL_VERSION': '3.4.6', 'DRIVER_NAME': 'DataStax Python
Driver', 'DRIVER_VERSION': '3.25.0'}
+ connection_stage | ready
+ driver_name | DataStax Python Driver
+ driver_version | 3.25.0
+ hostname | localhost
+ protocol_version | 5
+ request_count | 16
+ ssl_cipher_suite | null
+ ssl_enabled | False
+ ssl_protocol | null
+ username | anonymous
+
+@ Row 2
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ address | 127.0.0.1
+ port | 50688
+ client_options | {'CQL_VERSION': '3.4.6', 'DRIVER_NAME': 'DataStax Python
Driver', 'DRIVER_VERSION': '3.25.0'}
+ connection_stage | ready
+ driver_name | DataStax Python Driver
+ driver_version | 3.25.0
+ hostname | localhost
+ protocol_version | 5
+ request_count | 4
+ ssl_cipher_suite | null
+ ssl_enabled | False
+ ssl_protocol | null
+ username | anonymous
+
+@ Row 3
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ address | 127.0.0.1
+ port | 50753
+ client_options | {'APPLICATION_NAME': 'TestApp', 'APPLICATION_VERSION':
'1.0.0', 'CLIENT_ID': '55b3efbd-c56b-469d-8cca-016b860b2f03', 'CQL_VERSION':
'3.0.0', 'DRIVER_NAME': 'DataStax Java driver for Apache Cassandra(R)',
'DRIVER_VERSION': '4.13.0'}
+ connection_stage | ready
+ driver_name | DataStax Java driver for Apache Cassandra(R)
+ driver_version | 4.13.0
+ hostname | localhost
+ protocol_version | 5
+ request_count | 18
+ ssl_cipher_suite | null
+ ssl_enabled | False
+ ssl_protocol | null
+ username | anonymous
+
+@ Row 4
+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ address | 127.0.0.1
+ port | 50755
+ client_options | {'APPLICATION_NAME': 'TestApp', 'APPLICATION_VERSION':
'1.0.0', 'CLIENT_ID': '55b3efbd-c56b-469d-8cca-016b860b2f03', 'CQL_VERSION':
'3.0.0', 'DRIVER_NAME': 'DataStax Java driver for Apache Cassandra(R)',
'DRIVER_VERSION': '4.13.0'}
+ connection_stage | ready
+ driver_name | DataStax Java driver for Apache Cassandra(R)
+ driver_version | 4.13.0
+ hostname | localhost
+ protocol_version | 5
+ request_count | 7
+ ssl_cipher_suite | null
+ ssl_enabled | False
+ ssl_protocol | null
+ username | anonymous
-(2 rows)
+(4 rows)
....
Some examples of how `clients` can be used are:
@@ -133,23 +195,29 @@ listed however cannot be run to create a virtual table.
As an example
describe the `system_views.clients` virtual table:
....
-cqlsh:system_views> DESC TABLE system_views.clients;
-CREATE TABLE system_views.clients (
+cqlsh> DESCRIBE TABLE system_views.clients;
+
+/*
+Warning: Table system_views.clients is a virtual table and cannot be recreated
with CQL.
+Structure, for reference:
+VIRTUAL TABLE system_views.clients (
address inet,
+ port int,
+ client_options frozen<map<text, text>>,
connection_stage text,
driver_name text,
driver_version text,
hostname text,
- port int,
protocol_version int,
request_count bigint,
ssl_cipher_suite text,
ssl_enabled boolean,
ssl_protocol text,
username text,
- PRIMARY KEY (address, port)) WITH CLUSTERING ORDER BY (port ASC)
- AND compaction = {'class': 'None'}
- AND compression = {};
+ PRIMARY KEY (address, port)
+) WITH CLUSTERING ORDER BY (port ASC)
+ AND comment = 'currently connected clients';
+*/
....
=== Caches Virtual Table
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]