kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | fae8df33a8ab3a06b119f974bb4d9280df289ae73449446c9c37043890710365 |
|---|---|
| Author | Sylvain Lebresne <sylvain@datastax.com> · 2014-03-17 15:34 +01:00 |
| Committer | Sylvain Lebresne <sylvain@datastax.com> · 2014-03-17 15:34 +01:00 |
| Parents | 148d1c788234 |
3 files changed
modified driver-core/CHANGELOG.rst +2 −0
| @@ -5,6 +5,8 @@ | ||
| 5 | 5 | ------ |
| 6 | 6 | |
| 7 | 7 | - [new] Add method to check if a Cluster/Session instance has been closed already (JAVA-114) |
| 8 | +- [new] Expose the name of the partitioner in use in the cluster metadata (JAVA-179) | |
| 9 | + | |
| 8 | 10 | |
| 9 | 11 | 1.0.6: |
| 10 | 12 | ------ |
modified driver-core/src/main/java/com/datastax/driver/core/ControlConnection.java +2 −0
| @@ -325,6 +325,8 @@ | ||
| 325 | 325 | cluster.metadata.clusterName = clusterName; |
| 326 | 326 | |
| 327 | 327 | partitioner = localRow.getString("partitioner"); |
| 328 | + if (partitioner != null) | |
| 329 | + cluster.metadata.partitioner = partitioner; | |
| 328 | 330 | |
| 329 | 331 | Host host = cluster.metadata.getHost(connection.address); |
| 330 | 332 | // In theory host can't be null. However there is no point in risking a NPE in case we |
modified driver-core/src/main/java/com/datastax/driver/core/Metadata.java +11 −1
| @@ -33,6 +33,7 @@ | ||
| 33 | 33 | |
| 34 | 34 | private final Cluster.Manager cluster; |
| 35 | 35 | volatile String clusterName; |
| 36 | + volatile String partitioner; | |
| 36 | 37 | private final ConcurrentMap<InetAddress, Host> hosts = new ConcurrentHashMap<InetAddress, Host>(); |
| 37 | 38 | private final ConcurrentMap<String, KeyspaceMetadata> keyspaces = new ConcurrentHashMap<String, KeyspaceMetadata>(); |
| 38 | 39 | |
| @@ -181,7 +182,7 @@ | ||
| 181 | 182 | } |
| 182 | 183 | |
| 183 | 184 | /** |
| 184 | - * Returns the Cassandra name for the cluster connect to. | |
| 185 | + * The Cassandra name for the cluster connect to. | |
| 185 | 186 | * |
| 186 | 187 | * @return the Cassandra name for the cluster connect to. |
| 187 | 188 | */ |
| @@ -189,6 +190,15 @@ | ||
| 189 | 190 | return clusterName; |
| 190 | 191 | } |
| 191 | 192 | |
| 193 | + /** | |
| 194 | + * The partitioner in use as reported by the Cassandra nodes. | |
| 195 | + * | |
| 196 | + * @return the partitioner in use as reported by the Cassandra nodes. | |
| 197 | + */ | |
| 198 | + public String getPartitioner() { | |
| 199 | + return partitioner; | |
| 200 | + } | |
| 201 | + | |
| 192 | 202 | /** |
| 193 | 203 | * Returns the known hosts of this cluster. |
| 194 | 204 | * |