Skip to content

Commit e32f4b8

Browse files
authored
Fix a typo (#1316)
Signed-off-by: yhmo <yihua.mo@zilliz.com>
1 parent e773008 commit e32f4b8

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

sdk-core/src/main/java/io/milvus/v2/service/collection/CollectionService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ public Void createCollection(MilvusServiceGrpc.MilvusServiceBlockingStub blockin
100100
.collectionName(request.getCollectionName())
101101
.build();
102102
indexService.createIndex(blockingStub, createIndexReq);
103-
//load collection
103+
//load collection, set async to true since no need to wait loading progress
104104
try {
105105
//TimeUnit.MILLISECONDS.sleep(1000);
106-
loadCollection(blockingStub, LoadCollectionReq.builder().collectionName(request.getCollectionName()).build());
106+
loadCollection(blockingStub, LoadCollectionReq.builder().async(true).collectionName(request.getCollectionName()).build());
107107
} catch (Exception e) {
108108
throw new MilvusClientException(ErrorCode.SERVER_ERROR, "Load collection failed: " + e);
109109
}
@@ -160,8 +160,8 @@ public Void createCollectionWithSchema(MilvusServiceGrpc.MilvusServiceBlockingSt
160160
.build();
161161
indexService.createIndex(blockingStub, createIndexReq);
162162
}
163-
//load collection
164-
loadCollection(blockingStub, LoadCollectionReq.builder().collectionName(request.getCollectionName()).build());
163+
//load collection, set async to true since no need to wait loading progress
164+
loadCollection(blockingStub, LoadCollectionReq.builder().async(true).collectionName(request.getCollectionName()).build());
165165
}
166166

167167
return null;
@@ -289,7 +289,7 @@ public Void loadCollection(MilvusServiceGrpc.MilvusServiceBlockingStub blockingS
289289
.build();
290290
Status status = blockingStub.loadCollection(loadCollectionRequest);
291291
rpcUtils.handleResponse(title, status);
292-
if (request.getAsync()) {
292+
if (!request.getAsync()) {
293293
WaitForLoadCollection(blockingStub, request.getCollectionName(), request.getTimeout());
294294
}
295295

sdk-core/src/main/java/io/milvus/v2/service/collection/request/LoadCollectionReq.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class LoadCollectionReq {
3333
@Builder.Default
3434
private Integer numReplicas = 1;
3535
@Builder.Default
36-
private Boolean async = Boolean.TRUE;
36+
private Boolean async = Boolean.FALSE;
3737
@Builder.Default
3838
private Long timeout = 60000L;
3939
@Builder.Default

sdk-core/src/test/java/io/milvus/v2/client/MilvusClientV2DockerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,14 +1587,12 @@ void testDatabase() {
15871587
.indexType(IndexParam.IndexType.FLAT)
15881588
.metricType(IndexParam.MetricType.COSINE)
15891589
.build();
1590-
15911590
CreateCollectionReq requestCreate = CreateCollectionReq.builder()
15921591
.collectionName(randomCollectionName)
15931592
.collectionSchema(collectionSchema)
15941593
.indexParams(Collections.singletonList(indexParam))
15951594
.build();
15961595
client.createCollection(requestCreate);
1597-
15981596
ListCollectionsResp listCollectionsResp = client.listCollections();
15991597
List<String> collectionNames = listCollectionsResp.getCollectionNames();
16001598
Assertions.assertEquals(1, collectionNames.size());

0 commit comments

Comments
 (0)