|
10 | 10 | import io.qdrant.client.grpc.Collections.AliasDescription; |
11 | 11 | import io.qdrant.client.grpc.Collections.AliasOperations; |
12 | 12 | import io.qdrant.client.grpc.Collections.ChangeAliases; |
| 13 | +import io.qdrant.client.grpc.Collections.CollectionClusterInfoRequest; |
| 14 | +import io.qdrant.client.grpc.Collections.CollectionClusterInfoResponse; |
13 | 15 | import io.qdrant.client.grpc.Collections.CollectionDescription; |
14 | 16 | import io.qdrant.client.grpc.Collections.CollectionExistsRequest; |
15 | 17 | import io.qdrant.client.grpc.Collections.CollectionExistsResponse; |
|
35 | 37 | import io.qdrant.client.grpc.Collections.RenameAlias; |
36 | 38 | import io.qdrant.client.grpc.Collections.ShardKey; |
37 | 39 | import io.qdrant.client.grpc.Collections.UpdateCollection; |
| 40 | +import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupRequest; |
| 41 | +import io.qdrant.client.grpc.Collections.UpdateCollectionClusterSetupResponse; |
38 | 42 | import io.qdrant.client.grpc.Collections.VectorParams; |
39 | 43 | import io.qdrant.client.grpc.Collections.VectorParamsMap; |
40 | 44 | import io.qdrant.client.grpc.Collections.VectorsConfig; |
41 | 45 | import io.qdrant.client.grpc.CollectionsGrpc; |
| 46 | +import io.qdrant.client.grpc.Common.Filter; |
| 47 | +import io.qdrant.client.grpc.Common.PointId; |
42 | 48 | import io.qdrant.client.grpc.JsonWithInt.Value; |
43 | 49 | import io.qdrant.client.grpc.Points; |
44 | 50 | import io.qdrant.client.grpc.Points.BatchResult; |
|
55 | 61 | import io.qdrant.client.grpc.Points.DiscoverPoints; |
56 | 62 | import io.qdrant.client.grpc.Points.DiscoverResponse; |
57 | 63 | import io.qdrant.client.grpc.Points.FieldType; |
58 | | -import io.qdrant.client.grpc.Points.Filter; |
59 | 64 | import io.qdrant.client.grpc.Points.GetPoints; |
60 | 65 | import io.qdrant.client.grpc.Points.GetResponse; |
61 | 66 | import io.qdrant.client.grpc.Points.PointGroup; |
62 | | -import io.qdrant.client.grpc.Points.PointId; |
63 | 67 | import io.qdrant.client.grpc.Points.PointStruct; |
64 | 68 | import io.qdrant.client.grpc.Points.PointVectors; |
65 | 69 | import io.qdrant.client.grpc.Points.PointsIdsList; |
@@ -400,6 +404,35 @@ public ListenableFuture<CollectionInfo> getCollectionInfoAsync( |
400 | 404 | future, GetCollectionInfoResponse::getResult, MoreExecutors.directExecutor()); |
401 | 405 | } |
402 | 406 |
|
| 407 | + /** |
| 408 | + * Gets detailed information about a collection's cluster setup. |
| 409 | + * |
| 410 | + * @param collectionName The name of the collection. |
| 411 | + * @return a new instance of {@link ListenableFuture} |
| 412 | + */ |
| 413 | + public ListenableFuture<CollectionClusterInfoResponse> getCollectionClusterInfoAsync( |
| 414 | + String collectionName) { |
| 415 | + return getCollectionClusterInfoAsync(collectionName, null); |
| 416 | + } |
| 417 | + |
| 418 | + /** |
| 419 | + * Gets detailed information about a collection's cluster setup. |
| 420 | + * |
| 421 | + * @param collectionName The name of the collection. |
| 422 | + * @param timeout The timeout for the call. |
| 423 | + * @return a new instance of {@link ListenableFuture} |
| 424 | + */ |
| 425 | + public ListenableFuture<CollectionClusterInfoResponse> getCollectionClusterInfoAsync( |
| 426 | + String collectionName, @Nullable Duration timeout) { |
| 427 | + logger.debug("Get collection cluster info for '{}'", collectionName); |
| 428 | + CollectionClusterInfoRequest request = |
| 429 | + CollectionClusterInfoRequest.newBuilder().setCollectionName(collectionName).build(); |
| 430 | + ListenableFuture<CollectionClusterInfoResponse> future = |
| 431 | + getCollections(timeout).collectionClusterInfo(request); |
| 432 | + addLogFailureCallback(future, "Get collection cluster info"); |
| 433 | + return future; |
| 434 | + } |
| 435 | + |
403 | 436 | /** |
404 | 437 | * Deletes a collection and all its associated data. |
405 | 438 | * |
@@ -511,6 +544,47 @@ public ListenableFuture<CollectionOperationResponse> updateCollectionAsync( |
511 | 544 | MoreExecutors.directExecutor()); |
512 | 545 | } |
513 | 546 |
|
| 547 | + /** |
| 548 | + * Update cluster setup for a collection |
| 549 | + * |
| 550 | + * @param updateCollectionClusterSetup The update parameters. |
| 551 | + * @return a new instance of {@link ListenableFuture} |
| 552 | + */ |
| 553 | + public ListenableFuture<UpdateCollectionClusterSetupResponse> updateCollectionClusterSetupAsync( |
| 554 | + UpdateCollectionClusterSetupRequest updateCollectionClusterSetup) { |
| 555 | + return updateCollectionClusterSetupAsync(updateCollectionClusterSetup, null); |
| 556 | + } |
| 557 | + |
| 558 | + /** |
| 559 | + * Update cluster setup for a collection |
| 560 | + * |
| 561 | + * @param updateCollectionClusterSetup The update parameters. |
| 562 | + * @param timeout The timeout for the call. |
| 563 | + * @return a new instance of {@link ListenableFuture} |
| 564 | + */ |
| 565 | + public ListenableFuture<UpdateCollectionClusterSetupResponse> updateCollectionClusterSetupAsync( |
| 566 | + UpdateCollectionClusterSetupRequest updateCollectionClusterSetup, |
| 567 | + @Nullable Duration timeout) { |
| 568 | + String collectionName = updateCollectionClusterSetup.getCollectionName(); |
| 569 | + Preconditions.checkArgument(!collectionName.isEmpty(), "Collection name must not be empty"); |
| 570 | + logger.debug("Update collection cluster setup'{}'", collectionName); |
| 571 | + |
| 572 | + ListenableFuture<UpdateCollectionClusterSetupResponse> future = |
| 573 | + getCollections(timeout).updateCollectionClusterSetup(updateCollectionClusterSetup); |
| 574 | + addLogFailureCallback(future, "Update collection"); |
| 575 | + return Futures.transform( |
| 576 | + future, |
| 577 | + response -> { |
| 578 | + if (!response.getResult()) { |
| 579 | + logger.error("Cluster setup of collection '{}' could not be updated", collectionName); |
| 580 | + throw new QdrantException( |
| 581 | + "Cluster setup of collection '" + collectionName + "' could not be updated"); |
| 582 | + } |
| 583 | + return response; |
| 584 | + }, |
| 585 | + MoreExecutors.directExecutor()); |
| 586 | + } |
| 587 | + |
514 | 588 | /** |
515 | 589 | * Check if a collection exists |
516 | 590 | * |
@@ -1212,6 +1286,16 @@ public ListenableFuture<UpdateResult> updateVectorsAsync( |
1212 | 1286 | return updateVectorsAsync(requestBuilder.build(), timeout); |
1213 | 1287 | } |
1214 | 1288 |
|
| 1289 | + /** |
| 1290 | + * Update named vectors for point. |
| 1291 | + * |
| 1292 | + * @param request The update point vectors request |
| 1293 | + * @return a new instance of {@link ListenableFuture} |
| 1294 | + */ |
| 1295 | + public ListenableFuture<UpdateResult> updateVectorsAsync(UpdatePointVectors request) { |
| 1296 | + return updateVectorsAsync(request, null); |
| 1297 | + } |
| 1298 | + |
1215 | 1299 | /** |
1216 | 1300 | * Update named vectors for point. |
1217 | 1301 | * |
|
0 commit comments