Skip to content

Commit 29b317b

Browse files
rashtaoSimran-B
andauthored
Java Driver: data definitions classes serialization disclaimer (#355)
* Java Driver: data definitions classes serialization disclaimer * Review --------- Co-authored-by: Simran Spiller <[email protected]>
1 parent c278610 commit 29b317b

File tree

3 files changed

+64
-34
lines changed

3 files changed

+64
-34
lines changed

site/content/3.10/develop/drivers/java/_index.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ To add the driver to your project with Gradle, add the following code to your
4949

5050
```groovy
5151
repositories {
52-
mavenCentral()
52+
mavenCentral()
5353
}
5454
5555
dependencies {
56-
implementation 'com.arangodb:arangodb-java-driver:7.x.x'
56+
implementation 'com.arangodb:arangodb-java-driver:7.x.x'
5757
}
5858
```
5959

@@ -143,41 +143,51 @@ for example:
143143

144144
```java
145145
ArangoDB adb = new ArangoDB.Builder()
146-
// ...
147-
.build();
148-
ArangoDBAsync adbAsync = adb.async();
149-
CompletableFuture<ArangoDBVersion> version = adbAsync.getVersion();
146+
// ...
147+
.build();
148+
ArangoDBAsync adbAsync = adb.async();
149+
CompletableFuture<ArangoDBVersion> version = adbAsync.getVersion();
150150
// ...
151151
```
152152

153153
Under the hood, both synchronous and asynchronous API use the same internal
154154
communication layer, which has been reworked and re-implemented in an
155155
asynchronous way. The synchronous API blocks and waits for the result, while the
156-
asynchronous one returns a `CompletableFuture<>` representing the pending
156+
asynchronous one returns a `CompletableFuture<>` representing the pending
157157
operation being performed.
158158
Each asynchronous API method is equivalent to the corresponding synchronous
159159
variant, except for the Cursor API.
160160

161161
### Async Cursor API
162162

163163
The Cursor API (`ArangoCursor` and `ArangoCursorAsync`) is intrinsically different,
164-
because the synchronous Cursor API is based on Java's `java.util.Iterator`, which
164+
because the synchronous Cursor API is based on Java's `java.util.Iterator`, which
165165
is an interface only suitable for synchronous scenarios.
166-
On the other side, the asynchronous Cursor API provides a method
167-
`com.arangodb.ArangoCursorAsync#nextBatch()`, which returns a
168-
`CompletableFuture<ArangoCursorAsync<T>>` and can be used to consume the next
166+
On the other side, the asynchronous Cursor API provides a method
167+
`com.arangodb.ArangoCursorAsync#nextBatch()`, which returns a
168+
`CompletableFuture<ArangoCursorAsync<T>>` and can be used to consume the next
169169
batch of the cursor, for example:
170170

171171
```java
172172
CompletableFuture<ArangoCursorAsync<Integer>> future1 = adbAsync.db()
173173
.query("FOR i IN i..10000", Integer.class);
174-
CompletableFuture<ArangoCursorAsync<Integer>> future2 = future1
174+
CompletableFuture<ArangoCursorAsync<Integer>> future2 = future1
175175
.thenCompose(c -> {
176-
List<Integer> batch = c.getResult();
177-
// ...
178-
// consume batch
179-
// ...
180-
return c.nextBatch();
176+
List<Integer> batch = c.getResult();
177+
// ...
178+
// consume batch
179+
// ...
180+
return c.nextBatch();
181181
});
182182
// ...
183183
```
184+
185+
## Data Definition Classes
186+
187+
Classes used to exchange data definitions, in particular classes in the packages
188+
`com.arangodb.entity.**` and `com.arangodb.model.**`, are meant to be serialized
189+
and deserialized internally by the driver.
190+
191+
The behavior to serialize and deserialize these classes is considered an internal
192+
implementation detail, and as such, it might change without prior notice.
193+
The API with regard to the public members of these classes is kept compatible.

site/content/3.11/develop/drivers/java/_index.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ To add the driver to your project with Gradle, add the following code to your
4949

5050
```groovy
5151
repositories {
52-
mavenCentral()
52+
mavenCentral()
5353
}
5454
5555
dependencies {
56-
implementation 'com.arangodb:arangodb-java-driver:7.x.x'
56+
implementation 'com.arangodb:arangodb-java-driver:7.x.x'
5757
}
5858
```
5959

@@ -143,41 +143,51 @@ for example:
143143

144144
```java
145145
ArangoDB adb = new ArangoDB.Builder()
146-
// ...
147-
.build();
148-
ArangoDBAsync adbAsync = adb.async();
149-
CompletableFuture<ArangoDBVersion> version = adbAsync.getVersion();
146+
// ...
147+
.build();
148+
ArangoDBAsync adbAsync = adb.async();
149+
CompletableFuture<ArangoDBVersion> version = adbAsync.getVersion();
150150
// ...
151151
```
152152

153153
Under the hood, both synchronous and asynchronous API use the same internal
154154
communication layer, which has been reworked and re-implemented in an
155155
asynchronous way. The synchronous API blocks and waits for the result, while the
156-
asynchronous one returns a `CompletableFuture<>` representing the pending
156+
asynchronous one returns a `CompletableFuture<>` representing the pending
157157
operation being performed.
158158
Each asynchronous API method is equivalent to the corresponding synchronous
159159
variant, except for the Cursor API.
160160

161161
### Async Cursor API
162162

163163
The Cursor API (`ArangoCursor` and `ArangoCursorAsync`) is intrinsically different,
164-
because the synchronous Cursor API is based on Java's `java.util.Iterator`, which
164+
because the synchronous Cursor API is based on Java's `java.util.Iterator`, which
165165
is an interface only suitable for synchronous scenarios.
166-
On the other side, the asynchronous Cursor API provides a method
167-
`com.arangodb.ArangoCursorAsync#nextBatch()`, which returns a
168-
`CompletableFuture<ArangoCursorAsync<T>>` and can be used to consume the next
166+
On the other side, the asynchronous Cursor API provides a method
167+
`com.arangodb.ArangoCursorAsync#nextBatch()`, which returns a
168+
`CompletableFuture<ArangoCursorAsync<T>>` and can be used to consume the next
169169
batch of the cursor, for example:
170170

171171
```java
172172
CompletableFuture<ArangoCursorAsync<Integer>> future1 = adbAsync.db()
173173
.query("FOR i IN i..10000", Integer.class);
174-
CompletableFuture<ArangoCursorAsync<Integer>> future2 = future1
174+
CompletableFuture<ArangoCursorAsync<Integer>> future2 = future1
175175
.thenCompose(c -> {
176-
List<Integer> batch = c.getResult();
177-
// ...
178-
// consume batch
179-
// ...
180-
return c.nextBatch();
176+
List<Integer> batch = c.getResult();
177+
// ...
178+
// consume batch
179+
// ...
180+
return c.nextBatch();
181181
});
182182
// ...
183183
```
184+
185+
## Data Definition Classes
186+
187+
Classes used to exchange data definitions, in particular classes in the packages
188+
`com.arangodb.entity.**` and `com.arangodb.model.**`, are meant to be serialized
189+
and deserialized internally by the driver.
190+
191+
The behavior to serialize and deserialize these classes is considered an internal
192+
implementation detail, and as such, it might change without prior notice.
193+
The API with regard to the public members of these classes is kept compatible.

site/content/3.12/develop/drivers/java/_index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,13 @@ CompletableFuture<ArangoCursorAsync<Integer>> future2 = future1
181181
});
182182
// ...
183183
```
184+
185+
## Data Definition Classes
186+
187+
Classes used to exchange data definitions, in particular classes in the packages
188+
`com.arangodb.entity.**` and `com.arangodb.model.**`, are meant to be serialized
189+
and deserialized internally by the driver.
190+
191+
The behavior to serialize and deserialize these classes is considered an internal
192+
implementation detail, and as such, it might change without prior notice.
193+
The API with regard to the public members of these classes is kept compatible.

0 commit comments

Comments
 (0)