Elffuss BraidHub

kikocis/java-driver public

cd885c8b27a6 · 5.6 KiBRenderedRawPermalink
1# Datastax Java Driver for Apache Cassandra
2
3[![Build Status](https://travis-ci.org/datastax/java-driver.svg?branch=2.1)](https://travis-ci.org/datastax/java-driver)
4
5*If you're reading this on github.com, please note that this is the readme
6for the development version and that some features described here might
7not yet have been released. You can find the documentation for latest
8version through [Java driver
9docs](http://datastax.github.io/java-driver/) or via the release tags,
10[e.g.
112.1.9](https://github.com/datastax/java-driver/tree/2.1.9).*
12
13A modern, [feature-rich](manual/) and highly tunable Java client
14library for Apache Cassandra (1.2+) and DataStax Enterprise (3.1+) using
15exclusively Cassandra's binary protocol and Cassandra Query Language v3.
16
17**Features:**
18
19* [Sync](manual/) and [Async](manual/async/) API
20* [Simple](manual/statements/simple/), [Prepared](manual/statements/prepared/), and [Batch](manual/statements/batch/)
21 statements
22* Asynchronous IO, parallel execution, request pipelining
23* [Connection pooling](manual/pooling/)
24* Auto node discovery
25* Automatic reconnection
26* Configurable [load balancing](manual/load_balancing/) and [retry policies](manual/retries/)
27* Works with any cluster size
28* [Query builder](manual/statements/built/)
29* [Object mapper](manual/object_mapper/)
30
31The driver architecture is based on layers. At the bottom lies the driver core.
32This core handles everything related to the connections to a Cassandra
33cluster (for example, connection pool, discovering new nodes, etc.) and exposes a simple,
34relatively low-level API on top of which higher level layers can be built.
35
36The driver contains the following modules:
37
38- driver-core: the core layer.
39- driver-mapping: the object mapper.
40- driver-examples: example applications using the other modules which are
41 only meant for demonstration purposes.
42
43**Community:**
44
45- JIRA: https://datastax-oss.atlassian.net/browse/JAVA
46- MAILING LIST: https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
47- IRC: #datastax-drivers on [irc.freenode.net](http://freenode.net)
48- TWITTER: [@dsJavaDriver](https://twitter.com/dsJavaDriver) tweets Java
49 driver releases and important announcements (low frequency).
50 [@DataStaxEng](https://twitter.com/datastaxeng) has more news including
51 other drivers, Cassandra, and DSE.
52- DOCS: the [user guide](http://docs.datastax.com/en/developer/java-driver/2.1/java-driver/whatsNew2.html)
53 has introductory material. We are progressively migrating the doc
54 [here](manual/) with more technical details.
55- API: http://www.datastax.com/drivers/java/2.1
56
57**Feeback requested:** help us focus our efforts, provide your input on the [Platform and Runtime Survey](http://goo.gl/forms/qwUE6qnL7U) (we kept it short).
58
59
60## Getting the driver
61
62The latest release of the driver is available on Maven Central. You can install
63it in your application using the following Maven dependency:
64
65```xml
66<dependency>
67 <groupId>com.datastax.cassandra</groupId>
68 <artifactId>cassandra-driver-core</artifactId>
69 <version>2.1.9</version>
70</dependency>
71```
72
73Note that the object mapper is published as a separate artifact:
74
75```xml
76<dependency>
77 <groupId>com.datastax.cassandra</groupId>
78 <artifactId>cassandra-driver-mapping</artifactId>
79 <version>2.1.9</version>
80</dependency>
81```
82
83We also provide a [shaded JAR](manual/shaded_jar/)
84to avoid the explicit dependency to Netty.
85
86If you can't use a dependency management tool, a
87[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-2.1.9.tar.gz)
88is available for download.
89
90## Compatibility
91
92The Java client driver 2.1 ([branch 2.1](https://github.com/datastax/java-driver/tree/2.1)) is compatible with Apache
93Cassandra 1.2, 2.0, 2.1 and 2.2 (see [this page](http://datastax.github.io/java-driver/manual/native_protocol) for
94the most up-to-date compatibility information).
95
96UDT and tuple support is available only when using Apache Cassandra 2.1 or higher (see [CQL improvements in Cassandra 2.1](http://www.datastax.com/dev/blog/cql-in-2-1)).
97
98Other features are available only when using Apache Cassandra 2.0 or higher (e.g. result set paging,
99[BatchStatement](https://github.com/datastax/java-driver/blob/2.1/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java),
100[lightweight transactions](http://www.datastax.com/documentation/cql/3.1/cql/cql_using/use_ltweight_transaction_t.html)
101-- see [What's new in Cassandra 2.0](http://www.datastax.com/documentation/cassandra/2.0/cassandra/features/features_key_c.html)).
102Trying to use these with a cluster running Cassandra 1.2 will result in
103an [UnsupportedFeatureException](https://github.com/datastax/java-driver/blob/2.1/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java) being thrown.
104
105
106## Upgrading from previous versions
107
108If you are upgrading from a previous version of the driver, be sure to have a look at
109the [upgrade guide](/upgrade_guide/).
110
111
112### Troubleshooting
113
114If you are having issues connecting to the cluster (seeing `NoHostAvailableConnection` exceptions) please check the
115[connection requirements](https://github.com/datastax/java-driver/wiki/Connection-requirements).
116
117
118## License
119Copyright 2012-2015, DataStax
120
121Licensed under the Apache License, Version 2.0 (the "License");
122you may not use this file except in compliance with the License.
123You may obtain a copy of the License at
124
125http://www.apache.org/licenses/LICENSE-2.0
126
127Unless required by applicable law or agreed to in writing, software
128distributed under the License is distributed on an "AS IS" BASIS,
129WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
130See the License for the specific language governing permissions and
131limitations under the License.