From 2754387938094eb528c24ac1cc581b0d24fae392 Mon Sep 17 00:00:00 2001 From: Anush Date: Sat, 6 Jan 2024 22:26:05 +0530 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Russ Cam --- src/main/java/io/qdrant/client/QdrantClient.java | 7 +++++-- src/main/java/io/qdrant/client/VectorsFactory.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/qdrant/client/QdrantClient.java b/src/main/java/io/qdrant/client/QdrantClient.java index 615a216..1d59206 100644 --- a/src/main/java/io/qdrant/client/QdrantClient.java +++ b/src/main/java/io/qdrant/client/QdrantClient.java @@ -2257,13 +2257,16 @@ public ListenableFuture batchUpdateAsync( * * @return a new instance of {@link ListenableFuture} */ - public ListenableFuture batchUpdateAsync(UpdateBatchPoints request, @Nullable Duration timeout) { + public ListenableFuture> batchUpdateAsync(UpdateBatchPoints request, @Nullable Duration timeout) { String collectionName = request.getCollectionName(); Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty"); logger.debug("Batch update points on '{}'", collectionName); ListenableFuture future = getPoints(timeout).updateBatch(request); addLogFailureCallback(future, "Batch update points"); - return future; + return Futures.transform( + future, + UpdateBatchResponse::getResultList, + MoreExecutors.directExecutor()); } /** diff --git a/src/main/java/io/qdrant/client/VectorsFactory.java b/src/main/java/io/qdrant/client/VectorsFactory.java index daf7489..bd3e285 100644 --- a/src/main/java/io/qdrant/client/VectorsFactory.java +++ b/src/main/java/io/qdrant/client/VectorsFactory.java @@ -25,7 +25,7 @@ private VectorsFactory() { public static Vectors namedVectors(Map values) { return Vectors.newBuilder() .setVectors(NamedVectors.newBuilder() - .putAllVectors(Maps.transformValues(values, v -> v)) + .putAllVectors(values) ) .build(); }