From a7da5ed23d513f43f4e262b446bd507a2a19339c Mon Sep 17 00:00:00 2001 From: Anush008 Date: Thu, 21 Dec 2023 12:29:59 +0530 Subject: [PATCH] chore: review changes --- build.gradle | 2 +- gradle.properties | 2 +- src/main/java/io/qdrant/client/QdrantClient.java | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 722d6c0..189e243 100644 --- a/build.gradle +++ b/build.gradle @@ -228,4 +228,4 @@ publishing { repositories { mavenLocal() } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index 44e0858..a609339 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ qdrantProtosVersion=v1.7.0 qdrantVersion=v1.7.0 # The version of the client to generate -packageVersion=1.7-SNAPSHOT \ No newline at end of file +packageVersion=1.7.0 \ No newline at end of file diff --git a/src/main/java/io/qdrant/client/QdrantClient.java b/src/main/java/io/qdrant/client/QdrantClient.java index 428be38..a8dcae4 100644 --- a/src/main/java/io/qdrant/client/QdrantClient.java +++ b/src/main/java/io/qdrant/client/QdrantClient.java @@ -49,6 +49,7 @@ import static io.qdrant.client.grpc.Collections.PayloadIndexParams; import static io.qdrant.client.grpc.Collections.PayloadSchemaType; import static io.qdrant.client.grpc.Collections.RenameAlias; +import static io.qdrant.client.grpc.Collections.ShardKey; import static io.qdrant.client.grpc.Collections.UpdateCollection; import static io.qdrant.client.grpc.Collections.VectorParams; import static io.qdrant.client.grpc.Collections.VectorParamsMap; @@ -696,6 +697,7 @@ public ListenableFuture createShardKeyAsync(CreateShardK public ListenableFuture createShardKeyAsync(CreateShardKeyRequest createShardKey, @Nullable Duration timeout) { String collectionName = createShardKey.getCollectionName(); Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty"); + ShardKey shardKey = createShardKey.getRequest().getShardKey(); logger.debug("Create shard key '{}' for '{}'", shardKey, collectionName); ListenableFuture future = getCollections(timeout).createShardKey(createShardKey); @@ -703,7 +705,7 @@ public ListenableFuture createShardKeyAsync(CreateShardK return Futures.transform(future, response -> { if (!response.getResult()) { logger.error("Shard key could not be created for '{}'", collectionName); - throw new QdrantException("Shard key could not be created for '" + collectionName); + throw new QdrantException("Shard key " + shardKey + " could not be created for " + collectionName); } return response; }, MoreExecutors.directExecutor()); @@ -729,6 +731,7 @@ public ListenableFuture deleteShardKeyAsync(DeleteShardK public ListenableFuture deleteShardKeyAsync(DeleteShardKeyRequest deleteShardKey, @Nullable Duration timeout) { String collectionName = deleteShardKey.getCollectionName(); Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty"); + ShardKey shardKey = deleteShardKey.getRequest().getShardKey(); logger.debug("Delete shard key '{}' for '{}'", shardKey, collectionName); ListenableFuture future = getCollections(timeout).deleteShardKey(deleteShardKey); @@ -736,7 +739,7 @@ public ListenableFuture deleteShardKeyAsync(DeleteShardK return Futures.transform(future, response -> { if (!response.getResult()) { logger.error("Shard key '{}' could not be deleted for '{}'", shardKey, collectionName); - throw new QdrantException("Shard key could not be deleted for '" + collectionName); + throw new QdrantException("Shard key " + shardKey + " could not be created for " + collectionName); } return response; }, MoreExecutors.directExecutor());