Skip to content

Commit

Permalink
3.x: Fix code and docs regarding driver name (#406)
Browse files Browse the repository at this point in the history
* 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.
```
  • Loading branch information
dkropachev authored Jan 16, 2025
1 parent 2cd449d commit fe319a3
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ setupenv:

.PHONY: setup
setup:
$(POETRY) install
$(POETRY) install --no-root
$(POETRY) update
@if [ ! -d "$(SOURCEDIR)" ]; then mkdir -p "$(SOURCEDIR)"; fi
cp -RL source/* $(SOURCEDIR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ public static String getDriverVersion() {
* {@code INFO}.
*/
public static void logDriverVersion() {
Logger core = LoggerFactory.getLogger("com.datastax.driver.core");
core.info("DataStax Java driver {} for Apache Cassandra", getDriverVersion());
LoggerFactory.getLogger("com.datastax.driver.core")
.info("ScyllaDB Java Driver {}", getDriverVersion());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Exceptions thrown by the DataStax Java driver for Cassandra. */
/** Exceptions thrown by the ScyllaDB Java driver. */
package com.datastax.driver.core.exceptions;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Policies that allow to control some of the behavior of the DataStax Java driver for Cassandra.
*/
/** Policies that allow to control some of the behavior of the ScyllaDB Java driver. */
package com.datastax.driver.core.policies;
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
import static org.assertj.core.api.Assertions.assertThat;

import com.datastax.driver.core.utils.CassandraVersion;
import com.datastax.driver.core.utils.ScyllaVersion;
import org.testng.annotations.Test;

@CassandraVersion("4.0.0")
public class StartupOptionTest extends CCMTestsSupport {

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

for (Row row : result) {
assertThat(row.getString("driver_version")).isEqualTo(Cluster.getDriverVersion());
assertThat(row.getString("driver_name")).isEqualTo("DataStax Java Driver");
assertThat(row.getString("driver_name")).isEqualTo("ScyllaDB Java Driver");
}
}

@ScyllaVersion(minOSS = "5.2.0", minEnterprise = "2019.1")
@Test(groups = "short")
public void should_send_driver_name_and_version_scylla() {
ResultSet result = session().execute("select driver_name, driver_version from system.clients");

// Should be at least 2 connections (1 control connection, 1 pooled connection)
assertThat(result.getAvailableWithoutFetching()).isGreaterThanOrEqualTo(2);

for (Row row : result) {
assertThat(row.getString("driver_version")).isEqualTo(Cluster.getDriverVersion());
assertThat(row.getString("driver_name")).isEqualTo("ScyllaDB Java Driver");
}
}
}
7 changes: 3 additions & 4 deletions driver-examples/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# DataStax Java Driver for Apache Cassandra - Examples
# ScyllaDB Java Driver - Examples

This module contains examples of how to use the DataStax Java driver for
Apache Cassandra.
This module contains examples of how to use the ScyllaDB Java driver.

## Usage

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

2 changes: 1 addition & 1 deletion manual/logging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Setup

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

Expand Down
2 changes: 1 addition & 1 deletion manual/tuples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CREATE TABLE ks.collect_things (

### Fetching Tuples from Rows results

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

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<cassandra.version>3.11.2</cassandra.version>
<scylla.version/>
<java.version>1.8</java.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
Expand Down
4 changes: 2 additions & 2 deletions upgrade_guide/migrating_from_astyanax/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Migrating from Astyanax

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

See the child pages for more information:

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

```{eval-rst}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Configuring a `Cluster` works with the *Builder* pattern. The `Builder` takes al
the configurations into account before building the `Cluster`.

Following are some examples of the most important configurations that were
possible with *Astyanax* and how to translate them into *DataStax Java driver*
possible with *Astyanax* and how to translate them into *ScyllaDB Java driver*
configurations. Please note that the Java driver has been optimized to handle most use
cases at best and even though the following sections show how to tune some various
options, the driver should provide the best performances with the default configurations
Expand Down

0 comments on commit fe319a3

Please sign in to comment.