mirror of https://github.com/apache/cassandra
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
This commit is contained in:
parent
bace51ce8e
commit
414f4143e6
|
|
@ -112,18 +112,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;
|
||||
|
||||
(2 rows)
|
||||
@ 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
|
||||
|
||||
(4 rows)
|
||||
....
|
||||
|
||||
Some examples of how `clients` can be used are:
|
||||
|
|
@ -139,23 +201,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
|
||||
|
|
|
|||
Loading…
Reference in New Issue