Expose some extra information from System.local table in Metadata

Description

Right now we only expose the cluster_name column in Metadata but it would make sense to also make the following columns available:

  • cql_version: would be useful for tools and framework to figure out which features are available

  • native_protocol_version: similar reason as the previous one, knowing whether it's one or two make it possible to switch between 2 drivers automatically

  • partitioner: Some CQL validation rules depends on which partitioner is used

  • release_version: For further validation and error messages for frameworks and tools

Environment

None

Pull Requests

None

Activity

Show:
Michaël Figuière
September 19, 2013, 12:36 AM

https://github.com/datastax/java-driver/pull/123 implements it for the 1.0 branch. native_protocol_version should be available only for 2.0.

Sylvain Lebresne
September 19, 2013, 8:25 AM

I'm good with putting the partitioner into the cluster metadata because it's a global thing, but I'm less fan for the versions since it's a node thing. I'd much rather put those with each Host object, so we expose the complete information. If a tool finds it good enough to use the version of any random node, then it's simple enough to do getMetadata().getAllHosts().iterator().next().getCQLVersion(). But at least, it the choice of the application to pick a random node, knowing that in some cases it's not necessarily representative of all nodes. And at least another tool may do the (imo better) choice to iterate over all node and pick the smallest version found.

For the native_protocol, not necessarily against, but I'm not that sure about it's utility. The 1.0 driver only does the v1 and the 2.0 only does v2 and they have incompatible API, so not sure there is much tools can do here. Especially if we're going to add it to 2.0 only, I don't see the point, at least today. If it becomes relevant in some future, let's add it when it's actually useful maybe?

Sylvain Lebresne
March 17, 2014, 2:44 PM

Committed simple patch to expose the partitioner in the Metadata. Regarding the versions (protocol and cassandra ones), they are already exposed in 2.0. So i think this close this ticket.

Assignee

Sylvain Lebresne

Reporter

Michaël Figuière

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Reviewer

Sylvain Lebresne

Priority

Minor
Configure