Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions src/main/java/io/qdrant/client/QdrantClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -926,6 +929,37 @@ public ListenableFuture<DeleteShardKeyResponse> 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<List<ShardKeyDescription>> 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<List<ShardKeyDescription>> listShardKeysAsync(
String collectionName, @Nullable Duration timeout) {
Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
logger.debug("List shard keys for '{}'", collectionName);

ListenableFuture<ListShardKeysResponse> 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
Expand Down
Loading