Skip to content

Commit

Permalink
Update describeAlias to use request (#754)
Browse files Browse the repository at this point in the history
Signed-off-by: Nian Liu <[email protected]>
  • Loading branch information
nianliuu authored Feb 5, 2024
1 parent 20dc2b9 commit ea92b22
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/main/java/io/milvus/v2/client/MilvusClientV2.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import io.milvus.v2.service.utility.UtilityService;
import io.milvus.v2.service.utility.request.AlterAliasReq;
import io.milvus.v2.service.utility.request.CreateAliasReq;
import io.milvus.v2.service.utility.request.DescribeAliasReq;
import io.milvus.v2.service.utility.request.DropAliasReq;
import io.milvus.v2.service.utility.response.DescribeAliasResp;
import io.milvus.v2.service.utility.response.ListAliasResp;
Expand Down Expand Up @@ -487,8 +488,8 @@ public ListAliasResp listAliases() {
*
* @return DescribeAliasResp
*/
public DescribeAliasResp describeAlias(String alias) {
return utilityService.describeAlias(this.blockingStub, alias);
public DescribeAliasResp describeAlias(DescribeAliasReq request) {
return utilityService.describeAlias(this.blockingStub, request);
}

/**
Expand Down
11 changes: 4 additions & 7 deletions src/main/java/io/milvus/v2/service/utility/UtilityService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import io.milvus.param.R;
import io.milvus.param.RpcStatus;
import io.milvus.v2.service.BaseService;
import io.milvus.v2.service.utility.request.AlterAliasReq;
import io.milvus.v2.service.utility.request.CreateAliasReq;
import io.milvus.v2.service.utility.request.DropAliasReq;
import io.milvus.v2.service.utility.request.FlushReq;
import io.milvus.v2.service.utility.request.*;
import io.milvus.v2.service.utility.response.DescribeAliasResp;
import io.milvus.v2.service.utility.response.ListAliasResp;

Expand Down Expand Up @@ -52,10 +49,10 @@ public void alterAlias(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub,
rpcUtils.handleResponse(title, status);
}

public DescribeAliasResp describeAlias(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub, String alias) {
String title = String.format("Describe alias %s", alias);
public DescribeAliasResp describeAlias(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub, DescribeAliasReq request) {
String title = String.format("Describe alias %s", request.getAlias());
io.milvus.grpc.DescribeAliasRequest describeAliasRequest = io.milvus.grpc.DescribeAliasRequest.newBuilder()
.setAlias(alias)
.setAlias(request.getAlias())
.build();
io.milvus.grpc.DescribeAliasResponse response = blockingStub.describeAlias(describeAliasRequest);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.milvus.v2.service.utility.request;

import lombok.Data;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
public class DescribeAliasReq {
private String alias;
}
6 changes: 5 additions & 1 deletion src/test/java/io/milvus/v2/service/utility/UtilityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.milvus.v2.BaseTest;
import io.milvus.v2.service.utility.request.AlterAliasReq;
import io.milvus.v2.service.utility.request.CreateAliasReq;
import io.milvus.v2.service.utility.request.DescribeAliasReq;
import io.milvus.v2.service.utility.request.DropAliasReq;
import io.milvus.v2.service.utility.response.DescribeAliasResp;
import io.milvus.v2.service.utility.response.ListAliasResp;
Expand Down Expand Up @@ -40,7 +41,10 @@ void testAlterAlias() {

@Test
void describeAlias() {
DescribeAliasResp statusR = client_v2.describeAlias("test_alias");
DescribeAliasReq req = DescribeAliasReq.builder()
.alias("test_alias")
.build();
DescribeAliasResp statusR = client_v2.describeAlias(req);
}
@Test
void listAliases() {
Expand Down

0 comments on commit ea92b22

Please sign in to comment.