Skip to content

Commit 9bd6b7c

Browse files
committed
Merge branch 'master' of github.com:arangodb/arangodb-java-driver
2 parents dc3240f + 2671d06 commit 9bd6b7c

File tree

7 files changed

+227
-1
lines changed

7 files changed

+227
-1
lines changed

docs/Drivers/Java/Reference/Collection/CollectionManipulation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ then returns collection information from the server.
3535
automatically and one of the servers holding copies take over, usually
3636
without an error being reported.
3737

38+
- **minReplicationFactor**: `Integer`
39+
40+
(optional, default is 1): in a cluster, this
41+
attribute determines how many copies of each shard are required
42+
to be in sync on the different DBServers. If we have less then these
43+
many copies in the cluster a shard will refuse to write. The
44+
minReplicationFactor can not be larger than replicationFactor.
45+
Please note: during server failures this might lead to writes
46+
not being possible until the failover is sorted out and might cause
47+
write slow downs in trade of data durability.
48+
3849
- **satellite**: `Boolean`
3950

4051
If the true the collection is created as a satellite collection.

docs/Drivers/Java/Reference/Collection/DocumentManipulation.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Retrieves the document with the given \_key from the collection.
5555

5656
Whether or not catch possible thrown exceptions
5757

58+
- **streamTransactionId**: `String`
59+
60+
If set, the operation will be executed within the transaction
61+
5862
**Examples**
5963

6064
```Java
@@ -135,6 +139,10 @@ generated automatically.
135139
will be returned for the created document. This option can be used to save
136140
some network traffic.
137141

142+
- **streamTransactionId**: `String`
143+
144+
If set, the operation will be executed within the transaction
145+
138146
**Examples**
139147

140148
```Java
@@ -190,6 +198,10 @@ generated automatically.
190198
will be returned for the created document. This option can be used to save
191199
some network traffic.
192200

201+
- **streamTransactionId**: `String`
202+
203+
If set, the operation will be executed within the transaction
204+
193205
**Examples**
194206

195207
```Java
@@ -254,6 +266,10 @@ such a document and no precondition is violated.
254266
will be returned for the created document. This option can be used to save
255267
some network traffic.
256268

269+
- **streamTransactionId**: `String`
270+
271+
If set, the operation will be executed within the transaction
272+
257273
**Examples**
258274

259275
```Java
@@ -317,6 +333,10 @@ documents in values.
317333
will be returned for the created document. This option can be used to save
318334
some network traffic.
319335

336+
- **streamTransactionId**: `String`
337+
338+
If set, the operation will be executed within the transaction
339+
320340
**Examples**
321341

322342
```Java
@@ -385,6 +405,10 @@ such a document and no precondition is violated.
385405
will be returned for the created document. This option can be used to save
386406
some network traffic.
387407

408+
- **streamTransactionId**: `String`
409+
410+
If set, the operation will be executed within the transaction
411+
388412
**Examples**
389413

390414
```Java
@@ -448,6 +472,10 @@ documents in values.
448472
will be returned for the created document. This option can be used to save
449473
some network traffic.
450474

475+
- **streamTransactionId**: `String`
476+
477+
If set, the operation will be executed within the transaction
478+
451479
**Examples**
452480

453481
```Java

docs/Drivers/Java/Reference/Collection/Indexes.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ Creates a hash index for the collection if it does not already exist.
1717

1818
- **options**: `HashIndexOptions`
1919

20+
- **name**: `String`
21+
22+
Specify a custom name during index creation (optional). When running AQL queries you might then refer
23+
to these name as your preferred index for lookups (e.g. Index Hints).
24+
2025
- **unique**: `Boolean`
2126

2227
If true, then create a unique index
@@ -59,6 +64,11 @@ Creates a skip-list index for the collection if it does not already exist.
5964

6065
- **options**: `SkipListIndexOptions`
6166

67+
- **name**: `String`
68+
69+
Specify a custom name during index creation (optional). When running AQL queries you might then refer
70+
to these name as your preferred index for lookups (e.g. Index Hints).
71+
6272
- **unique**: `Boolean`
6373

6474
If true, then create a unique index
@@ -103,6 +113,11 @@ Creates a geo index for the collection if it does not already exist.
103113

104114
- **options**: `GeoIndexOptions`
105115

116+
- **name**: `String`
117+
118+
Specify a custom name during index creation (optional). When running AQL queries you might then refer
119+
to these name as your preferred index for lookups (e.g. Index Hints).
120+
106121
- **geoJson**: `Boolean`
107122

108123
If a geo-spatial index on a location is constructed and geoJson is true,
@@ -141,6 +156,11 @@ Creates a fulltext index for the collection if it does not already exist.
141156

142157
- **options**: `FulltextIndexOptions`
143158

159+
- **name**: `String`
160+
161+
Specify a custom name during index creation (optional). When running AQL queries you might then refer
162+
to these name as your preferred index for lookups (e.g. Index Hints).
163+
144164
- **minLength**: `Integer`
145165

146166
Minimum character length of words to index. Will default to a server-defined
@@ -179,6 +199,11 @@ Creates a persistent index for the collection if it does not already exist.
179199

180200
- **options**: `PersistentIndexOptions`
181201

202+
- **name**: `String`
203+
204+
Specify a custom name during index creation (optional). When running AQL queries you might then refer
205+
to these name as your preferred index for lookups (e.g. Index Hints).
206+
182207
- **unique**: `Boolean`
183208

184209
If true, then create a unique index
@@ -203,6 +228,49 @@ IndexEntity index = collection.ensurePersistentIndex(Arrays.asList("a", "b.c"));
203228
// the index has been created with the handle `index.getId()`
204229
```
205230

231+
## ArangoCollection.ensureTtlIndex
232+
233+
`ArangoCollection.ensureTtlIndex(Iterable<String> fields, TtlIndexOptions options) : IndexEntity`
234+
235+
Creates a ttl index for the collection if it does not already exist.
236+
237+
**Arguments**
238+
239+
- **fields**: `Iterable<String>`
240+
241+
A list of attribute paths
242+
243+
- **options**: `PersistentIndexOptions`
244+
245+
- **name**: `String`
246+
247+
Specify a custom name during index creation (optional). When running AQL queries you might then refer
248+
to these name as your preferred index for lookups (e.g. Index Hints).
249+
250+
- **expireAfter**: `Integer`
251+
252+
The time (in seconds) after a document's creation after which the documents count as "expired".
253+
254+
- **inBackground**: `Boolean`
255+
256+
Indexes created with the 'inBackground' option, will not hold an exclusive collection
257+
lock for the entire index creation period (rocksdb only).
258+
259+
**Examples**
260+
261+
```Java
262+
ArangoDB arango = new ArangoDB.Builder().build();
263+
ArangoDatabase db = arango.db("myDB");
264+
ArangoCollection collection = db.collection("some-collection");
265+
266+
final TtlIndexOptions options = new TtlIndexOptions();
267+
options.name("myTtlIndex");
268+
options.expireAfter(3600);
269+
270+
IndexEntity index = collection.ensureTtlIndex(Arrays.asList("a", "b.c"), options);
271+
// the index has been created with the handle `index.getId()`
272+
```
273+
206274
## ArangoCollection.getIndex
207275

208276
`ArangoCollection.getIndex(String id) : IndexEntity`

docs/Drivers/Java/Reference/Database/Queries.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ a new _ArangoCursor_ instance for the result list.
151151
query statistics, warnings and profiling data will only be available after
152152
the query is finished. The default value is false.
153153

154+
- **streamTransactionId**: `String`
155+
156+
If set, the operation will be executed within the transaction
157+
154158
- **type**: `Class<T>`
155159

156160
The type of the result (POJO class, `VPackSlice`, `String` for JSON, or `Collection`/`List`/`Map`)
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Transactions
2+
3+
See [HTTP Interface for Stream Transactions](https://docs.arangodb.com/latest/HTTP/transaction-stream-transaction.html).
4+
5+
6+
## ArangoDatabase.beginStreamTransaction
7+
8+
`ArangoDatabase.beginStreamTransaction(StreamTransactionOptions options) : StreamTransactionEntity`
9+
10+
Begins a server-side transaction and returns information about it.
11+
12+
**Arguments**
13+
14+
- **options**: `StreamTransactionOptions`
15+
16+
transaction options
17+
18+
19+
## ArangoDatabase.getStreamTransaction
20+
21+
`ArangoDatabase.getStreamTransaction(String id) : StreamTransactionEntity`
22+
23+
Gets information about a Stream Transaction.
24+
25+
**Arguments**
26+
27+
- **id**: `String`
28+
29+
transaction id
30+
31+
32+
## ArangoDatabase.commitStreamTransaction
33+
34+
`ArangoDatabase.commitStreamTransaction(String id) : StreamTransactionEntity`
35+
36+
Commits a Stream Transaction.
37+
38+
**Arguments**
39+
40+
- **id**: `String`
41+
42+
transaction id
43+
44+
45+
## ArangoDatabase.abortStreamTransaction
46+
47+
`ArangoDatabase.abortStreamTransaction(String id) : StreamTransactionEntity`
48+
49+
Aborts a Stream Transaction.
50+
51+
**Arguments**
52+
53+
- **id**: `String`
54+
55+
transaction id
56+
57+
58+
## Examples
59+
60+
```Java
61+
ArangoDB arango = new ArangoDB.Builder().build();
62+
ArangoDatabase db = arango.db("myDB");
63+
64+
StreamTransactionEntity tx1 = db.beginStreamTransaction(
65+
new StreamTransactionOptions().readCollections("collection").writeCollections("collection"));
66+
db.collection("collection")
67+
.insertDocument(new BaseDocument(), new DocumentCreateOptions().streamTransactionId(tx1.getId()));
68+
db.commitStreamTransaction(tx1.getId());
69+
StreamTransactionEntity tx = db.getStreamTransaction(tx1.getId());
70+
assertThat(tx.getStatus(), is(StreamTransactionEntity.StreamTransactionStatus.committed));
71+
72+
StreamTransactionEntity tx2 = db.beginStreamTransaction(
73+
new StreamTransactionOptions().readCollections("collection").writeCollections("collection"));
74+
final Map<String, Object> bindVars = new HashMap<>();
75+
bindVars.put("@collection", COLLECTION_NAME);
76+
bindVars.put("key", "myKey");
77+
ArangoCursor<BaseDocument> cursor = db
78+
.query("FOR doc IN @@collection FILTER doc._key == @key RETURN doc", bindVars,
79+
new AqlQueryOptions().streamTransactionId(tx2.getId()), BaseDocument.class);
80+
db.abortStreamTransaction(tx2.getId());
81+
```

docs/Drivers/Java/Reference/Graph/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ name of the graph and a definition of its edges.
4343
automatically and one of the servers holding copies take over, usually
4444
without an error being reported.
4545

46+
- **minReplicationFactor**: `Integer`
47+
48+
(optional, default is 1): in a cluster, this
49+
attribute determines how many copies of each shard are required
50+
to be in sync on the different DBServers. If we have less then these
51+
many copies in the cluster a shard will refuse to write. The
52+
minReplicationFactor can not be larger than replicationFactor.
53+
Please note: during server failures this might lead to writes
54+
not being possible until the failover is sorted out and might cause
55+
write slow downs in trade of data durability.
56+
4657
- **numberOfShards**: `Integer`
4758

4859
The number of shards that is used for every collection within this graph.

docs/Drivers/Java/Reference/View/ArangoSearch.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@ view information from the server.
1818

1919
- **options**: `ArangoSearchCreateOptions`
2020

21+
- **commitIntervalMsec**: `Long`
22+
23+
Wait at least this many milliseconds between committing view data store changes
24+
and making documents visible to queries (default: 1000, to disable use: 0). For
25+
the case where there are a lot of inserts/updates, a lower value, until commit,
26+
will cause the index not to account for them and memory usage would continue to
27+
grow. For the case where there are a few inserts/updates, a higher value will
28+
impact performance and waste disk space for each commit call without any added
29+
benefits. Background: For data retrieval ArangoSearch views follow the concept
30+
of "eventually-consistent", i.e. eventually all the data in ArangoDB will be
31+
matched by corresponding query expressions. The concept of ArangoSearch view
32+
"commit" operation is introduced to control the upper-bound on the time until
33+
document addition/removals are actually reflected by corresponding query
34+
expressions. Once a "commit" operation is complete all documents added/removed
35+
prior to the start of the "commit" operation will be reflected by queries
36+
invoked in subsequent ArangoDB transactions, in-progress ArangoDB transactions
37+
will still continue to return a repeatable-read state.
38+
2139
- **consolidationIntervalMsec**: `Long`
2240

2341
Wait at least this many milliseconds between committing index data changes
@@ -54,10 +72,15 @@ view information from the server.
5472
Apply the "consolidation" operation if and only if (default: 300):
5573
`{segmentThreshold} < number_of_segments`
5674

57-
- **link**: `CollectionLink[]`
75+
- **links**: `CollectionLink[]`
5876

5977
A list of linked collections
6078

79+
- **primarySorts**: `CollectionLink[]`
80+
81+
A list of primary sort objects. When creating an ArangoSearch View, you
82+
can optionally define a default sort order.
83+
6184
**Examples**
6285

6386
```Java

0 commit comments

Comments
 (0)