Elffuss BraidHub

kikocis/java-driver public

Migrate remaining reStructured files to markdown.
Changeset024a2b3f709e2d086f5b41e17b25a890ed4705c146e9421698d0bff14c1e2af2
Authorolim7t <omichallat+github@gmail.com> · 2015-05-28 09:59 +02:00
Committerolim7t <omichallat+github@gmail.com> · 2015-05-28 10:28 +02:00
Parents65c9a6af0e51

Browse the files at this changeset

7 files changed

added CONTRIBUTING.md +100 −0
@@ -0,0 +1,100 @@
1+# Contributing guidelines
2+
3+## Working on an issue
4+
5+Before starting to work on something, please comment in JIRA or ask on the mailing list
6+to make sure nobody else is working on it.
7+
8+If a fix applies both to 2.0 and 2.1, work on the 2.0 branch, your commit will eventually
9+get merged in 2.1.
10+
11+Before you send your pull request, make sure that:
12+
13+- you have a unit test that failed before the fix and succeeds after.
14+- the fix is mentioned in `driver-core/CHANGELOG.rst`.
15+- the commit message include the reference of the JIRA ticket for automatic linking
16+ (example: `Fix NPE when a connection fails during pool construction (JAVA-503).`).
17+
18+As long as your pull request is not merged, it's OK to rebase your branch and push with
19+`--force`.
20+
21+If you want to contribute but don't have a specific issue in mind, the [lhf](https://datastax-oss.atlassian.net/secure/IssueNavigator.jspa?reset=true&mode=hide&jqlQuery=project%20%3D%20JAVA%20AND%20status%20in%20(Open%2C%20Reopened)%20AND%20labels%20%3D%20lhf)
22+label in JIRA is a good place to start: it marks "low hanging fruits" that don't require
23+in-depth knowledge of the codebase.
24+
25+## Editor configuration
26+
27+### General
28+
29+We consider automatic formatting as a help, not a crutch. Sometimes it makes sense to
30+break the rules to make the code more readable, for instance aligning columns (see the
31+constant declarations in `DataType.Name` for an example of this).
32+
33+**Please do not reformat whole files, only the lines that you have added or modified**.
34+
35+
36+### Eclipse
37+
38+Formatter:
39+
40+- Preferences > Java > Code Style > Formatter.
41+- Click "Import".
42+- Select `src/main/config/ide/eclipse-formatter.xml`.
43+
44+Import order:
45+
46+- Preferences > Java > Code Style > Organize imports.
47+- Click "Import".
48+- Select `src/main/config/ide/eclipse.importorder`.
49+
50+Prevent trailing whitespaces:
51+
52+- Preferences > Java > Editor > Save Actions.
53+- Check "Perform the selected actions on save".
54+- Ensure "Format source code" and "Organize imports" are unchecked.
55+- Check "Additional actions".
56+- Click "Configure".
57+- In the "Code Organizing" tab, check "Remove trailing whitespace" and "All lines".
58+- Click "OK" (the text area should only have one action "Remove trailing white spaces").
59+
60+
61+### IntelliJ IDEA
62+
63+- File > Import Settings...
64+- Select `src/main/config/ide/intellij-code-style.jar`.
65+
66+This should add a new Code Style scheme called "java-driver".
67+
68+## Running the tests
69+
70+We use TestNG. There are 3 test categories:
71+
72+- "unit": pure Java unit tests.
73+- "short" and "long": integration tests that launch Cassandra instances.
74+
75+The Maven build uses profiles named after the categories to choose which tests to run:
76+
77+```
78+mvn test -Pshort
79+```
80+
81+The default is "unit". Each profile runs the ones before it ("short" runs unit, etc.)
82+
83+Integration tests use [CCM](https://github.com/pcmanus/ccm) to bootstrap Cassandra instances.
84+Two Maven properties control its execution:
85+
86+- `cassandra.version`: the Cassandra version. This has a default value in the root POM,
87+ you can override it on the command line (`-Dcassandra.version=...`).
88+- `ipprefix`: the prefix of the IP addresses that the Cassandra instances will bind to (see
89+ below). This defaults to `127.0.1.`.
90+
91+
92+CCM launches multiple Cassandra instances on localhost by binding to different addresses. The
93+driver uses up to 6 different instances (127.0.1.1 to 127.0.1.6 with the default prefix).
94+You'll need to define loopback aliases for this to work, on Mac OS X your can do it with:
95+
96+```
97+sudo ifconfig lo0 alias 127.0.1.1 up
98+sudo ifconfig lo0 alias 127.0.1.2 up
99+...
100+```
deleted CONTRIBUTING.rst +0 −103
@@ -1,103 +0,0 @@
1-Contributing guidelines
2-=======================
3-
4-Working on an issue
5--------------------
6-
7-Before starting to work on something, please comment in JIRA or ask on the mailing list
8-to make sure nobody else is working on it.
9-
10-If a fix applies both to 2.0 and 2.1, work on the 2.0 branch, your commit will eventually
11-get merged in 2.1.
12-
13-Before you send your pull request, make sure that:
14-
15-- you have a unit test that failed before the fix and succeeds after.
16-- the fix is mentioned in ``driver-core/CHANGELOG.rst``.
17-- the commit message include the reference of the JIRA ticket for automatic linking
18- (example: ``Fix NPE when a connection fails during pool construction (JAVA-503).``).
19-
20-As long as your pull request is not merged, it's OK to rebase your branch and push with
21-``--force``.
22-
23-If you want to contribute but don't have a specific issue in mind, the `lhf <https://datastax-oss.atlassian.net/secure/IssueNavigator.jspa?reset=true&mode=hide&jqlQuery=project%20%3D%20JAVA%20AND%20status%20in%20(Open%2C%20Reopened)%20AND%20labels%20%3D%20lhf>`_
24-label in JIRA is a good place to start: it marks "low hanging fruits" that don't require
25-in-depth knowledge of the codebase.
26-
27-Editor configuration
28---------------------
29-
30-General
31-~~~~~~~
32-
33-We consider automatic formatting as a help, not a crutch. Sometimes it makes sense to
34-break the rules to make the code more readable, for instance aligning columns (see the
35-constant declarations in ``DataType.Name`` for an example of this).
36-
37-**Please do not reformat whole files, only the lines that you have added or modified**.
38-
39-
40-Eclipse
41-~~~~~~~
42-
43-Formatter:
44-
45-- Preferences > Java > Code Style > Formatter.
46-- Click "Import".
47-- Select ``src/main/config/ide/eclipse-formatter.xml``.
48-
49-Import order:
50-
51-- Preferences > Java > Code Style > Organize imports.
52-- Click "Import".
53-- Select ``src/main/config/ide/eclipse.importorder``.
54-
55-Prevent trailing whitespaces:
56-
57-- Preferences > Java > Editor > Save Actions.
58-- Check "Perform the selected actions on save".
59-- Ensure "Format source code" and "Organize imports" are unchecked.
60-- Check "Additional actions".
61-- Click "Configure".
62-- In the "Code Organizing" tab, check "Remove trailing whitespace" and "All lines".
63-- Click "OK" (the text area should only have one action "Remove trailing white spaces").
64-
65-
66-IntelliJ IDEA
67-~~~~~~~~~~~~~
68-
69-- File > Import Settings...
70-- Select ``src/main/config/ide/intellij-code-style.jar``.
71-
72-This should add a new Code Style scheme called "java-driver".
73-
74-Running the tests
75------------------
76-
77-We use TestNG. There are 3 test categories:
78-
79-- "unit": pure Java unit tests.
80-- "short" and "long": integration tests that launch Cassandra instances.
81-
82-The Maven build uses profiles named after the categories to choose which tests to run::
83-
84- mvn test -Pshort
85-
86-The default is "unit". Each profile runs the ones before it ("short" runs unit, etc.)
87-
88-Integration tests use `CCM https://github.com/pcmanus/ccm`_ to bootstrap Cassandra instances.
89-Two Maven properties control its execution:
90-
91-- ``cassandra.version``: the Cassandra version. This has a default value in the root POM,
92- you can override it on the command line (``-Dcassandra.version=...``).
93-- ``ipprefix``: the prefix of the IP addresses that the Cassandra instances will bind to (see
94- below). This defaults to ``127.0.1.``.
95-
96-
97-CCM launches multiple Cassandra instances on localhost by binding to different addresses. The
98-driver uses up to 6 different instances (127.0.1.1 to 127.0.1.6 with the default prefix).
99-You'll need to define loopback aliases for this to work, on Mac OS X your can do it with:
100-
101- sudo ifconfig lo0 alias 127.0.1.1 up
102- sudo ifconfig lo0 alias 127.0.1.2 up
103- ...
deleted driver-core/README.rst +0 −100
@@ -1,100 +0,0 @@
1-Driver Core
2-===========
3-
4-This is the core module of the DataStax Java Driver for Apache Cassandra (C*),
5-which offers a simple (as in, not abstracted) but complete API to work with
6-CQL3. The main goal of the module is to handle all the functionality related
7-to managing connections to a Cassandra cluster (but leaving higher level
8-abstraction like object mapping to separate modules).
9-
10-
11-Features
12---------
13-
14-The features provided by the core module includes:
15- - Asynchronous: the driver uses the new CQL binary protocol asynchronous
16- capabilities. Only a relatively low number of connections per nodes needs to
17- be maintained open to achieve good performance.
18- - Nodes discovery: the driver automatically discovers and uses all nodes of the
19- C* cluster, including newly bootstrapped ones.
20- - Configurable load balancing: the driver allows for custom routing and load
21- balancing of queries to C* nodes. Out of the box, round robin is provided
22- with optional data-center awareness (only nodes from the local data-center
23- are queried (and have connections maintained to)) and optional token
24- awareness (that is, the ability to prefer a replica for the query as coordinator).
25- - Transparent fail-over: if C* nodes fail or become unreachable, the driver
26- automatically and transparently tries other nodes and schedules
27- reconnection to the dead nodes in the background.
28- - C* trace handling: tracing can be set on a per-query basis and the driver
29- provides a convenient API to retrieve the trace.
30- - Convenient schema access: the driver exposes a C* schema in a usable way.
31- - Configurable retry policy: a retry policy can be set to define a precise
32- behavior to adopt on query execution exceptions (for example, timeouts,
33- unavailability). This avoids polluting client code with retry-related code.
34-
35-
36-Prerequisite
37-------------
38-
39-The driver uses Casandra's native protocol which is available starting from
40-Cassandra 1.2. Some of the features (result set paging, BatchStatement, ...) of
41-this version 2.0 of the driver require Cassandra 2.0 however and will throw
42-'unsupported feature' exceptions if used against a Cassandra 1.2 cluster.
43-
44-If you are having issues connecting to the cluster (seeing ``NoHostAvailableConnection``
45-exceptions) please check the `connection requirements <https://github.com/datastax/java-driver/wiki/Connection-requirements>`_.
46-
47-If you want to run the unit tests provided with this driver, you will also need
48-to have ccm installed (http://github.com/pcmanus/ccm) as the tests use it. Also
49-note that the first time you run the tests, ccm will download/compile the
50-source of C* under the hood, which may require some time (that depends on your
51-Internet connection or machine).
52-
53-
54-Installing
55-----------
56-
57-The last release of the driver is available on Maven Central. You can install
58-it in your application using the following Maven dependency::
59-
60- <dependency>
61- <groupId>com.datastax.cassandra</groupId>
62- <artifactId>cassandra-driver-core</artifactId>
63- <version>2.0.10.1</version>
64- </dependency>
65-
66-
67-Upgrading from 1.x branch
68--------------------------
69-
70-If you are upgrading from the 1.x branch of the driver, be sure to have a look at
71-the `upgrade guide <https://github.com/datastax/java-driver/blob/2.0/driver-core/Upgrade_guide_to_2.0.rst>`_.
72-
73-We used the opportunity of a major version bump to incorporate your feedback and improve the API,
74-to fix a number of inconsistencies and remove cruft.
75-Unfortunately this means there are some breaking changes, but the new API should be both simpler and more complete.
76-
77-
78-Getting Started
79----------------
80-
81-Suppose you have a Cassandra cluster running on 3 nodes whose hostnames are:
82-cass1, cass2 and cass3. A simple example using this core driver could be::
83-
84- Cluster cluster = Cluster.builder()
85- .addContactPoints("cass1", "cass2")
86- .build();
87- Session session = cluster.connect("db1");
88-
89- for (Row row : session.execute("SELECT * FROM table1"))
90- // do something ...
91-
92-Please note that when we build the Cluster object, we only provide the address
93-to 2 Cassandra hosts. We could have provided only one host or the 3 of them,
94-this doesn't matter as long as the driver is able to contact one of the host
95-provided as "contact points". Even if only one host was provided, the driver
96-would use this host to discover the other ones and use the whole cluster
97-automatically. This is also true for new nodes joining the cluster.
98-
99-For now, please refer to the API reference (http://docs.datastax.com/en/drivers/java/2.0).
100-More informations and documentation will come later.
added driver-examples/osgi/README.md +30 −0
@@ -0,0 +1,30 @@
1+# OSGi Example
2+
3+A simple example application that demonstrates using the Java Driver in
4+an OSGi service.
5+
6+MailboxService is an activated service that uses Cassandra to
7+persist a Mailbox by email address.
8+
9+## Usage
10+
11+To build the bundle and run tests execute the following maven task::
12+
13+ mvn integration-test -P short
14+
15+The short profile needs to be activated since the tests run under
16+this group.
17+
18+After which the bundle jar will be present in the target/ directory.
19+
20+The project includes an integration test that verifies the service can
21+be activated and used in an OSGi container. It also verifies that
22+driver-core can be used in an OSGi container in the following
23+configurations:
24+
25+1. Default (default classifier with all dependencies)
26+2. Netty-Shaded (shaded classifier with all depedencies w/o Netty)
27+3. Guava 15 (default classifier with Guava 15.0)
28+4. Guava 16
29+5. Guava 17
30+6. Guava 18
deleted driver-examples/osgi/README.rst +0 −32
@@ -1,32 +0,0 @@
1-OSGi Example
2-============
3-
4-A simple example application that demonstrates using the Java Driver in
5-an OSGi service.
6-
7-MailboxService is an activated service that uses Cassandra to
8-persist a Mailbox by email address.
9-
10-Usage
11------
12-
13-To build the bundle and run tests execute the following maven task::
14-
15- mvn integration-test -P short
16-
17-The short profile needs to be activated since the tests run under
18-this group.
19-
20-After which the bundle jar will be present in the target/ directory.
21-
22-The project includes an integration test that verifies the service can
23-be activated and used in an OSGi container. It also verifies that
24-driver-core can be used in an OSGi container in the following
25-configurations:
26-
27-1. Default (default classifier with all dependencies)
28-2. Netty-Shaded (shaded classifier with all depedencies w/o Netty)
29-3. Guava 15 (default classifier with Guava 15.0)
30-4. Guava 16
31-5. Guava 17
32-6. Guava 18
added driver-examples/stress/README.md +25 −0
@@ -0,0 +1,25 @@
1+# Stress application
2+
3+A simple example application that uses the java driver to stress test
4+Cassandra. This also somewhat stress test the java driver as a result.
5+
6+Please note that this simple example is far from being a complete stress
7+application. In particular it currently supports a very limited number of
8+stress scenario.
9+
10+## Usage
11+
12+You will need to build the stress application fist:
13+
14+ ./bin/build
15+
16+After which you can run it using for instance:
17+
18+ ./bin/stress insert_prepared
19+
20+Of course, you will need to have at least one Cassandra node running (on
21+127.0.0.1 by default) for this to work. Please refer to:
22+
23+ ./bin/stress -h
24+
25+for more details on the options available.
deleted driver-examples/stress/README.rst +0 −27
@@ -1,27 +0,0 @@
1-Stress application
2-==================
3-
4-A simple example application that uses the java driver to stress test
5-Cassandra. This also somewhat stress test the java driver as a result.
6-
7-Please note that this simple example is far from being a complete stress
8-application. In particular it currently supports a very limited number of
9-stress scenario.
10-
11-Usage
12------
13-
14-You will need to build the stress application fist:
15-
16- ./bin/build
17-
18-After which you can run it using for instance:
19-
20- ./bin/stress insert_prepared
21-
22-Of course, you will need to have at least one Cassandra node running (on
23-127.0.0.1 by default) for this to work. Please refer to:
24-
25- ./bin/stress -h
26-
27-for more details on the options available.