kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | f3b7ffe9920874f05696a397ebf0c0488aed9f8128c274fa71b1a0309084cce9 |
|---|---|
| Author | olim7t <omichallat+github@gmail.com> · 2014-11-04 12:01 +01:00 |
| Committer | olim7t <omichallat+github@gmail.com> · 2014-11-04 14:55 +01:00 |
| Parents | 6124b21eb26d |
4 files changed
modified driver-core/CHANGELOG.rst +2 −0
| @@ -3,8 +3,10 @@ | ||
| 3 | 3 | |
| 4 | 4 | 2.0.8: |
| 5 | 5 | ------ |
| 6 | + | |
| 6 | 7 | - [bug] Fix token awareness for case-sensitive keyspaces and tables (JAVA-526) |
| 7 | 8 | - [bug] Check maximum number of values passed to SimpleStatement (JAVA-515) |
| 9 | +- [improvement] Expose the driver version through the API (JAVA-532) | |
| 8 | 10 | |
| 9 | 11 | |
| 10 | 12 | 2.0.7: |
modified driver-core/pom.xml +9 −0
| @@ -91,6 +91,15 @@ | ||
| 91 | 91 | |
| 92 | 92 | </dependencies> |
| 93 | 93 | |
| 94 | + <build> | |
| 95 | + <resources> | |
| 96 | + <resource> | |
| 97 | + <directory>src/main/resources</directory> | |
| 98 | + <filtering>true</filtering> | |
| 99 | + </resource> | |
| 100 | + </resources> | |
| 101 | + </build> | |
| 102 | + | |
| 94 | 103 | <profiles> |
| 95 | 104 | <profile> |
| 96 | 105 | <id>default</id> |
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +14 −0
| @@ -69,6 +69,8 @@ | ||
| 69 | 69 | private static final int NON_BLOCKING_EXECUTOR_SIZE = SystemProperties.getInt("com.datastax.driver.NON_BLOCKING_EXECUTOR_SIZE", |
| 70 | 70 | Runtime.getRuntime().availableProcessors()); |
| 71 | 71 | |
| 72 | + private static final ResourceBundle driverProperties = ResourceBundle.getBundle("com.datastax.driver.core.Driver"); | |
| 73 | + | |
| 72 | 74 | // Some per-JVM number that allows to generate unique cluster names when |
| 73 | 75 | // multiple Cluster instance are created in the same JVM. |
| 74 | 76 | private static final AtomicInteger CLUSTER_ID = new AtomicInteger(0); |
| @@ -187,6 +189,18 @@ | ||
| 187 | 189 | return new Cluster.Builder(); |
| 188 | 190 | } |
| 189 | 191 | |
| 192 | + /** | |
| 193 | + * Returns the current version of the driver. | |
| 194 | + * <p> | |
| 195 | + * This is intended for products that wrap or extend the driver, as a way to check | |
| 196 | + * compatibility if end-users override the driver version in their application. | |
| 197 | + * | |
| 198 | + * @return the version. | |
| 199 | + */ | |
| 200 | + public static String getDriverVersion() { | |
| 201 | + return driverProperties.getString("driver.version"); | |
| 202 | + } | |
| 203 | + | |
| 190 | 204 | /** |
| 191 | 205 | * Creates a new session on this cluster but does not initialize it. |
| 192 | 206 | * <p> |
added driver-core/src/main/resources/com/datastax/driver/core/Driver.properties +1 −0
| @@ -0,0 +1,1 @@ | ||
| 1 | +driver.version=${project.version} | |
| No newline at the end of the file |