Skip to content

Commit c636ed3

Browse files
rashtaoSimran-B
andauthored
[DE-794] Java Driver: connection TTL (#502)
* Java Driver: connection TTL * Partially apply to later versions, style --------- Co-authored-by: Simran Spiller <[email protected]>
1 parent 6c7abfa commit c636ed3

File tree

3 files changed

+31
-19
lines changed

3 files changed

+31
-19
lines changed

site/content/3.11/develop/drivers/java/reference-version-7/driver-setup.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Here are examples to integrate configuration properties from different sources:
8383
- `verifyHost(Boolean)`: enable hostname verification, (HTTP only, default: `true`)
8484
- `chunkSize(Integer)`: VST chunk size in bytes, (default: `30000`)
8585
- `maxConnections(Integer)`: max number of connections per host, (default: 1 VST, 1 HTTP/2, 20 HTTP/1.1)
86-
- `connectionTtl(Long)`: max lifetime of a connection (ms), (default: no ttl)
86+
- `connectionTtl(Long)`: time to live of an inactive connection (ms), (default: `30_000` for HTTP, no TTL for VST)
8787
- `keepAliveInterval(Integer)`: VST keep-alive interval (s), (default: no keep-alive probes will be sent)
8888
- `acquireHostList(Boolean)`: acquire the list of available hosts, (default: `false`)
8989
- `acquireHostListInterval(Integer)`: acquireHostList interval (ms), (default: `3_600_000`, 1 hour)
@@ -132,7 +132,7 @@ ArangoDB arangoDB = new ArangoDB.Builder()
132132
The driver keeps a pool of connections for each host, the max amount of
133133
connections is configurable.
134134

135-
Connections are released after the configured connection time-to-live
135+
Inactive connections are released after the configured connection time-to-live
136136
(`ArangoDB.Builder.connectionTtl(Long)`) or when the driver is shut down:
137137

138138
```java
@@ -221,22 +221,24 @@ ArangoDB arangoDB = new ArangoDB.Builder()
221221

222222
## Connection time to live
223223

224-
The driver supports setting a TTL (time to life) for connections:
224+
The driver supports setting a TTL (time to live) for connections:
225225

226226
```java
227227
ArangoDB arango = new ArangoDB.Builder()
228228
.connectionTtl(5 * 60 * 1000) // ms
229229
.build();
230230
```
231231

232-
In this example all connections will be closed/reopened after 5 minutes.
232+
In this example, inactive connections are closed after 5 minutes.
233233

234-
If not set or set to `null` (default), no automatic connection closure will be performed.
234+
The default TTL for HTTP connections is 30 seconds, while it is `null` for VST connections.
235+
236+
If set to `null`, no automatic connection closure is performed.
235237

236238
## VST Keep-Alive
237239

238240
The driver supports setting keep-alive interval (in seconds)
239-
for VST connections. If set, every VST connection will perform a no-op request
241+
for VST connections. If set, every VST connection performs a no-op request
240242
at the specified intervals, to avoid to be closed due to inactivity by the
241243
server (or by the external environment, e.g. firewall, intermediate routers,
242244
operating system, ... ).

site/content/3.12/develop/drivers/java/reference-version-7/driver-setup.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Here are examples to integrate configuration properties from different sources:
8383
- `verifyHost(Boolean)`: enable hostname verification, (HTTP only, default: `true`)
8484
- `chunkSize(Integer)`: VST chunk size in bytes, (default: `30000`)
8585
- `maxConnections(Integer)`: max number of connections per host, (default: 1 VST, 1 HTTP/2, 20 HTTP/1.1)
86-
- `connectionTtl(Long)`: max lifetime of a connection (ms), (default: no ttl)
86+
- `connectionTtl(Long)`: time to live of an inactive connection (ms), (default: `30_000` for HTTP, no TTL for VST)
8787
- `keepAliveInterval(Integer)`: VST keep-alive interval (s), (default: no keep-alive probes will be sent)
8888
- `acquireHostList(Boolean)`: acquire the list of available hosts, (default: `false`)
8989
- `acquireHostListInterval(Integer)`: acquireHostList interval (ms), (default: `3_600_000`, 1 hour)
@@ -138,7 +138,7 @@ ArangoDB arangoDB = new ArangoDB.Builder()
138138
The driver keeps a pool of connections for each host, the max amount of
139139
connections is configurable.
140140

141-
Connections are released after the configured connection time-to-live
141+
Inactive connections are released after the configured connection time-to-live
142142
(`ArangoDB.Builder.connectionTtl(Long)`) or when the driver is shut down:
143143

144144
```java
@@ -213,23 +213,25 @@ ArangoDB arangoDB = new ArangoDB.Builder()
213213

214214
## Connection time to live
215215

216-
The driver supports setting a TTL (time to life) for connections:
216+
The driver supports setting a TTL (time to live) for connections:
217217

218218
```java
219219
ArangoDB arango = new ArangoDB.Builder()
220220
.connectionTtl(5 * 60 * 1000) // ms
221221
.build();
222222
```
223223

224-
In this example all connections will be closed/reopened after 5 minutes.
224+
In this example, inactive connections are closed after 5 minutes.
225225

226-
If not set or set to `null` (default), no automatic connection closure will be performed.
226+
The default TTL for HTTP connections is 30 seconds, while it is `null` for VST connections.
227+
228+
If set to `null`, no automatic connection closure is performed.
227229

228230
## VST Keep-Alive
229231

230232
The driver supports setting keep-alive interval (in seconds)
231233
for VST connections (but VST is not supported from ArangoDB v3.12.0 onward).
232-
If set, every VST connection will perform a no-op request
234+
If set, every VST connection performs a no-op request
233235
at the specified intervals, to avoid to be closed due to inactivity by the
234236
server (or by the external environment, e.g. firewall, intermediate routers,
235237
operating system, ... ).

site/content/4.0/develop/drivers/java/reference-version-7/driver-setup.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,16 @@ Here are examples to integrate configuration properties from different sources:
8383
- `verifyHost(Boolean)`: enable hostname verification, (HTTP only, default: `true`)
8484
- `chunkSize(Integer)`: VST chunk size in bytes, (default: `30000`)
8585
- `maxConnections(Integer)`: max number of connections per host, (default: 1 VST, 1 HTTP/2, 20 HTTP/1.1)
86-
- `connectionTtl(Long)`: max lifetime of a connection (ms), (default: no ttl)
86+
- `connectionTtl(Long)`: time to live of an inactive connection (ms), (default: `30_000` for HTTP, no TTL for VST)
8787
- `keepAliveInterval(Integer)`: VST keep-alive interval (s), (default: no keep-alive probes will be sent)
8888
- `acquireHostList(Boolean)`: acquire the list of available hosts, (default: `false`)
8989
- `acquireHostListInterval(Integer)`: acquireHostList interval (ms), (default: `3_600_000`, 1 hour)
9090
- `loadBalancingStrategy(LoadBalancingStrategy)`: load balancing strategy, possible values are: `NONE`, `ROUND_ROBIN`, `ONE_RANDOM`, (default: `NONE`)
9191
- `responseQueueTimeSamples(Integer)`: amount of samples kept for queue time metrics, (default: `10`)
92-
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
92+
- `compression(Compression)`: the `content-encoding` and `accept-encoding` to use for HTTP requests, possible values are: `NONE`, `DEFLATE`, `GZIP`, (default: `NONE`)
93+
- `compressionThreshold(Integer)`: the minimum HTTP request body size (in bytes) to trigger compression, (default: `1024`)
94+
- `compressionLevel`: compression level between 0 and 9, (default: `6`)
95+
- `serde(ArangoSerde)`: serde to serialize and deserialize user-data
9396

9497
### Config File Properties
9598

@@ -114,6 +117,9 @@ The properties read are:
114117
- `acquireHostListInterval`
115118
- `loadBalancingStrategy`: `NONE`, `ROUND_ROBIN` or `ONE_RANDOM`
116119
- `responseQueueTimeSamples`
120+
- `compression`: `NONE`, `DEFLATE` or `GZIP`
121+
- `compressionThreshold`
122+
- `compressionLevel`
117123

118124
## SSL
119125

@@ -132,7 +138,7 @@ ArangoDB arangoDB = new ArangoDB.Builder()
132138
The driver keeps a pool of connections for each host, the max amount of
133139
connections is configurable.
134140

135-
Connections are released after the configured connection time-to-live
141+
Inactive connections are released after the configured connection time-to-live
136142
(`ArangoDB.Builder.connectionTtl(Long)`) or when the driver is shut down:
137143

138144
```java
@@ -207,23 +213,25 @@ ArangoDB arangoDB = new ArangoDB.Builder()
207213

208214
## Connection time to live
209215

210-
The driver supports setting a TTL (time to life) for connections:
216+
The driver supports setting a TTL (time to live) for connections:
211217

212218
```java
213219
ArangoDB arango = new ArangoDB.Builder()
214220
.connectionTtl(5 * 60 * 1000) // ms
215221
.build();
216222
```
217223

218-
In this example all connections will be closed/reopened after 5 minutes.
224+
In this example, inactive connections are closed after 5 minutes.
219225

220-
If not set or set to `null` (default), no automatic connection closure will be performed.
226+
The default TTL for HTTP connections is 30 seconds, while it is `null` for VST connections.
227+
228+
If set to `null`, no automatic connection closure is performed.
221229

222230
## VST Keep-Alive
223231

224232
The driver supports setting keep-alive interval (in seconds)
225233
for VST connections (but VST is not supported from ArangoDB v3.12.0 onward).
226-
If set, every VST connection will perform a no-op request
234+
If set, every VST connection performs a no-op request
227235
at the specified intervals, to avoid to be closed due to inactivity by the
228236
server (or by the external environment, e.g. firewall, intermediate routers,
229237
operating system, ... ).

0 commit comments

Comments
 (0)