I would like to make sure that I can connect to the db from Java service from time to time (like ping). This answer suggests to use show version
.
My Java service is using the Cassandra thrift client (which is deprecated) and I couldn't find an example how to execute such a query.
I have a client
of type org.apache.cassandra.thrift.Cassandra.Client
.
Those are the methods I found that are similar:
System.out.println("describe_schema_versions: " + nativeClient.describe_schema_versions());
System.out.println("describe_version: " + nativeClient.describe_version());
System.out.println("describe_snitch: " + nativeClient.describe_snitch());
System.out.println("describe_cluster_name: " + nativeClient.describe_cluster_name());
System.out.println("describe_keyspaces: " + nativeClient.describe_keyspaces());
System.out.println("describe_partitioner: " + nativeClient.describe_partitioner());
System.out.println("describe_token_map: " + nativeClient.describe_token_map());
How can I execute query to get Cassandra server version like this?
cqlsh> show version;
[cqlsh 3.1.8 | Cassandra 1.2.19 | CQL spec 3.0.5 | Thrift protocol 19.36.2]
Or is there an alternative query preferred as "ping"?
question from:
https://stackoverflow.com/questions/65936156/show-version-in-cassandra-and-thrift-protocol 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…