Skip to content

Commit 97c8ce0

Browse files
committed
Fix all warnings, javadocs and compiling issue
1 parent 05af2bc commit 97c8ce0

File tree

36 files changed

+811
-72
lines changed

36 files changed

+811
-72
lines changed

astra-db-java/src/main/java/com/datastax/astra/client/collections/Collection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import lombok.Getter;
7171
import lombok.extern.slf4j.Slf4j;
7272

73+
import java.time.Duration;
7374
import java.time.Instant;
7475
import java.util.ArrayList;
7576
import java.util.Arrays;
@@ -584,6 +585,7 @@ public CollectionInsertManyResult insertMany(List<? extends T> documents, Collec
584585
try {
585586
for (Future<CollectionInsertManyResult> future : futures) {
586587
CollectionInsertManyResult res = future.get();
588+
System.out.println("res = " + res.getInsertedIds());
587589
finalResult.getInsertedIds().addAll(res.getInsertedIds());
588590
finalResult.getDocumentResponses().addAll(res.getDocumentResponses());
589591
}
@@ -1343,7 +1345,6 @@ public CollectionDeleteResult deleteMany(Filter filter, CollectionDeleteManyOpti
13431345
Command deleteMany = Command
13441346
.create("deleteMany")
13451347
.withFilter(filter);
1346-
13471348
DataAPIResponse apiResponse = runCommand(deleteMany, options);
13481349
DataAPIStatus status = apiResponse.getStatus();
13491350
if (status != null) {
@@ -1365,7 +1366,8 @@ public CollectionDeleteResult deleteMany(Filter filter, CollectionDeleteManyOpti
13651366
* the result of the remove many operation
13661367
*/
13671368
public CollectionDeleteResult deleteMany(Filter filter) {
1368-
return deleteMany(filter, new CollectionDeleteManyOptions());
1369+
return deleteMany(filter, new CollectionDeleteManyOptions()
1370+
.timeout(Duration.ofSeconds(30)));
13691371
}
13701372

13711373
/**

astra-db-java/src/main/java/com/datastax/astra/client/collections/commands/options/CollectionDeleteManyOptions.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* Licensed under the Apache License, Version 2.0
1010
* You may not use this file except in compliance with the License.
1111
* You may obtain a copy of the License at
12-
*
12+
*
1313
* http://www.apache.org/licenses/LICENSE-2.0
14-
*
14+
*
1515
* Unless required by applicable law or agreed to in writing, software
1616
* distributed under the License is distributed on an "AS IS" BASIS,
1717
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -29,13 +29,14 @@
2929
/**
3030
* Options to delete many documents.
3131
*/
32-
@Getter @Setter
32+
@Getter
33+
@Setter
3334
@Accessors(fluent = true, chain = true)
3435
public class CollectionDeleteManyOptions extends BaseOptions<CollectionDeleteManyOptions> {
3536

36-
/**
37-
* Default constructor.
38-
*/
39-
public CollectionDeleteManyOptions() {
40-
}
37+
/**
38+
* Default constructor.
39+
*/
40+
public CollectionDeleteManyOptions() {
41+
}
4142
}

astra-db-java/src/main/java/com/datastax/astra/client/collections/commands/options/UpdateOneOptions.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929

3030
/**
3131
* Options for the updateOne operation
32-
3332
*/
3433
@Getter @Setter
35-
@NoArgsConstructor
3634
@Accessors(fluent = true, chain = true)
3735
public class UpdateOneOptions extends BaseOptions<UpdateOneOptions> {
3836

@@ -46,6 +44,11 @@ public class UpdateOneOptions extends BaseOptions<UpdateOneOptions> {
4644
*/
4745
private Sort[] sort;
4846

47+
/**
48+
* Default constructor.
49+
*/
50+
public UpdateOneOptions() {}
51+
4952
/**
5053
* Adding this on top of sort(Sort[] s) to allow for a more fluent API.
5154
* @param s

astra-db-java/src/main/java/com/datastax/astra/client/collections/commands/results/CollectionInsertManyResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public class CollectionInsertManyResult {
4747
* Default constructor.
4848
*/
4949
public CollectionInsertManyResult() {
50+
this.insertedIds = new ArrayList<>();
51+
this.documentResponses = new ArrayList<>();
5052
}
5153

5254

astra-db-java/src/main/java/com/datastax/astra/client/core/http/HttpClientOptions.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ public List<Caller> getCallers() {
9090
*/
9191
Duration retryDelay = Duration.ofMillis(DEFAULT_RETRY_DELAY_MILLIS);
9292

93+
/**
94+
* Set the number of retries and the delay between each retry.
95+
*
96+
* @param i
97+
* number of retries
98+
* @param duration
99+
* delay between each retry
100+
* @return
101+
* this
102+
*/
93103
public HttpClientOptions httpRetries(int i, Duration duration) {
94104
this.retryCount = i;
95105
this.retryDelay = duration;
@@ -171,6 +181,7 @@ public HttpClientOptions() {
171181
callers.add(DEFAULT_CALLER);
172182
}
173183

184+
/** {@inheritDoc} */
174185
@Override
175186
public HttpClientOptions clone() {
176187
try {

astra-db-java/src/main/java/com/datastax/astra/client/core/http/HttpProxy.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
* Subclass to represent an http proxy.
3131
*/
3232
@Setter
33-
@NoArgsConstructor
34-
@AllArgsConstructor
3533
@Accessors(fluent = true, chain = true)
3634
public class HttpProxy implements Cloneable {
3735

@@ -41,6 +39,25 @@ public class HttpProxy implements Cloneable {
4139
/** port of the proxy. */
4240
int port;
4341

42+
/**
43+
* Default constructor.
44+
*/
45+
public HttpProxy() {}
46+
47+
/**
48+
* Constructor with hostname and port.
49+
*
50+
* @param hostname
51+
* hostname of the proxy
52+
* @param port
53+
* port for the proxy
54+
*/
55+
public HttpProxy(String hostname, int port) {
56+
this.hostname = hostname;
57+
this.port = port;
58+
}
59+
60+
/** {@inheritDoc} */
4461
@Override
4562
public HttpProxy clone() {
4663
return new HttpProxy(this.hostname, this.port);

astra-db-java/src/main/java/com/datastax/astra/client/core/options/SerdesOptions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* limitations under the License.
2424
* #L%
2525
*/
26+
27+
/**
28+
* Options for serialization and deserialization.
29+
*/
2630
@Setter
2731
@Accessors(fluent = true, chain = true)
2832
public class SerdesOptions implements Cloneable {

astra-db-java/src/main/java/com/datastax/astra/client/core/query/Filter.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,19 @@ public Filter() {
4040
super();
4141
}
4242

43+
/**
44+
* Create a filter from a map.
45+
*
46+
* @param conditions
47+
* conditions
48+
*/
4349
public Filter(Map<String, Object> conditions) {
4450
super();
4551
if (conditions != null) {
4652
documentMap.putAll(conditions);
4753
}
4854
}
55+
4956
/**
5057
* Create a filter from a where clause.
5158
*

astra-db-java/src/main/java/com/datastax/astra/client/core/vector/VectorOptions.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
* Subclass representing the vector options.
3232
*/
3333
@Setter
34-
@NoArgsConstructor
3534
@Accessors(fluent = true, chain = true)
3635
public class VectorOptions {
3736

@@ -50,6 +49,11 @@ public class VectorOptions {
5049
*/
5150
private VectorServiceOptions service;
5251

52+
/**
53+
* Default constructor.
54+
*/
55+
public VectorOptions() {}
56+
5357
/**
5458
* Get metric as an enum.
5559
*

astra-db-java/src/main/java/com/datastax/astra/client/core/vectorize/VectorServiceOptions.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
* .parameters(Map.of("temperature", 0.7));
4444
* }</pre>
4545
*/
46-
@Getter
47-
@Setter
46+
@Getter @Setter
4847
public class VectorServiceOptions {
4948

5049
/**
@@ -69,6 +68,11 @@ public class VectorServiceOptions {
6968
*/
7069
private Map<String, Object> parameters;
7170

71+
/**
72+
* Default constructor for serialization purposes.
73+
*/
74+
public VectorServiceOptions() {}
75+
7276
/**
7377
* Adds a single authentication key-value pair to the {@code authentication} map.
7478
*

0 commit comments

Comments
 (0)