Skip to content

Commit ffa43a8

Browse files
authored
Feature/v6 (#25)
* test password * updated arangodb-java-driver to v6.1.0 * CustomSerdeTest * aligned ArangoCollectionTest to sync version * ttl indices * db.getEngine * createCollectionWithMinReplicationFactor test * createWithReplicationAndMinReplicationFactor test * ArangoSearchTest tests * analyzers * stream transactions * getResponsibleShard * changelog upd * mvn deps versions update * tests bugfix * tests bugfix
1 parent 39781d1 commit ffa43a8

21 files changed

+2442
-1222
lines changed

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+
### Fixed
10+
11+
- custom serde not always used
12+
13+
### Added
14+
15+
- split `GraphDocumentReadOptions` from `DocumentReadOptions` (breaking change)
16+
- added `ArangoCollection#getResponsibleShard(Object)`
17+
- added support for Analyzers
18+
- added support for Stream Transactions
19+
- added support for named indices
20+
- added support for TTL indices
21+
- added minReplicationAttribute for collections and graphs
22+
923
## [5.1.0] - 2019-28-08
1024

1125
### Fixed

pom.xml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.arangodb</groupId>
66
<artifactId>arangodb-java-driver-async</artifactId>
7-
<version>5.1.0</version>
7+
<version>6.0.0-SNAPSHOT</version>
88
<inceptionYear>2016</inceptionYear>
99
<packaging>jar</packaging>
1010

@@ -22,11 +22,14 @@
2222

2323
<properties>
2424
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25-
<logback-classic.version>1.1.3</logback-classic.version>
25+
<logback-classic.version>1.2.3</logback-classic.version>
2626
<hamcrest-all.version>1.3</hamcrest-all.version>
2727
<junit.version>4.12</junit.version>
28-
<arangodb-java-driver.version>5.0.7</arangodb-java-driver.version>
28+
<arangodb-java-driver.version>6.1.0</arangodb-java-driver.version>
2929
<arangodb.velocypack.module.jdk8.version>1.1.0</arangodb.velocypack.module.jdk8.version>
30+
31+
<!-- javadoc-->
32+
<javadoc.opts/>
3033
</properties>
3134

3235
<developers>
@@ -76,7 +79,7 @@
7679
<plugin>
7780
<groupId>org.sonatype.plugins</groupId>
7881
<artifactId>nexus-staging-maven-plugin</artifactId>
79-
<version>1.6.5</version>
82+
<version>1.6.8</version>
8083
<extensions>true</extensions>
8184
<configuration>
8285
<serverId>ossrh</serverId>
@@ -85,56 +88,27 @@
8588
<autoReleaseAfterClose>false</autoReleaseAfterClose>
8689
</configuration>
8790
</plugin>
88-
89-
<plugin>
90-
<groupId>org.apache.maven.plugins</groupId>
91-
<artifactId>maven-assembly-plugin</artifactId>
92-
<version>2.4.1</version>
93-
<executions>
94-
<execution>
95-
<id>assembly</id>
96-
<phase>package</phase>
97-
<goals>
98-
<goal>single</goal>
99-
</goals>
100-
</execution>
101-
</executions>
102-
<configuration>
103-
<finalName>
104-
${project.artifactId}-${project.version}-standalone
105-
</finalName>
106-
<attach>false</attach>
107-
<appendAssemblyId>false</appendAssemblyId>
108-
<descriptorRefs>
109-
<descriptorRef>jar-with-dependencies</descriptorRef>
110-
</descriptorRefs>
111-
</configuration>
112-
</plugin>
113-
11491
<plugin>
11592
<groupId>org.apache.maven.plugins</groupId>
11693
<artifactId>maven-compiler-plugin</artifactId>
117-
<version>3.2</version>
94+
<version>3.8.1</version>
11895
<configuration>
11996
<source>1.8</source>
12097
<target>1.8</target>
121-
<compilerArgument></compilerArgument>
12298
</configuration>
12399
</plugin>
124-
125100
<plugin>
126101
<groupId>org.apache.maven.plugins</groupId>
127102
<artifactId>maven-resources-plugin</artifactId>
128-
<version>2.7</version>
103+
<version>3.1.0</version>
129104
<configuration>
130105
<encoding>UTF-8</encoding>
131106
</configuration>
132107
</plugin>
133-
134108
<plugin>
135109
<groupId>org.apache.maven.plugins</groupId>
136110
<artifactId>maven-source-plugin</artifactId>
137-
<version>2.4</version>
111+
<version>3.1.0</version>
138112
<executions>
139113
<execution>
140114
<goals>
@@ -147,15 +121,15 @@
147121
<plugin>
148122
<groupId>org.apache.maven.plugins</groupId>
149123
<artifactId>maven-javadoc-plugin</artifactId>
150-
<version>2.9.1</version>
124+
<version>3.1.1</version>
151125
<executions>
152126
<execution>
153127
<id>attach-javadocs</id>
154128
<goals>
155129
<goal>jar</goal>
156130
</goals>
157131
<configuration>
158-
<additionalparam>${javadoc.opts}</additionalparam>
132+
<additionalOptions>${javadoc.opts}</additionalOptions>
159133
<excludePackageNames>com.arangodb.internal</excludePackageNames>
160134
</configuration>
161135
</execution>
@@ -164,7 +138,7 @@
164138

165139
<plugin>
166140
<artifactId>maven-surefire-plugin</artifactId>
167-
<version>2.19.1</version>
141+
<version>2.22.2</version>
168142
<configuration>
169143
<includes>
170144
<include>**/*Test.java</include>
@@ -185,7 +159,7 @@
185159
<plugin>
186160
<groupId>org.apache.maven.plugins</groupId>
187161
<artifactId>maven-gpg-plugin</artifactId>
188-
<version>1.5</version>
162+
<version>1.6</version>
189163
<executions>
190164
<execution>
191165
<id>sign-artifacts</id>
@@ -225,6 +199,12 @@
225199
<artifactId>hamcrest-all</artifactId>
226200
<scope>test</scope>
227201
</dependency>
202+
<dependency>
203+
<groupId>com.arangodb</groupId>
204+
<artifactId>jackson-dataformat-velocypack</artifactId>
205+
<version>0.1.4</version>
206+
<scope>test</scope>
207+
</dependency>
228208
</dependencies>
229209

230210
<dependencyManagement>

src/main/java/com/arangodb/ArangoCollectionAsync.java

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,8 @@
2323
import java.util.Collection;
2424
import java.util.concurrent.CompletableFuture;
2525

26-
import com.arangodb.entity.CollectionEntity;
27-
import com.arangodb.entity.CollectionPropertiesEntity;
28-
import com.arangodb.entity.CollectionRevisionEntity;
29-
import com.arangodb.entity.DocumentCreateEntity;
30-
import com.arangodb.entity.DocumentDeleteEntity;
31-
import com.arangodb.entity.DocumentImportEntity;
32-
import com.arangodb.entity.DocumentUpdateEntity;
33-
import com.arangodb.entity.IndexEntity;
34-
import com.arangodb.entity.MultiDocumentEntity;
35-
import com.arangodb.entity.Permissions;
36-
import com.arangodb.model.CollectionCreateOptions;
37-
import com.arangodb.model.CollectionPropertiesOptions;
38-
import com.arangodb.model.DocumentCreateOptions;
39-
import com.arangodb.model.DocumentDeleteOptions;
40-
import com.arangodb.model.DocumentExistsOptions;
41-
import com.arangodb.model.DocumentImportOptions;
42-
import com.arangodb.model.DocumentReadOptions;
43-
import com.arangodb.model.DocumentReplaceOptions;
44-
import com.arangodb.model.DocumentUpdateOptions;
45-
import com.arangodb.model.FulltextIndexOptions;
46-
import com.arangodb.model.GeoIndexOptions;
47-
import com.arangodb.model.HashIndexOptions;
48-
import com.arangodb.model.PersistentIndexOptions;
49-
import com.arangodb.model.SkiplistIndexOptions;
26+
import com.arangodb.entity.*;
27+
import com.arangodb.model.*;
5028

5129
/**
5230
* Interface for operations on ArangoDB collection level.
@@ -535,6 +513,17 @@ CompletableFuture<IndexEntity> ensureFulltextIndex(
535513
final Iterable<String> fields,
536514
final FulltextIndexOptions options);
537515

516+
/**
517+
* Creates a ttl index for the collection, if it does not already exist.
518+
*
519+
* @param fields A list of attribute paths
520+
* @param options Additional options, can be null
521+
* @return information about the index
522+
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-ttl.html">API
523+
* Documentation</a>
524+
*/
525+
CompletableFuture<IndexEntity> ensureTtlIndex(Iterable<String> fields, TtlIndexOptions options);
526+
538527
/**
539528
* Returns all indexes of the collection
540529
*
@@ -554,23 +543,42 @@ CompletableFuture<IndexEntity> ensureFulltextIndex(
554543

555544
/**
556545
* Removes all documents from the collection, but leaves the indexes intact
557-
*
546+
*
558547
* @see <a href="https://docs.arangodb.com/current/HTTP/Collection/Creating.html#truncate-collection">API
559548
* Documentation</a>
560549
* @return information about the collection
561550
*/
562551
CompletableFuture<CollectionEntity> truncate();
563552

553+
/**
554+
* Removes all documents from the collection, but leaves the indexes intact
555+
*
556+
* @see <a href="https://docs.arangodb.com/current/HTTP/Collection/Creating.html#truncate-collection">API
557+
* Documentation</a>
558+
* @return information about the collection
559+
*/
560+
CompletableFuture<CollectionEntity> truncate(CollectionTruncateOptions options);
561+
564562
/**
565563
* Counts the documents in a collection
566-
*
564+
*
567565
* @see <a href=
568566
* "https://docs.arangodb.com/current/HTTP/Collection/Getting.html#return-number-of-documents-in-a-collection">API
569567
* Documentation</a>
570568
* @return information about the collection, including the number of documents
571569
*/
572570
CompletableFuture<CollectionPropertiesEntity> count();
573571

572+
/**
573+
* Counts the documents in a collection
574+
*
575+
* @see <a href=
576+
* "https://docs.arangodb.com/current/HTTP/Collection/Getting.html#return-number-of-documents-in-a-collection">API
577+
* Documentation</a>
578+
* @return information about the collection, including the number of documents
579+
*/
580+
CompletableFuture<CollectionPropertiesEntity> count(CollectionCountOptions options);
581+
574582
/**
575583
* Creates the collection
576584
*
@@ -676,6 +684,19 @@ CompletableFuture<IndexEntity> ensureFulltextIndex(
676684
*/
677685
CompletableFuture<CollectionEntity> rename(final String newName);
678686

687+
/**
688+
* Returns the responsible shard for the document.
689+
* Please note that this API is only meaningful and available on a cluster coordinator.
690+
*
691+
* @param value A projection of the document containing at least the shard key (_key or a custom attribute) for
692+
* which the responsible shard should be determined
693+
* @return information about the responsible shard
694+
* @see <a href="https://docs.arangodb.com/current/HTTP/collection-getting.html#return-responsible-shard-for-a-document">
695+
* API Documentation</a>
696+
* @since ArangoDB 3.5.0
697+
*/
698+
CompletableFuture<ShardEntity> getResponsibleShard(final Object value);
699+
679700
/**
680701
* Retrieve the collections revision
681702
*

0 commit comments

Comments
 (0)