Skip to content

Commit 934640d

Browse files
committed
Merge branch 'master' into api-test
# Conflicts: # .github/workflows/maven.yml
2 parents 18ce8bd + b361c03 commit 934640d

File tree

13 files changed

+161
-70
lines changed

13 files changed

+161
-70
lines changed

.github/workflows/maven.yml

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
docker-img:
18-
- docker.io/arangodb/arangodb:3.6.15
19-
- docker.io/arangodb/arangodb:3.7.13
20-
- docker.io/arangodb/arangodb:3.8.0
18+
- docker.io/arangodb/arangodb:3.7.15
19+
- docker.io/arangodb/arangodb:3.8.1
2120
topology:
2221
- single
2322
- cluster
@@ -38,3 +37,37 @@ jobs:
3837
- name: Debug containers
3938
if: ${{ cancelled() || failure() }}
4039
run: ./docker/debug_containers_${{ matrix.topology }}.sh
40+
41+
test-locale:
42+
timeout-minutes: 20
43+
runs-on: ubuntu-latest
44+
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
docker-img:
49+
# - docker.io/arangodb/arangodb:3.7.15
50+
- docker.io/arangodb/arangodb:3.8.1
51+
# - docker.io/arangodb/enterprise:3.7.15
52+
# - docker.io/arangodb/enterprise:3.8.1
53+
54+
topology:
55+
- single
56+
# - cluster
57+
# - active-failover
58+
59+
steps:
60+
- uses: actions/checkout@v1
61+
- name: Set up JDK 1.8
62+
uses: actions/setup-java@v1
63+
with:
64+
java-version: 1.8
65+
- name: Start Database
66+
run: ./docker/start_db_${{ matrix.topology }}_retry_fail.sh ${{ matrix.docker-img }}
67+
env:
68+
ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }}
69+
- name: Test
70+
run: mvn --no-transfer-progress test -DargLine="-Duser.language=tr"
71+
- name: Debug containers
72+
if: ${{ cancelled() || failure() }}
73+
run: ./docker/debug_containers_${{ matrix.topology }}.sh

ChangeLog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
## [6.14.0] - 2021-10-01
10+
11+
- fixed issues with non-English locales (#407)
12+
- implemented support for `GET /_admin/server/id`
13+
- fixed `acquireHostListInterval` javadoc, interval in milliseconds
14+
- fixed NPE in `CursorEntity.extra` and `CursorEntity.Extras.stats`
15+
16+
## [6.13.0] - 2021-08-25
17+
18+
- added support for `fillBlockCache` in AQL query options (ArangoDB v3.8.1)
19+
- fixed exceptions handling during shutdown (#400)
20+
- added native image configuration for HTTP communication
21+
- updated native image reflection configuration
22+
923
## [6.12.3] - 2021-06-24
1024

1125
- fixed host handler failures count (#DEVSUP-805, #398)

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.arangodb</groupId>
77
<artifactId>arangodb-java-driver</artifactId>
8-
<version>6.12.4-SNAPSHOT</version>
8+
<version>6.14.0</version>
99
<inceptionYear>2016</inceptionYear>
1010
<packaging>jar</packaging>
1111

@@ -241,7 +241,7 @@
241241
<dependency>
242242
<groupId>commons-codec</groupId>
243243
<artifactId>commons-codec</artifactId>
244-
<version>1.14</version>
244+
<version>1.15</version>
245245
</dependency>
246246
<dependency>
247247
<groupId>commons-logging</groupId>
@@ -251,22 +251,22 @@
251251
<dependency>
252252
<groupId>com.arangodb</groupId>
253253
<artifactId>velocypack</artifactId>
254-
<version>2.5.3</version>
254+
<version>2.5.4</version>
255255
</dependency>
256256
<dependency>
257257
<groupId>org.slf4j</groupId>
258258
<artifactId>slf4j-api</artifactId>
259-
<version>1.7.30</version>
259+
<version>1.7.32</version>
260260
</dependency>
261261
<dependency>
262262
<groupId>ch.qos.logback</groupId>
263263
<artifactId>logback-classic</artifactId>
264-
<version>1.2.3</version>
264+
<version>1.2.5</version>
265265
</dependency>
266266
<dependency>
267267
<groupId>junit</groupId>
268268
<artifactId>junit</artifactId>
269-
<version>4.13.1</version>
269+
<version>4.13.2</version>
270270
</dependency>
271271
<dependency>
272272
<groupId>org.hamcrest</groupId>

src/main/java/com/arangodb/ArangoDB.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
import java.io.InputStream;
7676
import java.lang.annotation.Annotation;
7777
import java.util.Collection;
78+
import java.util.Locale;
7879
import java.util.Properties;
7980

8081
/**
@@ -119,7 +120,7 @@ protected void loadProperties(final Properties properties) {
119120
private static Protocol loadProtocol(final Properties properties, final Protocol currentValue) {
120121
return Protocol.valueOf(
121122
getProperty(properties, PROPERTY_KEY_PROTOCOL, currentValue, ArangoDefaults.DEFAULT_NETWORK_PROTOCOL)
122-
.toUpperCase());
123+
.toUpperCase(Locale.ENGLISH));
123124
}
124125

125126
public Builder useProtocol(final Protocol protocol) {
@@ -304,7 +305,7 @@ public Builder acquireHostList(final Boolean acquireHostList) {
304305
/**
305306
* Setting the Interval for acquireHostList
306307
*
307-
* @param acquireHostListInterval Interval in Seconds
308+
* @param acquireHostListInterval Interval in milliseconds
308309
* @return {@link ArangoDB.Builder}
309310
*/
310311
public Builder acquireHostListInterval(final Integer acquireHostListInterval) {
@@ -762,6 +763,16 @@ public synchronized ArangoDB build() {
762763
*/
763764
ServerRole getRole() throws ArangoDBException;
764765

766+
/**
767+
* Returns the id of a server in a cluster.
768+
*
769+
* @return the server id
770+
* @throws ArangoDBException
771+
* @see <a href="https://www.arangodb.com/docs/stable/http/administration-and-monitoring.html#return-id-of-a-server-in-a-cluster">API
772+
* Documentation</a>
773+
*/
774+
String getServerId() throws ArangoDBException;
775+
765776
/**
766777
* Create a new user. This user will not have access to any database. You need permission to the _system database in
767778
* order to execute this call.

src/main/java/com/arangodb/entity/CursorEntity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.arangodb.velocypack.VPackSlice;
2424

2525
import java.util.Collection;
26+
import java.util.Collections;
2627
import java.util.Map;
2728

2829
/**
@@ -34,7 +35,7 @@ public class CursorEntity implements Entity, MetaAware {
3435

3536
private String id;
3637
private Integer count;
37-
private Extras extra;
38+
private Extras extra = new Extras();
3839
private Boolean cached;
3940
private Boolean hasMore;
4041
private VPackSlice result;
@@ -120,7 +121,7 @@ public String getMessage() {
120121

121122
public static class Extras {
122123
private Stats stats;
123-
private Collection<Warning> warnings;
124+
private Collection<Warning> warnings = Collections.emptyList();
124125

125126
public Stats getStats() {
126127
return stats;

src/main/java/com/arangodb/internal/ArangoDBImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ public ServerRole getRole() throws ArangoDBException {
174174
return executor.execute(getRoleRequest(), getRoleResponseDeserializer());
175175
}
176176

177+
@Override
178+
public String getServerId() throws ArangoDBException {
179+
return executor.execute(getServerIdRequest(), getServerIdResponseDeserializer());
180+
}
181+
177182
@Override
178183
public UserEntity createUser(final String user, final String passwd) throws ArangoDBException {
179184
return executor.execute(createUserRequest(db().name(), user, passwd, new UserCreateOptions()),

src/main/java/com/arangodb/internal/InternalArangoDB.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public abstract class InternalArangoDB<E extends ArangoExecutor> extends ArangoE
4747
private static final String PATH_API_ADMIN_LOG_ENTRIES = "/_admin/log/entries";
4848
private static final String PATH_API_ADMIN_LOG_LEVEL = "/_admin/log/level";
4949
private static final String PATH_API_ROLE = "/_admin/server/role";
50+
private static final String PATH_API_SERVER_ID = "/_admin/server/id";
5051
private static final String PATH_ENDPOINTS = "/_api/cluster/endpoints";
5152
private static final String PATH_API_USER = "/_api/user";
5253

@@ -58,10 +59,18 @@ protected Request getRoleRequest() {
5859
return request(ArangoRequestParam.SYSTEM, RequestType.GET, PATH_API_ROLE);
5960
}
6061

62+
protected Request getServerIdRequest() {
63+
return request(ArangoRequestParam.SYSTEM, RequestType.GET, PATH_API_SERVER_ID);
64+
}
65+
6166
protected ResponseDeserializer<ServerRole> getRoleResponseDeserializer() {
6267
return response -> util().deserialize(response.getBody().get("role"), ServerRole.class);
6368
}
6469

70+
protected ResponseDeserializer<String> getServerIdResponseDeserializer() {
71+
return response -> util().deserialize(response.getBody().get("id"), String.class);
72+
}
73+
6574
protected Request createDatabaseRequest(final DBCreateOptions options) {
6675
final Request request = request(ArangoRequestParam.SYSTEM, RequestType.POST,
6776
InternalArangoDatabase.PATH_API_DATABASE);

src/main/java/com/arangodb/internal/InternalArangoDBBuilder.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@
5050
import javax.net.ssl.SSLContext;
5151
import java.io.IOException;
5252
import java.io.InputStream;
53-
import java.util.ArrayList;
54-
import java.util.Collection;
55-
import java.util.List;
56-
import java.util.Properties;
53+
import java.util.*;
5754

5855

5956
/**
@@ -353,7 +350,7 @@ private static LoadBalancingStrategy loadLoadBalancingStrategy(
353350
final Properties properties,
354351
final LoadBalancingStrategy currentValue) {
355352
return LoadBalancingStrategy.valueOf(getProperty(properties, PROPERTY_KEY_LOAD_BALANCING_STRATEGY, currentValue,
356-
ArangoDefaults.DEFAULT_LOAD_BALANCING_STRATEGY).toUpperCase());
353+
ArangoDefaults.DEFAULT_LOAD_BALANCING_STRATEGY).toUpperCase(Locale.ENGLISH));
357354
}
358355

359356
protected static <T> String getProperty(

src/main/java/com/arangodb/internal/velocypack/VPackDeserializers.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@
6565

6666
import java.text.ParseException;
6767
import java.text.SimpleDateFormat;
68-
import java.util.ArrayList;
69-
import java.util.Date;
70-
import java.util.Iterator;
71-
import java.util.List;
72-
import java.util.Map;
68+
import java.util.*;
7369
import java.util.Map.Entry;
7470

7571
/**
@@ -144,11 +140,11 @@ public class VPackDeserializers {
144140

145141
public static final VPackDeserializer<LogLevel> LOG_LEVEL = (parent, vpack, context) -> LogLevel.fromLevel(vpack.getAsInt());
146142

147-
public static final VPackDeserializer<License> LICENSE = (parent, vpack, context) -> License.valueOf(vpack.getAsString().toUpperCase());
143+
public static final VPackDeserializer<License> LICENSE = (parent, vpack, context) -> License.valueOf(vpack.getAsString().toUpperCase(Locale.ENGLISH));
148144

149-
public static final VPackDeserializer<Permissions> PERMISSIONS = (parent, vpack, context) -> Permissions.valueOf(vpack.getAsString().toUpperCase());
145+
public static final VPackDeserializer<Permissions> PERMISSIONS = (parent, vpack, context) -> Permissions.valueOf(vpack.getAsString().toUpperCase(Locale.ENGLISH));
150146

151-
public static final VPackDeserializer<QueryExecutionState> QUERY_EXECUTION_STATE = (parent, vpack, context) -> QueryExecutionState.valueOf(vpack.getAsString().toUpperCase().replaceAll(" ", "_"));
147+
public static final VPackDeserializer<QueryExecutionState> QUERY_EXECUTION_STATE = (parent, vpack, context) -> QueryExecutionState.valueOf(vpack.getAsString().toUpperCase(Locale.ENGLISH).replaceAll(" ", "_"));
152148

153149
public static final VPackDeserializer<ReplicationFactor> REPLICATION_FACTOR = (parent, vpack, context) -> {
154150
final ReplicationFactor replicationFactor = new ReplicationFactor();
@@ -167,7 +163,7 @@ public class VPackDeserializers {
167163
};
168164

169165
public static final VPackDeserializer<ViewType> VIEW_TYPE = (parent, vpack, context) -> "arangosearch".equals(vpack.getAsString()) ? ViewType.ARANGO_SEARCH
170-
: ViewType.valueOf(vpack.getAsString().toUpperCase());
166+
: ViewType.valueOf(vpack.getAsString().toUpperCase(Locale.ENGLISH));
171167

172168
public static final VPackDeserializer<ArangoSearchProperties> ARANGO_SEARCH_PROPERTIES = (parent, vpack, context) -> {
173169
final ArangoSearchProperties properties = new ArangoSearchProperties();
@@ -216,7 +212,7 @@ public class VPackDeserializers {
216212
}
217213
final VPackSlice storeValues = value.get("storeValues");
218214
if (storeValues.isString()) {
219-
link.storeValues(StoreValuesType.valueOf(storeValues.getAsString().toUpperCase()));
215+
link.storeValues(StoreValuesType.valueOf(storeValues.getAsString().toUpperCase(Locale.ENGLISH)));
220216
}
221217
final VPackSlice fields = value.get("fields");
222218
if (fields.isObject()) {
@@ -290,7 +286,7 @@ protected static FieldLink deserializeField(final Entry<String, VPackSlice> fiel
290286
}
291287
final VPackSlice storeValues = value.get("storeValues");
292288
if (storeValues.isString()) {
293-
link.storeValues(StoreValuesType.valueOf(storeValues.getAsString().toUpperCase()));
289+
link.storeValues(StoreValuesType.valueOf(storeValues.getAsString().toUpperCase(Locale.ENGLISH)));
294290
}
295291
final VPackSlice fields = value.get("fields");
296292
if (fields.isObject()) {
@@ -313,7 +309,7 @@ protected static FieldLink deserializeField(final Entry<String, VPackSlice> fiel
313309
final VPackSlice type = vpack.get("type");
314310
if (type.isString()) {
315311
final ConsolidationPolicy consolidate = ConsolidationPolicy
316-
.of(ConsolidationType.valueOf(type.getAsString().toUpperCase()));
312+
.of(ConsolidationType.valueOf(type.getAsString().toUpperCase(Locale.ENGLISH)));
317313
final VPackSlice threshold = vpack.get("threshold");
318314
if (threshold.isNumber()) {
319315
consolidate.threshold(threshold.getAsDouble());

src/main/java/com/arangodb/internal/velocypack/VPackSerializers.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151

5252
import java.util.Collection;
5353
import java.util.HashMap;
54+
import java.util.Locale;
5455
import java.util.Map;
5556
import java.util.Map.Entry;
5657

@@ -119,7 +120,7 @@ public class VPackSerializers {
119120

120121
public static final VPackSerializer<LogLevel> LOG_LEVEL = (builder, attribute, value, context) -> builder.add(attribute, value.getLevel());
121122

122-
public static final VPackSerializer<Permissions> PERMISSIONS = (builder, attribute, value, context) -> builder.add(attribute, value.toString().toLowerCase());
123+
public static final VPackSerializer<Permissions> PERMISSIONS = (builder, attribute, value, context) -> builder.add(attribute, value.toString().toLowerCase(Locale.ENGLISH));
123124

124125
public static final VPackSerializer<ReplicationFactor> REPLICATION_FACTOR = (builder, attribute, value, context) -> {
125126
final Boolean satellite = value.getSatellite();
@@ -137,7 +138,7 @@ public class VPackSerializers {
137138
};
138139

139140
public static final VPackSerializer<ViewType> VIEW_TYPE = (builder, attribute, value, context) -> {
140-
final String type = value == ViewType.ARANGO_SEARCH ? "arangosearch" : value.name().toLowerCase();
141+
final String type = value == ViewType.ARANGO_SEARCH ? "arangosearch" : value.name().toLowerCase(Locale.ENGLISH);
141142
builder.add(attribute, type);
142143
};
143144

@@ -187,7 +188,7 @@ public class VPackSerializers {
187188
}
188189
final StoreValuesType storeValues = collectionLink.getStoreValues();
189190
if (storeValues != null) {
190-
builder.add("storeValues", storeValues.name().toLowerCase());
191+
builder.add("storeValues", storeValues.name().toLowerCase(Locale.ENGLISH));
191192
}
192193
serializeFieldLinks(builder, collectionLink.getFields());
193194
builder.close();
@@ -253,7 +254,7 @@ private static void serializeFieldLinks(final VPackBuilder builder, final Collec
253254
}
254255
final StoreValuesType storeValues = fieldLink.getStoreValues();
255256
if (storeValues != null) {
256-
builder.add("storeValues", storeValues.name().toLowerCase());
257+
builder.add("storeValues", storeValues.name().toLowerCase(Locale.ENGLISH));
257258
}
258259
serializeFieldLinks(builder, fieldLink.getFields());
259260
builder.close();
@@ -262,7 +263,7 @@ private static void serializeFieldLinks(final VPackBuilder builder, final Collec
262263
}
263264
}
264265

265-
public static final VPackSerializer<ConsolidationType> CONSOLIDATE_TYPE = (builder, attribute, value, context) -> builder.add(attribute, value.toString().toLowerCase());
266+
public static final VPackSerializer<ConsolidationType> CONSOLIDATE_TYPE = (builder, attribute, value, context) -> builder.add(attribute, value.toString().toLowerCase(Locale.ENGLISH));
266267

267268
public static final VPackSerializer<CollectionSchema> COLLECTION_VALIDATION = (builder, attribute, value, context) -> {
268269
VPackParser parser = new VPackParser.Builder().build();

0 commit comments

Comments
 (0)