Skip to content

Commit 4cd6d2b

Browse files
authored
[DE-101] deprecated hash and skiplist indexes (#424)
* deprecated hash and skiplist indexes * deprecated hash and skiplist indexes
1 parent ce48177 commit 4cd6d2b

8 files changed

+46
-12
lines changed

Diff for: src/main/java/com/arangodb/ArangoCollection.java

+18-12
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public interface ArangoCollection extends ArangoSerializationAccessor {
7979
/**
8080
* Creates new documents from the given documents, unless there is already a document with the _key given. If no
8181
* _key is given, a new unique _key is generated automatically.
82-
*
82+
* <p>
8383
* Limitations:
8484
* - the fields having {@code null} value are always removed during serialization
8585
*
@@ -94,7 +94,7 @@ public interface ArangoCollection extends ArangoSerializationAccessor {
9494
/**
9595
* Creates new documents from the given documents, unless there is already a document with the _key given. If no
9696
* _key is given, a new unique _key is generated automatically.
97-
*
97+
* <p>
9898
* Limitations:
9999
* - the fields having {@code null} value are always removed during serialization
100100
*
@@ -110,7 +110,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
110110

111111
/**
112112
* Bulk imports the given values into the collection.
113-
*
113+
* <p>
114114
* Limitations:
115115
* - the fields having {@code null} value are always removed during serialization
116116
*
@@ -122,7 +122,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
122122

123123
/**
124124
* Bulk imports the given values into the collection.
125-
*
125+
* <p>
126126
* Limitations:
127127
* - the fields having {@code null} value are always removed during serialization
128128
*
@@ -135,7 +135,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
135135

136136
/**
137137
* Bulk imports the given values into the collection.
138-
*
138+
* <p>
139139
* Limitations:
140140
* - the fields having {@code null} value are always removed during serialization
141141
*
@@ -147,7 +147,7 @@ <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertDocuments(
147147

148148
/**
149149
* Bulk imports the given values into the collection.
150-
*
150+
* <p>
151151
* Limitations:
152152
* - the fields having {@code null} value are always removed during serialization
153153
*
@@ -236,7 +236,7 @@ <T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplace
236236
/**
237237
* Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are
238238
* specified by the _key attributes in the documents in values.
239-
*
239+
* <p>
240240
* Limitations:
241241
* - the fields having {@code null} value are always removed during serialization
242242
*
@@ -251,7 +251,7 @@ <T> DocumentUpdateEntity<T> replaceDocument(String key, T value, DocumentReplace
251251
/**
252252
* Replaces multiple documents in the specified collection with the ones in the values, the replaced documents are
253253
* specified by the _key attributes in the documents in values.
254-
*
254+
* <p>
255255
* Limitations:
256256
* - the fields having {@code null} value are always removed during serialization
257257
*
@@ -300,10 +300,10 @@ <T> DocumentUpdateEntity<T> updateDocument(String key, T value, DocumentUpdateOp
300300
* to patch (the patch document). All attributes from the patch document will be added to the existing document if
301301
* they do not yet exist, and overwritten in the existing document if they do exist there.
302302
*
303-
* @param key The key of the document
304-
* @param value A representation of a single document (POJO, VPackSlice or String for JSON)
305-
* @param options Additional options, can be null
306-
* @param returnType Type of the returned newDocument and/or oldDocument
303+
* @param key The key of the document
304+
* @param value A representation of a single document (POJO, VPackSlice or String for JSON)
305+
* @param options Additional options, can be null
306+
* @param returnType Type of the returned newDocument and/or oldDocument
307307
* @return information about the document
308308
* @throws ArangoDBException
309309
* @see <a href="https://www.arangodb.com/docs/stable/http/document-working-with-documents.html#update-document">API
@@ -465,7 +465,10 @@ <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(
465465
* @return information about the index
466466
* @throws ArangoDBException
467467
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-hash.html#create-hash-index">API Documentation</a>
468+
* @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a
469+
* hash index is an alias for a persistent index.
468470
*/
471+
@Deprecated
469472
IndexEntity ensureHashIndex(Iterable<String> fields, HashIndexOptions options) throws ArangoDBException;
470473

471474
/**
@@ -477,7 +480,10 @@ <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteDocuments(
477480
* @throws ArangoDBException
478481
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-skiplist.html#create-skip-list">API
479482
* Documentation</a>
483+
* @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a
484+
* skiplist index is an alias for a persistent index.
480485
*/
486+
@Deprecated
481487
IndexEntity ensureSkiplistIndex(Iterable<String> fields, SkiplistIndexOptions options) throws ArangoDBException;
482488

483489
/**

Diff for: src/main/java/com/arangodb/async/ArangoCollectionAsync.java

+6
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,10 @@ <T> CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<T>>> deleteDocume
433433
* @param options Additional options, can be null
434434
* @return information about the index
435435
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-hash.html#create-hash-index">API Documentation</a>
436+
* @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a
437+
* hash index is an alias for a persistent index.
436438
*/
439+
@Deprecated
437440
CompletableFuture<IndexEntity> ensureHashIndex(final Iterable<String> fields, final HashIndexOptions options);
438441

439442
/**
@@ -444,7 +447,10 @@ <T> CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<T>>> deleteDocume
444447
* @return information about the index
445448
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-skiplist.html#create-skip-list">API
446449
* Documentation</a>
450+
* @deprecated use {@link #ensurePersistentIndex(Iterable, PersistentIndexOptions)} instead. Since ArangoDB 3.7 a
451+
* skiplist index is an alias for a persistent index.
447452
*/
453+
@Deprecated
448454
CompletableFuture<IndexEntity> ensureSkiplistIndex(
449455
final Iterable<String> fields,
450456
final SkiplistIndexOptions options);

Diff for: src/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,15 @@ public CompletableFuture<String> deleteIndex(final String id) {
264264
}
265265

266266
@Override
267+
@Deprecated
267268
public CompletableFuture<IndexEntity> ensureHashIndex(
268269
final Iterable<String> fields,
269270
final HashIndexOptions options) {
270271
return executor.execute(createHashIndexRequest(fields, options), IndexEntity.class);
271272
}
272273

273274
@Override
275+
@Deprecated
274276
public CompletableFuture<IndexEntity> ensureSkiplistIndex(
275277
final Iterable<String> fields,
276278
final SkiplistIndexOptions options) {

Diff for: src/main/java/com/arangodb/internal/ArangoCollectionImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,14 @@ public String deleteIndex(final String id) throws ArangoDBException {
259259
return executor.execute(deleteIndexRequest(id), deleteIndexResponseDeserializer());
260260
}
261261

262+
@Deprecated
262263
@Override
263264
public IndexEntity ensureHashIndex(final Iterable<String> fields, final HashIndexOptions options)
264265
throws ArangoDBException {
265266
return executor.execute(createHashIndexRequest(fields, options), IndexEntity.class);
266267
}
267268

269+
@Deprecated
268270
@Override
269271
public IndexEntity ensureSkiplistIndex(final Iterable<String> fields, final SkiplistIndexOptions options)
270272
throws ArangoDBException {

Diff for: src/main/java/com/arangodb/internal/InternalArangoCollection.java

+2
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ private String createIndexId(final String id) {
547547
return index;
548548
}
549549

550+
@Deprecated
550551
protected Request createHashIndexRequest(final Iterable<String> fields, final HashIndexOptions options) {
551552
final Request request = request(db.dbName(), RequestType.POST, PATH_API_INDEX);
552553
request.putQueryParam(COLLECTION, name);
@@ -555,6 +556,7 @@ protected Request createHashIndexRequest(final Iterable<String> fields, final Ha
555556
return request;
556557
}
557558

559+
@Deprecated
558560
protected Request createSkiplistIndexRequest(final Iterable<String> fields, final SkiplistIndexOptions options) {
559561
final Request request = request(db.dbName(), RequestType.POST, PATH_API_INDEX);
560562
request.putQueryParam(COLLECTION, name);

Diff for: src/main/java/com/arangodb/model/HashIndexOptions.java

+3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
/**
2626
* @author Mark Vollmary
2727
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-hash.html#create-hash-index">API Documentation</a>
28+
* @deprecated use {@link PersistentIndexOptions} instead. Since ArangoDB 3.7 a hash index is an alias for a persistent
29+
* index.
2830
*/
31+
@Deprecated
2932
public class HashIndexOptions extends IndexOptions<HashIndexOptions> {
3033

3134
private Iterable<String> fields;

Diff for: src/main/java/com/arangodb/model/OptionsBuilder.java

+10
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,20 @@ public static UserCreateOptions build(final UserCreateOptions options, final Str
4141
return options.user(user).passwd(passwd);
4242
}
4343

44+
/**
45+
* @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. Since ArangoDB 3.7 a hash index is an
46+
* alias for a persistent index.
47+
*/
48+
@Deprecated
4449
public static HashIndexOptions build(final HashIndexOptions options, final Iterable<String> fields) {
4550
return options.fields(fields);
4651
}
4752

53+
/**
54+
* @deprecated use {@link #build(PersistentIndexOptions, Iterable)} instead. Since ArangoDB 3.7 a skiplist index is
55+
* an alias for a persistent index.
56+
*/
57+
@Deprecated
4858
public static SkiplistIndexOptions build(final SkiplistIndexOptions options, final Iterable<String> fields) {
4959
return options.fields(fields);
5060
}

Diff for: src/main/java/com/arangodb/model/SkiplistIndexOptions.java

+3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
/**
2626
* @author Mark Vollmary
2727
* @see <a href="https://www.arangodb.com/docs/stable/http/indexes-skiplist.html#create-skip-list">API Documentation</a>
28+
* @deprecated use {@link PersistentIndexOptions} instead. Since ArangoDB 3.7 a skiplist index is an alias for a
29+
* persistent index.
2830
*/
31+
@Deprecated
2932
public class SkiplistIndexOptions extends IndexOptions<SkiplistIndexOptions> {
3033

3134
private Iterable<String> fields;

0 commit comments

Comments
 (0)