Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public Void createCollection(MilvusServiceGrpc.MilvusServiceBlockingStub blockin
.collectionName(request.getCollectionName())
.build();
indexService.createIndex(blockingStub, createIndexReq);
//load collection
//load collection, set async to true since no need to wait loading progress
try {
//TimeUnit.MILLISECONDS.sleep(1000);
loadCollection(blockingStub, LoadCollectionReq.builder().collectionName(request.getCollectionName()).build());
loadCollection(blockingStub, LoadCollectionReq.builder().async(true).collectionName(request.getCollectionName()).build());
} catch (Exception e) {
throw new MilvusClientException(ErrorCode.SERVER_ERROR, "Load collection failed: " + e);
}
Expand Down Expand Up @@ -160,8 +160,8 @@ public Void createCollectionWithSchema(MilvusServiceGrpc.MilvusServiceBlockingSt
.build();
indexService.createIndex(blockingStub, createIndexReq);
}
//load collection
loadCollection(blockingStub, LoadCollectionReq.builder().collectionName(request.getCollectionName()).build());
//load collection, set async to true since no need to wait loading progress
loadCollection(blockingStub, LoadCollectionReq.builder().async(true).collectionName(request.getCollectionName()).build());
}

return null;
Expand Down Expand Up @@ -289,7 +289,7 @@ public Void loadCollection(MilvusServiceGrpc.MilvusServiceBlockingStub blockingS
.build();
Status status = blockingStub.loadCollection(loadCollectionRequest);
rpcUtils.handleResponse(title, status);
if (request.getAsync()) {
if (!request.getAsync()) {
WaitForLoadCollection(blockingStub, request.getCollectionName(), request.getTimeout());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class LoadCollectionReq {
@Builder.Default
private Integer numReplicas = 1;
@Builder.Default
private Boolean async = Boolean.TRUE;
private Boolean async = Boolean.FALSE;
@Builder.Default
private Long timeout = 60000L;
@Builder.Default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1587,14 +1587,12 @@ void testDatabase() {
.indexType(IndexParam.IndexType.FLAT)
.metricType(IndexParam.MetricType.COSINE)
.build();

CreateCollectionReq requestCreate = CreateCollectionReq.builder()
.collectionName(randomCollectionName)
.collectionSchema(collectionSchema)
.indexParams(Collections.singletonList(indexParam))
.build();
client.createCollection(requestCreate);

ListCollectionsResp listCollectionsResp = client.listCollections();
List<String> collectionNames = listCollectionsResp.getCollectionNames();
Assertions.assertEquals(1, collectionNames.size());
Expand Down
Loading