Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Russ Cam <[email protected]>
  • Loading branch information
Anush008 and russcam authored Dec 21, 2023
1 parent 6914ca0 commit a3709e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/io/qdrant/client/QdrantClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public ListenableFuture<List<AliasDescription>> listAliasesAsync(@Nullable Durat

//region ShardKey Management

/**
/**
* Creates a shard key for a collection.
*
* @param createShardKey The request object for the operation.
Expand All @@ -696,7 +696,7 @@ public ListenableFuture<CreateShardKeyResponse> createShardKeyAsync(CreateShardK
public ListenableFuture<CreateShardKeyResponse> createShardKeyAsync(CreateShardKeyRequest createShardKey, @Nullable Duration timeout) {
String collectionName = createShardKey.getCollectionName();
Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
logger.debug("Create shard key'{}'", collectionName);
logger.debug("Create shard key '{}' for '{}'", shardKey, collectionName);

ListenableFuture<CreateShardKeyResponse> future = getCollections(timeout).createShardKey(createShardKey);
addLogFailureCallback(future, "Create shard key");
Expand Down Expand Up @@ -729,13 +729,13 @@ public ListenableFuture<DeleteShardKeyResponse> deleteShardKeyAsync(DeleteShardK
public ListenableFuture<DeleteShardKeyResponse> deleteShardKeyAsync(DeleteShardKeyRequest deleteShardKey, @Nullable Duration timeout) {
String collectionName = deleteShardKey.getCollectionName();
Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty");
logger.debug("Delete shard key'{}'", collectionName);
logger.debug("Delete shard key '{}' for '{}'", shardKey, collectionName);

ListenableFuture<DeleteShardKeyResponse> future = getCollections(timeout).deleteShardKey(deleteShardKey);
addLogFailureCallback(future, "Delete shard key");
return Futures.transform(future, response -> {
if (!response.getResult()) {
logger.error("Shard key could not be deleted for '{}'", collectionName);
logger.error("Shard key '{}' could not be deleted for '{}'", shardKey, collectionName);
throw new QdrantException("Shard key could not be deleted for '" + collectionName);
}
return response;
Expand Down

0 comments on commit a3709e7

Please sign in to comment.