MCPcopy Index your code
hub / github.com/apache/cassandra-java-driver

github.com/apache/cassandra-java-driver @4.19.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.19.3 ↗ · + Follow
16,076 symbols 81,221 edges 1,894 files 2,845 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Java Driver for Apache Cassandra®

License Maven Central

If you're reading this on github.com, please note that this is the readme for the development version and that some features described here might not yet have been released. You can find the documentation for latest version through DataStax Docs or via the release tags, e.g. 4.17.0.

A modern, feature-rich and highly tunable Java client library for Apache Cassandra® (2.1+) and [DataStax Enterprise] (4.7+), and [DataStax Astra], using exclusively Cassandra's binary protocol and Cassandra Query Language (CQL) v3.

Getting the driver

The driver artifacts are published in Maven central, under the group id org.apache.cassandra; there are multiple modules, all prefixed with java-driver-.

<dependency>
  <groupId>org.apache.cassandra</groupId>
  <artifactId>java-driver-core</artifactId>
  <version>${driver.version}</version>
</dependency>

<dependency>
  <groupId>org.apache.cassandra</groupId>
  <artifactId>java-driver-query-builder</artifactId>
  <version>${driver.version}</version>
</dependency>

<dependency>
  <groupId>org.apache.cassandra</groupId>
  <artifactId>java-driver-mapper-runtime</artifactId>
  <version>${driver.version}</version>
</dependency>

Note that the query builder is now published as a separate artifact, you'll need to add the dependency if you plan to use it.

Refer to each module's manual for more details (core, query builder, mapper).

Compatibility

The driver is compatible with Apache Cassandra® 2.1 and higher, DataStax Enterprise 4.7 and higher, and DataStax Astra.

It requires Java 8 or higher.

Disclaimer: Some DataStax/DataStax Enterprise products might partially work on big-endian systems, but DataStax does not officially support these systems.

Migrating from previous versions

Java Driver 4 is not binary compatible with previous versions. However, most of the concepts remain unchanged, and the new API will look very familiar to 2.x and 3.x users.

See the upgrade guide for details.

Useful links

License

© The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Cassandra are trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

Binary artifacts of this product bundle Java Native Runtime libraries, which is available under the Eclipse Public License version 2.0.

Extension points exported contracts — how you extend this code

BuildableQuery (Interface)
End state for the query builder DSL, which allows the generation of a CQL query. The API returns this type as soon a [8 …
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/BuildableQuery.java
NodeSet (Interface)
A thread-safe abstraction around a map of nodes per datacenter, to facilitate node management by load balancing policies [6 …
core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/nodeset/NodeSet.java
MethodGenerator (Interface)
A component that generates a single method. [21 implementers]
mapper-processor/src/main/java/com/datastax/oss/driver/internal/mapper/processor/MethodGenerator.java
NameConverter (Interface)
A custom converter to infer CQL column names from the names used in an Entity-annotated class. @see NamingStrat [3 implementers]
mapper-runtime/src/main/java/com/datastax/oss/driver/api/mapper/entity/naming/NameConverter.java
OnlyPKDao (Interface)
(no doc) [3 implementers]
integration-tests/src/test/java/com/datastax/oss/driver/mapper/UpdateIT.java
VersionComparator (Interface)
(no doc) [3 implementers]
test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/CcmBridge.java
MailboxService (Interface)
(no doc) [2 implementers]
osgi-tests/src/main/java/com/datastax/oss/driver/api/osgi/service/MailboxService.java
KillrVideoMapper (Interface)
(no doc)
examples/src/main/java/com/datastax/oss/driver/examples/mapper/killrvideo/KillrVideoMapper.java

Core symbols most depended-on inside this repo

isEqualTo
called by 3093
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/relation/ArithmeticRelationBuilder.java
build
called by 1454
core/src/main/java/com/datastax/dse/driver/api/core/data/geometry/Polygon.java
of
called by 1287
core/src/main/java/com/datastax/oss/driver/api/core/type/reflect/GenericType.java
get
called by 1144
core/src/main/java/com/datastax/oss/driver/api/core/data/GettableById.java
execute
called by 897
core/src/main/java/com/datastax/oss/driver/api/core/session/Session.java
append
called by 614
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/update/Assignment.java
put
called by 532
core/src/main/java/com/datastax/oss/driver/api/core/config/OptionsMap.java
isEmpty
called by 530
core/src/main/java/com/datastax/oss/driver/api/core/metadata/token/TokenRange.java

Shape

Method 13,751
Class 1,786
Interface 475
Enum 64

Languages

Java100%

Modules by API surface

integration-tests/src/test/java/com/datastax/oss/driver/mapper/SchemaValidationIT.java190 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/EntityPolymorphismIT.java138 symbols
core/src/main/java/com/datastax/oss/driver/internal/core/context/DefaultDriverContext.java94 symbols
core/src/main/java/com/datastax/dse/driver/internal/core/cql/continuous/ContinuousRequestHandlerBase.java63 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/TransientIT.java58 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/InventoryITBase.java57 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/DeleteIT.java57 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/DefaultNullSavingStrategyIT.java56 symbols
core/src/main/java/com/datastax/oss/driver/internal/core/config/typesafe/TypesafeDriverExecutionProfile.java56 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/DefaultKeyspaceIT.java54 symbols
integration-tests/src/test/java/com/datastax/oss/driver/mapper/QueryReturnTypesIT.java53 symbols
core/src/main/java/com/datastax/dse/driver/internal/core/insights/schema/InsightsStartupData.java53 symbols

For agents

$ claude mcp add cassandra-java-driver \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact