Skip to content

Commit fe319a3

Browse files
authored
3.x: Fix code and docs regarding driver name (#406)
* Fix driver name in comments and docs * Check if driver reports correct driver name to the server * Add scylla.version property It doesn't do anything, just to keep in organized * Log correct dirver name * Install peotry with --no-root Otherwise it fails with: ``` Installing the current project: java-driver (3.7.1) Error: The current project could not be installed: No file/folder found for package java-driver If you do not want to install the current project use --no-root. If you want to use Poetry only for dependency management but not for packaging, you can disable package mode by setting package-mode = false in your pyproject.toml file. If you did intend to install the current project, you may need to set `packages` in your pyproject.toml file. ```
1 parent 2cd449d commit fe319a3

File tree

11 files changed

+31
-18
lines changed

11 files changed

+31
-18
lines changed

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ setupenv:
2323

2424
.PHONY: setup
2525
setup:
26-
$(POETRY) install
26+
$(POETRY) install --no-root
2727
$(POETRY) update
2828
@if [ ! -d "$(SOURCEDIR)" ]; then mkdir -p "$(SOURCEDIR)"; fi
2929
cp -RL source/* $(SOURCEDIR)

driver-core/src/main/java/com/datastax/driver/core/Cluster.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ public static String getDriverVersion() {
275275
* {@code INFO}.
276276
*/
277277
public static void logDriverVersion() {
278-
Logger core = LoggerFactory.getLogger("com.datastax.driver.core");
279-
core.info("DataStax Java driver {} for Apache Cassandra", getDriverVersion());
278+
LoggerFactory.getLogger("com.datastax.driver.core")
279+
.info("ScyllaDB Java Driver {}", getDriverVersion());
280280
}
281281

282282
/**

driver-core/src/main/java/com/datastax/driver/core/exceptions/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
/** Exceptions thrown by the DataStax Java driver for Cassandra. */
16+
/** Exceptions thrown by the ScyllaDB Java driver. */
1717
package com.datastax.driver.core.exceptions;

driver-core/src/main/java/com/datastax/driver/core/policies/package-info.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
/**
17-
* Policies that allow to control some of the behavior of the DataStax Java driver for Cassandra.
18-
*/
16+
/** Policies that allow to control some of the behavior of the ScyllaDB Java driver. */
1917
package com.datastax.driver.core.policies;

driver-core/src/test/java/com/datastax/driver/core/StartupOptionTest.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818
import static org.assertj.core.api.Assertions.assertThat;
1919

2020
import com.datastax.driver.core.utils.CassandraVersion;
21+
import com.datastax.driver.core.utils.ScyllaVersion;
2122
import org.testng.annotations.Test;
2223

23-
@CassandraVersion("4.0.0")
2424
public class StartupOptionTest extends CCMTestsSupport {
2525

2626
/**
2727
* Ensures that when connecting, the driver STARTUP message contains DRIVER_NAME and
2828
* DRIVER_VERSION configuration in its option map. This should be reflected in the
2929
* system_views.clients table.
3030
*/
31+
@CassandraVersion("4.0.0")
3132
@Test(groups = "short")
3233
public void should_send_driver_name_and_version() {
3334
ResultSet result =
@@ -38,7 +39,21 @@ public void should_send_driver_name_and_version() {
3839

3940
for (Row row : result) {
4041
assertThat(row.getString("driver_version")).isEqualTo(Cluster.getDriverVersion());
41-
assertThat(row.getString("driver_name")).isEqualTo("DataStax Java Driver");
42+
assertThat(row.getString("driver_name")).isEqualTo("ScyllaDB Java Driver");
43+
}
44+
}
45+
46+
@ScyllaVersion(minOSS = "5.2.0", minEnterprise = "2019.1")
47+
@Test(groups = "short")
48+
public void should_send_driver_name_and_version_scylla() {
49+
ResultSet result = session().execute("select driver_name, driver_version from system.clients");
50+
51+
// Should be at least 2 connections (1 control connection, 1 pooled connection)
52+
assertThat(result.getAvailableWithoutFetching()).isGreaterThanOrEqualTo(2);
53+
54+
for (Row row : result) {
55+
assertThat(row.getString("driver_version")).isEqualTo(Cluster.getDriverVersion());
56+
assertThat(row.getString("driver_name")).isEqualTo("ScyllaDB Java Driver");
4257
}
4358
}
4459
}

driver-examples/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# DataStax Java Driver for Apache Cassandra - Examples
1+
# ScyllaDB Java Driver - Examples
22

3-
This module contains examples of how to use the DataStax Java driver for
4-
Apache Cassandra.
3+
This module contains examples of how to use the ScyllaDB Java driver.
54

65
## Usage
76

8-
Unless otherwise stated, all examples assume that you have a single-node Cassandra 3.0 cluster
7+
Unless otherwise stated, all examples assume that you have a single-node ScyllaDB 6.2 cluster
98
listening on localhost:9042.
109

manual/logging/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Setup
44

5-
DataStax Java driver uses the popular [SLF4J](http://www.slf4j.org) library to emit log messages;
5+
The driver uses the popular [SLF4J](http://www.slf4j.org) library to emit log messages;
66
SLF4J has the advantage of providing a logging API that is entirely decoupled from concrete
77
implementations, letting client applications free to seamlessly connect SLF4J to their preferred logging backend.
88

manual/tuples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CREATE TABLE ks.collect_things (
1414

1515
### Fetching Tuples from Rows results
1616

17-
The DataStax Java driver exposes a special [`TupleValue`][TupleValue] class to handle such columns.
17+
The driver exposes a special [`TupleValue`][TupleValue] class to handle such columns.
1818
[`TupleValue`][TupleValue] exposes getters allowing to extract from the tuple all the data types
1919
supported by Cassandra:
2020

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5151
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5252
<cassandra.version>3.11.2</cassandra.version>
53+
<scylla.version/>
5354
<java.version>1.8</java.version>
5455
<log4j.version>1.2.17</log4j.version>
5556
<slf4j.version>1.7.25</slf4j.version>

upgrade_guide/migrating_from_astyanax/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Migrating from Astyanax
22

33
This section is a guide for users previously using *Astyanax* and looking for
4-
migrating to the *DataStax Java driver*.
4+
migrating to the *ScyllaDB Java driver*.
55

66
See the child pages for more information:
77

88
* [Changes at the language level](language_level_changes/)
9-
* [Migrating Astyanax configurations to DataStax Java driver configurations](configuration/)
9+
* [Migrating Astyanax configurations to ScyllaDB Java driver configurations](configuration/)
1010
* [Querying and retrieving results comparisons.](queries_and_results/)
1111

1212
```{eval-rst}

0 commit comments

Comments
 (0)