Skip to content

Commit 598089e

Browse files
committed
v1.17.0
Signed-off-by: Anush008 <mail@anush.sh>
1 parent 8a3a8e0 commit 598089e

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# The version of qdrant to use to download protos
2-
qdrantProtosVersion=v1.16.2
2+
qdrantProtosVersion=dev
33

44
# The version of qdrant docker image to run integration tests against
5-
qdrantVersion=v1.16.2
5+
qdrantVersion=dev
66

77
# The version of the client to generate
8-
packageVersion=1.16.2
8+
packageVersion=1.17.0

src/main/java/io/qdrant/client/QdrantClient.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
import io.qdrant.client.grpc.Collections.ListCollectionAliasesRequest;
3333
import io.qdrant.client.grpc.Collections.ListCollectionsRequest;
3434
import io.qdrant.client.grpc.Collections.ListCollectionsResponse;
35+
import io.qdrant.client.grpc.Collections.ListShardKeysRequest;
36+
import io.qdrant.client.grpc.Collections.ListShardKeysResponse;
3537
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
3638
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
3739
import io.qdrant.client.grpc.Collections.RenameAlias;
3840
import io.qdrant.client.grpc.Collections.ShardKey;
41+
import io.qdrant.client.grpc.Collections.ShardKeyDescription;
3942
import io.qdrant.client.grpc.Collections.UpdateCollection;
4043
import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupRequest;
4144
import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupResponse;
@@ -926,6 +929,37 @@ public ListenableFuture<DeleteShardKeyResponse> deleteShardKeyAsync(
926929
MoreExecutors.directExecutor());
927930
}
928931

932+
/**
933+
* List the shard keys of a collection.
934+
*
935+
* @param collectionName The name of the collection to list shard keys for.
936+
* @return a new instance of {@link ListenableFuture}
937+
*/
938+
public ListenableFuture<List<ShardKeyDescription>> listShardKeysAsync(String collectionName) {
939+
return listShardKeysAsync(collectionName, null);
940+
}
941+
942+
/**
943+
* List the shard keys of a collection.
944+
*
945+
* @param collectionName The name of the collection to list shard keys for.
946+
* @param timeout The timeout for the call.
947+
* @return a new instance of {@link ListenableFuture}
948+
*/
949+
public ListenableFuture<List<ShardKeyDescription>> listShardKeysAsync(
950+
String collectionName, @Nullable Duration timeout) {
951+
Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
952+
logger.debug("List shard keys for '{}'", collectionName);
953+
954+
ListenableFuture<ListShardKeysResponse> future =
955+
getCollections(timeout)
956+
.listShardKeys(
957+
ListShardKeysRequest.newBuilder().setCollectionName(collectionName).build());
958+
addLogFailureCallback(future, "List Shard Keys");
959+
return Futures.transform(
960+
future, response -> response.getShardKeysList(), MoreExecutors.directExecutor());
961+
}
962+
929963
// endregion
930964

931965
// region Point Management

0 commit comments

Comments
 (0)