From 598089e7a7bc2cf71a4dd6f5edf20f33aedadcbb Mon Sep 17 00:00:00 2001 From: Anush008 Date: Thu, 12 Feb 2026 13:20:30 +0530 Subject: [PATCH] v1.17.0 Signed-off-by: Anush008 --- gradle.properties | 6 ++-- .../java/io/qdrant/client/QdrantClient.java | 34 +++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index a8c3f78..bd2d372 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,8 @@ # The version of qdrant to use to download protos -qdrantProtosVersion=v1.16.2 +qdrantProtosVersion=dev # The version of qdrant docker image to run integration tests against -qdrantVersion=v1.16.2 +qdrantVersion=dev # The version of the client to generate -packageVersion=1.16.2 +packageVersion=1.17.0 diff --git a/src/main/java/io/qdrant/client/QdrantClient.java b/src/main/java/io/qdrant/client/QdrantClient.java index 717e798..42edf51 100644 --- a/src/main/java/io/qdrant/client/QdrantClient.java +++ b/src/main/java/io/qdrant/client/QdrantClient.java @@ -32,10 +32,13 @@ import io.qdrant.client.grpc.Collections.ListCollectionAliasesRequest; import io.qdrant.client.grpc.Collections.ListCollectionsRequest; import io.qdrant.client.grpc.Collections.ListCollectionsResponse; +import io.qdrant.client.grpc.Collections.ListShardKeysRequest; +import io.qdrant.client.grpc.Collections.ListShardKeysResponse; import io.qdrant.client.grpc.Collections.PayloadIndexParams; import io.qdrant.client.grpc.Collections.PayloadSchemaType; import io.qdrant.client.grpc.Collections.RenameAlias; import io.qdrant.client.grpc.Collections.ShardKey; +import io.qdrant.client.grpc.Collections.ShardKeyDescription; import io.qdrant.client.grpc.Collections.UpdateCollection; import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupRequest; import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupResponse; @@ -926,6 +929,37 @@ public ListenableFuture deleteShardKeyAsync( MoreExecutors.directExecutor()); } + /** + * List the shard keys of a collection. + * + * @param collectionName The name of the collection to list shard keys for. + * @return a new instance of {@link ListenableFuture} + */ + public ListenableFuture> listShardKeysAsync(String collectionName) { + return listShardKeysAsync(collectionName, null); + } + + /** + * List the shard keys of a collection. + * + * @param collectionName The name of the collection to list shard keys for. + * @param timeout The timeout for the call. + * @return a new instance of {@link ListenableFuture} + */ + public ListenableFuture> listShardKeysAsync( + String collectionName, @Nullable Duration timeout) { + Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty"); + logger.debug("List shard keys for '{}'", collectionName); + + ListenableFuture future = + getCollections(timeout) + .listShardKeys( + ListShardKeysRequest.newBuilder().setCollectionName(collectionName).build()); + addLogFailureCallback(future, "List Shard Keys"); + return Futures.transform( + future, response -> response.getShardKeysList(), MoreExecutors.directExecutor()); + } + // endregion // region Point Management