From 4419d1f3d52702eedd09dfae80785a094ec27bc6 Mon Sep 17 00:00:00 2001 From: Michele Rastelli Date: Tue, 18 Jan 2022 10:44:34 +0100 Subject: [PATCH 1/2] deprecated hash and skiplist indexes --- .../java/com/arangodb/ArangoCollection.java | 30 +++++++++++-------- .../arangodb/async/ArangoCollectionAsync.java | 6 ++++ .../internal/ArangoCollectionAsyncImpl.java | 2 ++ .../internal/ArangoCollectionImpl.java | 2 ++ .../internal/InternalArangoCollection.java | 2 ++ .../com/arangodb/model/HashIndexOptions.java | 2 ++ .../com/arangodb/model/OptionsBuilder.java | 10 +++++++ .../arangodb/model/SkiplistIndexOptions.java | 2 ++ 8 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/arangodb/ArangoCollection.java b/src/main/java/com/arangodb/ArangoCollection.java index 298182b85..2a322f3db 100644 --- a/src/main/java/com/arangodb/ArangoCollection.java +++ b/src/main/java/com/arangodb/ArangoCollection.java @@ -79,7 +79,7 @@ public interface ArangoCollection extends ArangoSerializationAccessor { /** * Creates new documents from the given documents, unless there is already a document with the _key given. If no * _key is given, a new unique _key is generated automatically. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -94,7 +94,7 @@ public interface ArangoCollection extends ArangoSerializationAccessor { /** * Creates new documents from the given documents, unless there is already a document with the _key given. If no * _key is given, a new unique _key is generated automatically. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -110,7 +110,7 @@ MultiDocumentEntity> insertDocuments( /** * Bulk imports the given values into the collection. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -122,7 +122,7 @@ MultiDocumentEntity> insertDocuments( /** * Bulk imports the given values into the collection. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -135,7 +135,7 @@ MultiDocumentEntity> insertDocuments( /** * Bulk imports the given values into the collection. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -147,7 +147,7 @@ MultiDocumentEntity> insertDocuments( /** * Bulk imports the given values into the collection. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -236,7 +236,7 @@ DocumentUpdateEntity replaceDocument(String key, T value, DocumentReplace /** * Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are * specified by the _key attributes in the documents in values. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -251,7 +251,7 @@ DocumentUpdateEntity replaceDocument(String key, T value, DocumentReplace /** * Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are * specified by the _key attributes in the documents in values. - * + *

* Limitations: * - the fields having {@code null} value are always removed during serialization * @@ -300,10 +300,10 @@ DocumentUpdateEntity updateDocument(String key, T value, DocumentUpdateOp * to patch (the patch document). All attributes from the patch document will be added to the existing document if * they do not yet exist, and overwritten in the existing document if they do exist there. * - * @param key The key of the document - * @param value A representation of a single document (POJO, VPackSlice or String for JSON) - * @param options Additional options, can be null - * @param returnType Type of the returned newDocument and/or oldDocument + * @param key The key of the document + * @param value A representation of a single document (POJO, VPackSlice or String for JSON) + * @param options Additional options, can be null + * @param returnType Type of the returned newDocument and/or oldDocument * @return information about the document * @throws ArangoDBException * @see API @@ -465,7 +465,10 @@ MultiDocumentEntity> deleteDocuments( * @return information about the index * @throws ArangoDBException * @see API Documentation + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A hash index is now an + * alias for a persistent index. */ + @Deprecated IndexEntity ensureHashIndex(Iterable fields, HashIndexOptions options) throws ArangoDBException; /** @@ -477,7 +480,10 @@ MultiDocumentEntity> deleteDocuments( * @throws ArangoDBException * @see API * Documentation + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A skiplist index is now + * an alias for a persistent index. */ + @Deprecated IndexEntity ensureSkiplistIndex(Iterable fields, SkiplistIndexOptions options) throws ArangoDBException; /** diff --git a/src/main/java/com/arangodb/async/ArangoCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java index e0d81b44c..e82998cda 100644 --- a/src/main/java/com/arangodb/async/ArangoCollectionAsync.java +++ b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java @@ -433,7 +433,10 @@ CompletableFuture>> deleteDocume * @param options Additional options, can be null * @return information about the index * @see API Documentation + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A hash index is now an + * alias for a persistent index. */ + @Deprecated CompletableFuture ensureHashIndex(final Iterable fields, final HashIndexOptions options); /** @@ -444,7 +447,10 @@ CompletableFuture>> deleteDocume * @return information about the index * @see API * Documentation + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A skiplist index is now + * an alias for a persistent index. */ + @Deprecated CompletableFuture ensureSkiplistIndex( final Iterable fields, final SkiplistIndexOptions options); diff --git a/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java b/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java index 62bbc2dca..036f16da2 100644 --- a/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java +++ b/src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java @@ -264,6 +264,7 @@ public CompletableFuture deleteIndex(final String id) { } @Override + @Deprecated public CompletableFuture ensureHashIndex( final Iterable fields, final HashIndexOptions options) { @@ -271,6 +272,7 @@ public CompletableFuture ensureHashIndex( } @Override + @Deprecated public CompletableFuture ensureSkiplistIndex( final Iterable fields, final SkiplistIndexOptions options) { diff --git a/src/main/java/com/arangodb/internal/ArangoCollectionImpl.java b/src/main/java/com/arangodb/internal/ArangoCollectionImpl.java index 1822a1dfe..ef362803b 100644 --- a/src/main/java/com/arangodb/internal/ArangoCollectionImpl.java +++ b/src/main/java/com/arangodb/internal/ArangoCollectionImpl.java @@ -259,12 +259,14 @@ public String deleteIndex(final String id) throws ArangoDBException { return executor.execute(deleteIndexRequest(id), deleteIndexResponseDeserializer()); } + @Deprecated @Override public IndexEntity ensureHashIndex(final Iterable fields, final HashIndexOptions options) throws ArangoDBException { return executor.execute(createHashIndexRequest(fields, options), IndexEntity.class); } + @Deprecated @Override public IndexEntity ensureSkiplistIndex(final Iterable fields, final SkiplistIndexOptions options) throws ArangoDBException { diff --git a/src/main/java/com/arangodb/internal/InternalArangoCollection.java b/src/main/java/com/arangodb/internal/InternalArangoCollection.java index ae590fe12..6bb1db75e 100644 --- a/src/main/java/com/arangodb/internal/InternalArangoCollection.java +++ b/src/main/java/com/arangodb/internal/InternalArangoCollection.java @@ -547,6 +547,7 @@ private String createIndexId(final String id) { return index; } + @Deprecated protected Request createHashIndexRequest(final Iterable fields, final HashIndexOptions options) { final Request request = request(db.dbName(), RequestType.POST, PATH_API_INDEX); request.putQueryParam(COLLECTION, name); @@ -555,6 +556,7 @@ protected Request createHashIndexRequest(final Iterable fields, final Ha return request; } + @Deprecated protected Request createSkiplistIndexRequest(final Iterable fields, final SkiplistIndexOptions options) { final Request request = request(db.dbName(), RequestType.POST, PATH_API_INDEX); request.putQueryParam(COLLECTION, name); diff --git a/src/main/java/com/arangodb/model/HashIndexOptions.java b/src/main/java/com/arangodb/model/HashIndexOptions.java index 20eff1d44..88a591be3 100644 --- a/src/main/java/com/arangodb/model/HashIndexOptions.java +++ b/src/main/java/com/arangodb/model/HashIndexOptions.java @@ -25,7 +25,9 @@ /** * @author Mark Vollmary * @see API Documentation + * @deprecated use {@link PersistentIndexOptions} instead. A hash index is now an alias for a persistent index. */ +@Deprecated public class HashIndexOptions extends IndexOptions { private Iterable fields; diff --git a/src/main/java/com/arangodb/model/OptionsBuilder.java b/src/main/java/com/arangodb/model/OptionsBuilder.java index c9da750cf..6cdee0d1f 100644 --- a/src/main/java/com/arangodb/model/OptionsBuilder.java +++ b/src/main/java/com/arangodb/model/OptionsBuilder.java @@ -41,10 +41,20 @@ public static UserCreateOptions build(final UserCreateOptions options, final Str return options.user(user).passwd(passwd); } + /** + * @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. A hash index is now an alias for a + * persistent index. + */ + @Deprecated public static HashIndexOptions build(final HashIndexOptions options, final Iterable fields) { return options.fields(fields); } + /** + * @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. A skiplist index is now an alias for a + * persistent index. + */ + @Deprecated public static SkiplistIndexOptions build(final SkiplistIndexOptions options, final Iterable fields) { return options.fields(fields); } diff --git a/src/main/java/com/arangodb/model/SkiplistIndexOptions.java b/src/main/java/com/arangodb/model/SkiplistIndexOptions.java index 30d000f59..9bed2477f 100644 --- a/src/main/java/com/arangodb/model/SkiplistIndexOptions.java +++ b/src/main/java/com/arangodb/model/SkiplistIndexOptions.java @@ -25,7 +25,9 @@ /** * @author Mark Vollmary * @see API Documentation + * @deprecated use {@link PersistentIndexOptions} instead. A skiplist index is now an alias for a persistent index. */ +@Deprecated public class SkiplistIndexOptions extends IndexOptions { private Iterable fields; From 1f812250e65e5074bd9bee897775d8430630254f Mon Sep 17 00:00:00 2001 From: Michele Rastelli Date: Tue, 18 Jan 2022 10:58:34 +0100 Subject: [PATCH 2/2] deprecated hash and skiplist indexes --- src/main/java/com/arangodb/ArangoCollection.java | 8 ++++---- .../java/com/arangodb/async/ArangoCollectionAsync.java | 8 ++++---- src/main/java/com/arangodb/model/HashIndexOptions.java | 3 ++- src/main/java/com/arangodb/model/OptionsBuilder.java | 8 ++++---- .../java/com/arangodb/model/SkiplistIndexOptions.java | 3 ++- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/arangodb/ArangoCollection.java b/src/main/java/com/arangodb/ArangoCollection.java index 2a322f3db..8c0b3935c 100644 --- a/src/main/java/com/arangodb/ArangoCollection.java +++ b/src/main/java/com/arangodb/ArangoCollection.java @@ -465,8 +465,8 @@ MultiDocumentEntity> deleteDocuments( * @return information about the index * @throws ArangoDBException * @see API Documentation - * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A hash index is now an - * alias for a persistent index. + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a + * hash index is an alias for a persistent index. */ @Deprecated IndexEntity ensureHashIndex(Iterable fields, HashIndexOptions options) throws ArangoDBException; @@ -480,8 +480,8 @@ MultiDocumentEntity> deleteDocuments( * @throws ArangoDBException * @see API * Documentation - * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A skiplist index is now - * an alias for a persistent index. + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a + * skiplist index is an alias for a persistent index. */ @Deprecated IndexEntity ensureSkiplistIndex(Iterable fields, SkiplistIndexOptions options) throws ArangoDBException; diff --git a/src/main/java/com/arangodb/async/ArangoCollectionAsync.java b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java index e82998cda..1b63c1e3d 100644 --- a/src/main/java/com/arangodb/async/ArangoCollectionAsync.java +++ b/src/main/java/com/arangodb/async/ArangoCollectionAsync.java @@ -433,8 +433,8 @@ CompletableFuture>> deleteDocume * @param options Additional options, can be null * @return information about the index * @see API Documentation - * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A hash index is now an - * alias for a persistent index. + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a + * hash index is an alias for a persistent index. */ @Deprecated CompletableFuture ensureHashIndex(final Iterable fields, final HashIndexOptions options); @@ -447,8 +447,8 @@ CompletableFuture>> deleteDocume * @return information about the index * @see API * Documentation - * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. A skiplist index is now - * an alias for a persistent index. + * @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a + * skiplist index is an alias for a persistent index. */ @Deprecated CompletableFuture ensureSkiplistIndex( diff --git a/src/main/java/com/arangodb/model/HashIndexOptions.java b/src/main/java/com/arangodb/model/HashIndexOptions.java index 88a591be3..3af784ebb 100644 --- a/src/main/java/com/arangodb/model/HashIndexOptions.java +++ b/src/main/java/com/arangodb/model/HashIndexOptions.java @@ -25,7 +25,8 @@ /** * @author Mark Vollmary * @see API Documentation - * @deprecated use {@link PersistentIndexOptions} instead. A hash index is now an alias for a persistent index. + * @deprecated use {@link PersistentIndexOptions} instead. Since ArangoDB 3.7 a hash index is an alias for a persistent + * index. */ @Deprecated public class HashIndexOptions extends IndexOptions { diff --git a/src/main/java/com/arangodb/model/OptionsBuilder.java b/src/main/java/com/arangodb/model/OptionsBuilder.java index 6cdee0d1f..ab99ad37f 100644 --- a/src/main/java/com/arangodb/model/OptionsBuilder.java +++ b/src/main/java/com/arangodb/model/OptionsBuilder.java @@ -42,8 +42,8 @@ public static UserCreateOptions build(final UserCreateOptions options, final Str } /** - * @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. A hash index is now an alias for a - * persistent index. + * @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. Since ArangoDB 3.7 a hash index is an + * alias for a persistent index. */ @Deprecated public static HashIndexOptions build(final HashIndexOptions options, final Iterable fields) { @@ -51,8 +51,8 @@ public static HashIndexOptions build(final HashIndexOptions options, final Itera } /** - * @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. A skiplist index is now an alias for a - * persistent index. + * @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. Since ArangoDB 3.7 a skiplist index is + * an alias for a persistent index. */ @Deprecated public static SkiplistIndexOptions build(final SkiplistIndexOptions options, final Iterable fields) { diff --git a/src/main/java/com/arangodb/model/SkiplistIndexOptions.java b/src/main/java/com/arangodb/model/SkiplistIndexOptions.java index 9bed2477f..15f3dcdfe 100644 --- a/src/main/java/com/arangodb/model/SkiplistIndexOptions.java +++ b/src/main/java/com/arangodb/model/SkiplistIndexOptions.java @@ -25,7 +25,8 @@ /** * @author Mark Vollmary * @see API Documentation - * @deprecated use {@link PersistentIndexOptions} instead. A skiplist index is now an alias for a persistent index. + * @deprecated use {@link PersistentIndexOptions} instead. Since ArangoDB 3.7 a skiplist index is an alias for a + * persistent index. */ @Deprecated public class SkiplistIndexOptions extends IndexOptions {