소스 검색

1.add user to role 2.add role privilege param 3.remove flush in creat… (#386)

* 1.add user to role 2.add role privilege param 3.remove flush in createIndex 4.add DISKANN and AUTOINDEX index type 4.add import interface

* 1.add user to role 2.add role privilege param 3.remove flush in createIndex 4.add DISKANN and AUTOINDEX index type 5.add import interface 6.upgrad proto

* 1.add user to role 2.add role privilege param 3.remove flush in createIndex 4.add DISKANN and AUTOINDEX index type 5.add bulk insert interface 6.upgrad proto
yelusion 2 년 전
부모
커밋
120fbde350
24개의 변경된 파일1842개의 추가작업 그리고 77개의 파일을 삭제
  1. 1 1
      doc/io/milvus/response/GetBulkloadStateWrapper.html
  2. 2 2
      examples/pom.xml
  3. 1 1
      pom.xml
  4. 479 13
      src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java
  5. 160 15
      src/main/java/io/milvus/client/MilvusClient.java
  6. 121 7
      src/main/java/io/milvus/client/MilvusMultiServiceClient.java
  7. 1 1
      src/main/java/io/milvus/common/clientenum/ConsistencyLevelEnum.java
  8. 2 0
      src/main/java/io/milvus/param/IndexType.java
  9. 156 0
      src/main/java/io/milvus/param/bulkinsert/BulkInsertParam.java
  10. 83 0
      src/main/java/io/milvus/param/bulkinsert/GetBulkInsertStateParam.java
  11. 65 0
      src/main/java/io/milvus/param/bulkinsert/ListBulkInsertTasksParam.java
  12. 11 0
      src/main/java/io/milvus/param/collection/ShowCollectionsParam.java
  13. 70 0
      src/main/java/io/milvus/param/role/AddUserToRoleParam.java
  14. 55 0
      src/main/java/io/milvus/param/role/CreateRoleParam.java
  15. 55 0
      src/main/java/io/milvus/param/role/DropRoleParam.java
  16. 104 0
      src/main/java/io/milvus/param/role/GrantRolePrivilegeParam.java
  17. 70 0
      src/main/java/io/milvus/param/role/RemoveUserFromRoleParam.java
  18. 104 0
      src/main/java/io/milvus/param/role/RevokeRolePrivilegeParam.java
  19. 88 0
      src/main/java/io/milvus/param/role/SelectGrantForRoleAndObjectParam.java
  20. 55 0
      src/main/java/io/milvus/param/role/SelectGrantForRoleParam.java
  21. 69 0
      src/main/java/io/milvus/param/role/SelectRoleParam.java
  22. 70 0
      src/main/java/io/milvus/param/role/SelectUserParam.java
  23. 19 36
      src/main/java/io/milvus/response/GetBulkInsertStateWrapper.java
  24. 1 1
      src/main/milvus-proto

+ 1 - 1
doc/io/milvus/response/GetBulkloadStateWrapper.html

@@ -99,7 +99,7 @@ var activeTableTab = "activeTableTab";
 <li>java.lang.Object</li>
 <li>java.lang.Object</li>
 <li>
 <li>
 <ul class="inheritance">
 <ul class="inheritance">
-<li>io.milvus.response.GetBulkloadStateWrapper</li>
+<li>io.milvus.response.GetBulkInsertStateWrapper</li>
 </ul>
 </ul>
 </li>
 </li>
 </ul>
 </ul>

+ 2 - 2
examples/pom.xml

@@ -25,7 +25,7 @@
 
 
     <groupId>io.milvus</groupId>
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java-examples</artifactId>
     <artifactId>milvus-sdk-java-examples</artifactId>
-    <version>2.1.0-beta4</version>
+    <version>2.2.0-beta1</version>
     <build>
     <build>
         <plugins>
         <plugins>
             <plugin>
             <plugin>
@@ -63,7 +63,7 @@
         <dependency>
         <dependency>
             <groupId>io.milvus</groupId>
             <groupId>io.milvus</groupId>
             <artifactId>milvus-sdk-java</artifactId>
             <artifactId>milvus-sdk-java</artifactId>
-            <version>2.1.0-beta4</version>
+            <version>2.2.0-beta1</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
             <groupId>com.google.code.gson</groupId>

+ 1 - 1
pom.xml

@@ -25,7 +25,7 @@
 
 
     <groupId>io.milvus</groupId>
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java</artifactId>
     <artifactId>milvus-sdk-java</artifactId>
-    <version>2.1.0-beta4</version>
+    <version>2.2.0-beta1</version>
     <packaging>jar</packaging>
     <packaging>jar</packaging>
 
 
     <name>io.milvus:milvus-sdk-java</name>
     <name>io.milvus:milvus-sdk-java</name>

+ 479 - 13
src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java

@@ -28,28 +28,82 @@ import io.milvus.exception.ClientNotConnectedException;
 import io.milvus.exception.IllegalResponseException;
 import io.milvus.exception.IllegalResponseException;
 import io.milvus.exception.ParamException;
 import io.milvus.exception.ParamException;
 import io.milvus.grpc.*;
 import io.milvus.grpc.*;
+import io.milvus.grpc.ObjectEntity;
 import io.milvus.param.ParamUtils;
 import io.milvus.param.ParamUtils;
 import io.milvus.param.R;
 import io.milvus.param.R;
 import io.milvus.param.RpcStatus;
 import io.milvus.param.RpcStatus;
 import io.milvus.param.alias.AlterAliasParam;
 import io.milvus.param.alias.AlterAliasParam;
 import io.milvus.param.alias.CreateAliasParam;
 import io.milvus.param.alias.CreateAliasParam;
 import io.milvus.param.alias.DropAliasParam;
 import io.milvus.param.alias.DropAliasParam;
-import io.milvus.param.collection.*;
-import io.milvus.param.control.*;
-import io.milvus.param.credential.*;
-import io.milvus.param.dml.*;
-import io.milvus.param.index.*;
-import io.milvus.param.partition.*;
+import io.milvus.param.bulkinsert.GetBulkInsertStateParam;
+import io.milvus.param.bulkinsert.BulkInsertParam;
+import io.milvus.param.bulkinsert.ListBulkInsertTasksParam;
+import io.milvus.param.collection.CreateCollectionParam;
+import io.milvus.param.collection.DescribeCollectionParam;
+import io.milvus.param.collection.DropCollectionParam;
+import io.milvus.param.collection.FieldType;
+import io.milvus.param.collection.FlushParam;
+import io.milvus.param.collection.GetCollectionStatisticsParam;
+import io.milvus.param.collection.HasCollectionParam;
+import io.milvus.param.collection.LoadCollectionParam;
+import io.milvus.param.collection.ReleaseCollectionParam;
+import io.milvus.param.collection.ShowCollectionsParam;
+import io.milvus.param.control.GetCompactionPlansParam;
+import io.milvus.param.control.GetCompactionStateParam;
+import io.milvus.param.control.GetFlushStateParam;
+import io.milvus.param.control.GetMetricsParam;
+import io.milvus.param.control.GetPersistentSegmentInfoParam;
+import io.milvus.param.control.GetQuerySegmentInfoParam;
+import io.milvus.param.control.GetReplicasParam;
+import io.milvus.param.control.LoadBalanceParam;
+import io.milvus.param.control.ManualCompactParam;
+import io.milvus.param.credential.CreateCredentialParam;
+import io.milvus.param.credential.DeleteCredentialParam;
+import io.milvus.param.credential.ListCredUsersParam;
+import io.milvus.param.credential.UpdateCredentialParam;
+import io.milvus.param.dml.DeleteParam;
+import io.milvus.param.dml.InsertParam;
+import io.milvus.param.dml.QueryParam;
+import io.milvus.param.dml.SearchParam;
+import io.milvus.param.index.CreateIndexParam;
+import io.milvus.param.index.DescribeIndexParam;
+import io.milvus.param.index.DropIndexParam;
+import io.milvus.param.index.GetIndexBuildProgressParam;
+import io.milvus.param.index.GetIndexStateParam;
+import io.milvus.param.partition.CreatePartitionParam;
+import io.milvus.param.partition.DropPartitionParam;
+import io.milvus.param.partition.GetPartitionStatisticsParam;
+import io.milvus.param.partition.HasPartitionParam;
+import io.milvus.param.partition.LoadPartitionsParam;
+import io.milvus.param.partition.ReleasePartitionsParam;
+import io.milvus.param.partition.ShowPartitionsParam;
+import io.milvus.param.role.AddUserToRoleParam;
+import io.milvus.param.role.CreateRoleParam;
+import io.milvus.param.role.DropRoleParam;
+import io.milvus.param.role.GrantRolePrivilegeParam;
+import io.milvus.param.role.RemoveUserFromRoleParam;
+import io.milvus.param.role.RevokeRolePrivilegeParam;
+import io.milvus.param.role.SelectGrantForRoleAndObjectParam;
+import io.milvus.param.role.SelectGrantForRoleParam;
+import io.milvus.param.role.SelectRoleParam;
+import io.milvus.param.role.SelectUserParam;
 import io.milvus.response.DescCollResponseWrapper;
 import io.milvus.response.DescCollResponseWrapper;
 import lombok.NonNull;
 import lombok.NonNull;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nonnull;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Function;
 import java.util.function.Function;
 
 
@@ -1005,12 +1059,6 @@ public abstract class AbstractMilvusGrpcClient implements MilvusClient {
                 return R.success(new RpcStatus("Warning: It is not necessary to build index with index_type: FLAT"));
                 return R.success(new RpcStatus("Warning: It is not necessary to build index with index_type: FLAT"));
             }
             }
 
 
-            // keep consistence behavior with python sdk, flush before creating index
-            FlushRequest flushRequest = FlushRequest.newBuilder()
-                    .addCollectionNames(requestParam.getCollectionName())
-                    .build();
-            blockingStub().flush(flushRequest);
-
             CreateIndexRequest createIndexRequest = createIndexRequestBuilder.setCollectionName(requestParam.getCollectionName())
             CreateIndexRequest createIndexRequest = createIndexRequestBuilder.setCollectionName(requestParam.getCollectionName())
                     .setFieldName(requestParam.getFieldName())
                     .setFieldName(requestParam.getFieldName())
                     .setIndexName(requestParam.getIndexName())
                     .setIndexName(requestParam.getIndexName())
@@ -2047,6 +2095,424 @@ public abstract class AbstractMilvusGrpcClient implements MilvusClient {
         return Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8));
         return Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8));
     }
     }
 
 
+    @Override
+    public R<RpcStatus> addUserToRole(AddUserToRoleParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            OperateUserRoleRequest request = OperateUserRoleRequest.newBuilder()
+                    .setUsername(requestParam.getUserName())
+                    .setRoleName(requestParam.getRoleName())
+                    .setType(OperateUserRoleType.AddUserToRole)
+                    .build();
+
+            Status response = blockingStub().operateUserRole(request);
+            if (response.getErrorCode() != ErrorCode.Success) {
+                return failedStatus("AddUserToRole", response);
+            }
+
+            logDebug("AddUserToRole successfully! Username:{}, RoleName:{}", requestParam.getUserName(), request.getRoleName());
+            return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+        } catch (StatusRuntimeException e) {
+            logError("AddUserToRole RPC failed! Username:{} RoleName:{} \n{}",
+                    requestParam.getUserName(), requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("AddUserToRole failed! Username:{} RoleName:{} \n{}",
+                    requestParam.getUserName(), requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> removeUserFromRole(RemoveUserFromRoleParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            OperateUserRoleRequest request = OperateUserRoleRequest.newBuilder()
+                    .setUsername(requestParam.getUserName())
+                    .setRoleName(requestParam.getRoleName())
+                    .setType(OperateUserRoleType.RemoveUserFromRole)
+                    .build();
+
+            Status response = blockingStub().operateUserRole(request);
+            if (response.getErrorCode() != ErrorCode.Success) {
+                return failedStatus("RemoveUserFromRole", response);
+            }
+
+            logDebug("RemoveUserFromRole successfully! Username:{}, RoleName:{}", requestParam.getUserName(), request.getRoleName());
+            return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+        } catch (StatusRuntimeException e) {
+            logError("RemoveUserFromRole RPC failed! Username:{} RoleName:{} \n{}",
+                    requestParam.getUserName(), requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("RemoveUserFromRole failed! Username:{} RoleName:{} \n{}",
+                    requestParam.getUserName(), requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+
+    public R<RpcStatus> createRole(CreateRoleParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            CreateRoleRequest request = CreateRoleRequest.newBuilder()
+                    .setEntity(RoleEntity.newBuilder()
+                            .setName(requestParam.getRoleName())
+                            .build())
+                    .build();
+
+            Status response = blockingStub().createRole(request);
+            if (response.getErrorCode() != ErrorCode.Success) {
+                return failedStatus("CreateRole", response);
+            }
+            logDebug("CreateRole successfully! RoleName:{}", requestParam.getRoleName());
+            return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+        } catch (StatusRuntimeException e) {
+            logError("CreateRole RPC failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("CreateRole failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+
+    public R<RpcStatus> dropRole(DropRoleParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            DropRoleRequest request = DropRoleRequest.newBuilder()
+                    .setRoleName(requestParam.getRoleName())
+                    .build();
+
+            Status response = blockingStub().dropRole(request);
+            if (response.getErrorCode() != ErrorCode.Success) {
+                return failedStatus("DropRole", response);
+            }
+            logDebug("DropRole successfully! RoleName:{}", requestParam.getRoleName());
+            return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+        } catch (StatusRuntimeException e) {
+            logError("DropRole RPC failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("DropRole failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+
+    public R<SelectRoleResponse> selectRole(SelectRoleParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            SelectRoleRequest request = SelectRoleRequest.newBuilder()
+                    .setRole(RoleEntity.newBuilder()
+                            .setName(requestParam.getRoleName())
+                            .build())
+                    .setIncludeUserInfo(requestParam.isIncludeUserInfo())
+                    .build();
+
+            SelectRoleResponse response = blockingStub().selectRole(request);
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("SelectRole", response.getStatus());
+            }
+            logDebug("SelectRole successfully! RoleName:{}", requestParam.getRoleName());
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("SelectRole RPC failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("SelectRole failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+
+    public R<SelectUserResponse> selectUser(SelectUserParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+        try {
+            SelectUserRequest request = SelectUserRequest.newBuilder()
+                    .setUser(UserEntity.newBuilder().setName(requestParam.getUserName()).build())
+                    .setIncludeRoleInfo(requestParam.isIncludeRoleInfo())
+                    .build();
+
+            SelectUserResponse response = blockingStub().selectUser(request);
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("SelectUser", response.getStatus());
+            }
+            logDebug("SelectUser successfully! Request:{}", requestParam);
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("SelectUser RPC failed! Request:{} \n{}",
+                    requestParam, e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("SelectUser failed! Request:{} \n{}",
+                    requestParam, e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+
+    public R<RpcStatus> grantRolePrivilege(GrantRolePrivilegeParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            OperatePrivilegeRequest request = OperatePrivilegeRequest.newBuilder()
+                    .setType(OperatePrivilegeType.Grant)
+                    .setEntity(GrantEntity.newBuilder()
+                            .setRole(RoleEntity.newBuilder().setName(requestParam.getRoleName()).build())
+                            .setObjectName(requestParam.getObjectName())
+                            .setObject(ObjectEntity.newBuilder().setName(requestParam.getObject()).build())
+                            .setGrantor(GrantorEntity.newBuilder()
+                                    .setPrivilege(PrivilegeEntity.newBuilder().setName(requestParam.getPrivilege()).build()).build())
+                            .build())
+                    .build();
+
+            Status response = blockingStub().operatePrivilege(request);
+            if (response.getErrorCode() != ErrorCode.Success) {
+                return failedStatus("GrantRolePrivilege", response);
+            }
+            logDebug("GrantRolePrivilege successfully! RoleName:{}", requestParam.getRoleName());
+            return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+        } catch (StatusRuntimeException e) {
+            logError("GrantRolePrivilege RPC failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("GrantRolePrivilege failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+    public R<RpcStatus> revokeRolePrivilege(RevokeRolePrivilegeParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+        try {
+            OperatePrivilegeRequest request = OperatePrivilegeRequest.newBuilder()
+                    .setType(OperatePrivilegeType.Revoke)
+                    .setEntity(GrantEntity.newBuilder()
+                            .setRole(RoleEntity.newBuilder().setName(requestParam.getRoleName()).build())
+                            .setObjectName(requestParam.getObjectName())
+                            .setObject(ObjectEntity.newBuilder().setName(requestParam.getObject()).build())
+                            .setGrantor(GrantorEntity.newBuilder()
+                                    .setPrivilege(PrivilegeEntity.newBuilder().setName(requestParam.getPrivilege()).build()).build())
+                            .build())
+                    .build();
+
+            Status response = blockingStub().operatePrivilege(request);
+            if (response.getErrorCode() != ErrorCode.Success) {
+                return failedStatus("RevokeRolePrivilege", response);
+            }
+            logDebug("RevokeRolePrivilege successfully! RoleName:{}", requestParam.getRoleName());
+            return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+        } catch (StatusRuntimeException e) {
+            logError("RevokeRolePrivilege RPC failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("RevokeRolePrivilege failed! RoleName:{} \n{}",
+                    requestParam.getRoleName(), e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+
+    public R<SelectGrantResponse> selectGrantForRole(SelectGrantForRoleParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            SelectGrantRequest request = SelectGrantRequest.newBuilder()
+                    .setEntity(GrantEntity.newBuilder()
+                            .setRole(RoleEntity.newBuilder().setName(requestParam.getRoleName()).build())
+                            .build())
+                    .build();
+
+            SelectGrantResponse response = blockingStub().selectGrant(request);
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("SelectGrant", response.getStatus());
+            }
+            logDebug("SelectGrantForRole successfully! Request:{},", requestParam);
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("SelectGrantForRole RPC failed! Request:{} \n{}",
+                    requestParam, e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("SelectGrantForRole failed! Request:{} \n{}",
+                    requestParam, e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+    public R<SelectGrantResponse> selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+        try {
+            SelectGrantRequest request = SelectGrantRequest.newBuilder()
+                    .setEntity(GrantEntity.newBuilder()
+                            .setRole(RoleEntity.newBuilder().setName(requestParam.getRoleName()).build())
+                            .setObjectName(requestParam.getObjectName())
+                            .setObject(ObjectEntity.newBuilder().setName(requestParam.getObject()).build())
+                            .build())
+                    .build();
+
+            SelectGrantResponse response = blockingStub().selectGrant(request);
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("SelectGrant", response.getStatus());
+            }
+            logDebug("SelectGrantForRoleAndObject successfully! Request:{},", requestParam);
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("SelectGrantForRoleAndObject RPC failed! Request:{} \n{}",
+                    requestParam, e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("SelectGrantForRoleAndObject failed! Request:{} \n{}",
+                    requestParam, e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<ImportResponse> bulkInsert(BulkInsertParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            ImportRequest.Builder importRequest = ImportRequest.newBuilder()
+                    .setCollectionName(requestParam.getCollectionName())
+                    .setRowBased(requestParam.isRowBased())
+                    .addAllFiles(requestParam.getFiles());
+
+            if (StringUtils.isNotEmpty(requestParam.getPartitionName())) {
+                importRequest.setPartitionName(requestParam.getPartitionName());
+            }
+
+            ImportResponse response = blockingStub().import_(importRequest.build());
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("BulkLoadImport", response.getStatus());
+            }
+
+            logDebug("BulkLoadImport successfully!");
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("BulkLoadImport RPC failed! \n{}", e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("BulkLoadImport failed! \n{}", e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<GetImportStateResponse> getBulkInsertState(GetBulkInsertStateParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            GetImportStateRequest getImportStateRequest = GetImportStateRequest.newBuilder()
+                    .setTask(requestParam.getTask())
+                    .build();
+
+            GetImportStateResponse response = blockingStub().getImportState(getImportStateRequest);
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("GetImportState", response.getStatus());
+            }
+
+            logDebug("GetImportState successfully!");
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("GetImportState RPC failed! \n{}", e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("GetImportState failed! \n{}", e.getMessage());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<ListImportTasksResponse> listBulkInsertTasks(ListBulkInsertTasksParam requestParam) {
+        if (!clientIsReady()) {
+            return R.failed(new ClientNotConnectedException("Client rpc channel is not ready"));
+        }
+
+        logInfo(requestParam.toString());
+
+        try {
+            ListImportTasksRequest listImportTasksRequest = ListImportTasksRequest.newBuilder()
+                    .build();
+
+            ListImportTasksResponse response = blockingStub().listImportTasks(listImportTasksRequest);
+            if (response.getStatus().getErrorCode() != ErrorCode.Success) {
+                return failedStatus("ListImportTasks", response.getStatus());
+            }
+
+            logDebug("ListImportTasks successfully!");
+            return R.success(response);
+        } catch (StatusRuntimeException e) {
+            logError("ListImportTasks RPC failed! \n{}", e.getStatus().toString());
+            return R.failed(e);
+        } catch (Exception e) {
+            logError("ListImportTasks failed! \n{}", e.getMessage());
+            return R.failed(e);
+        }
+    }
+
     ///////////////////// Log Functions//////////////////////
     ///////////////////// Log Functions//////////////////////
     private void logDebug(String msg, Object... params) {
     private void logDebug(String msg, Object... params) {
         logger.debug(msg, params);
         logger.debug(msg, params);

+ 160 - 15
src/main/java/io/milvus/client/MilvusClient.java

@@ -19,33 +19,82 @@
 
 
 package io.milvus.client;
 package io.milvus.client;
 
 
+import com.google.common.util.concurrent.ListenableFuture;
 import io.milvus.grpc.*;
 import io.milvus.grpc.*;
 import io.milvus.param.R;
 import io.milvus.param.R;
 import io.milvus.param.RpcStatus;
 import io.milvus.param.RpcStatus;
 import io.milvus.param.alias.AlterAliasParam;
 import io.milvus.param.alias.AlterAliasParam;
 import io.milvus.param.alias.CreateAliasParam;
 import io.milvus.param.alias.CreateAliasParam;
 import io.milvus.param.alias.DropAliasParam;
 import io.milvus.param.alias.DropAliasParam;
-import io.milvus.param.collection.*;
-import io.milvus.param.control.*;
-import io.milvus.param.credential.*;
-import io.milvus.param.dml.*;
-import io.milvus.param.index.*;
-import io.milvus.param.partition.*;
+import io.milvus.param.bulkinsert.GetBulkInsertStateParam;
+import io.milvus.param.bulkinsert.BulkInsertParam;
+import io.milvus.param.bulkinsert.ListBulkInsertTasksParam;
+import io.milvus.param.collection.CreateCollectionParam;
+import io.milvus.param.collection.DescribeCollectionParam;
+import io.milvus.param.collection.DropCollectionParam;
+import io.milvus.param.collection.FlushParam;
+import io.milvus.param.collection.GetCollectionStatisticsParam;
+import io.milvus.param.collection.HasCollectionParam;
+import io.milvus.param.collection.LoadCollectionParam;
+import io.milvus.param.collection.ReleaseCollectionParam;
+import io.milvus.param.collection.ShowCollectionsParam;
+import io.milvus.param.control.GetCompactionPlansParam;
+import io.milvus.param.control.GetCompactionStateParam;
+import io.milvus.param.control.GetFlushStateParam;
+import io.milvus.param.control.GetMetricsParam;
+import io.milvus.param.control.GetPersistentSegmentInfoParam;
+import io.milvus.param.control.GetQuerySegmentInfoParam;
+import io.milvus.param.control.GetReplicasParam;
+import io.milvus.param.control.LoadBalanceParam;
+import io.milvus.param.control.ManualCompactParam;
+import io.milvus.param.credential.CreateCredentialParam;
+import io.milvus.param.credential.DeleteCredentialParam;
+import io.milvus.param.credential.ListCredUsersParam;
+import io.milvus.param.credential.UpdateCredentialParam;
+import io.milvus.param.dml.DeleteParam;
+import io.milvus.param.dml.InsertParam;
+import io.milvus.param.dml.QueryParam;
+import io.milvus.param.dml.SearchParam;
+import io.milvus.param.index.CreateIndexParam;
+import io.milvus.param.index.DescribeIndexParam;
+import io.milvus.param.index.DropIndexParam;
+import io.milvus.param.index.GetIndexBuildProgressParam;
+import io.milvus.param.index.GetIndexStateParam;
+import io.milvus.param.partition.CreatePartitionParam;
+import io.milvus.param.partition.DropPartitionParam;
+import io.milvus.param.partition.GetPartitionStatisticsParam;
+import io.milvus.param.partition.HasPartitionParam;
+import io.milvus.param.partition.LoadPartitionsParam;
+import io.milvus.param.partition.ReleasePartitionsParam;
+import io.milvus.param.partition.ShowPartitionsParam;
+import io.milvus.param.role.AddUserToRoleParam;
+import io.milvus.param.role.CreateRoleParam;
+import io.milvus.param.role.DropRoleParam;
+import io.milvus.param.role.GrantRolePrivilegeParam;
+import io.milvus.param.role.RemoveUserFromRoleParam;
+import io.milvus.param.role.RevokeRolePrivilegeParam;
+import io.milvus.param.role.SelectGrantForRoleAndObjectParam;
+import io.milvus.param.role.SelectGrantForRoleParam;
+import io.milvus.param.role.SelectUserParam;
+import io.milvus.param.role.SelectRoleParam;
 
 
-import com.google.common.util.concurrent.ListenableFuture;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 
 
-/** The Milvus Client Interface */
+/**
+ * The Milvus Client Interface
+ */
 public interface MilvusClient {
 public interface MilvusClient {
     /**
     /**
      * Timeout setting for rpc call.
      * Timeout setting for rpc call.
      *
      *
-     * @param timeout set time waiting for a rpc call.
+     * @param timeout     set time waiting for a rpc call.
      * @param timeoutUnit time unit
      * @param timeoutUnit time unit
      */
      */
     MilvusClient withTimeout(long timeout, TimeUnit timeoutUnit);
     MilvusClient withTimeout(long timeout, TimeUnit timeoutUnit);
 
 
-    /** Disconnects from a Milvus server with timeout of 1 minute */
+    /**
+     * Disconnects from a Milvus server with timeout of 1 minute
+     */
     default void close() {
     default void close() {
         try {
         try {
             close(TimeUnit.MINUTES.toSeconds(1));
             close(TimeUnit.MINUTES.toSeconds(1));
@@ -94,7 +143,7 @@ public interface MilvusClient {
     R<RpcStatus> loadCollection(LoadCollectionParam requestParam);
     R<RpcStatus> loadCollection(LoadCollectionParam requestParam);
 
 
     /**
     /**
-     * Releases a collection from memory to reduce memory usage. Note that you 
+     * Releases a collection from memory to reduce memory usage. Note that you
      * cannot search while the corresponding collection is released from memory.
      * cannot search while the corresponding collection is released from memory.
      *
      *
      * @param requestParam {@link ReleaseCollectionParam}
      * @param requestParam {@link ReleaseCollectionParam}
@@ -143,7 +192,7 @@ public interface MilvusClient {
     R<RpcStatus> createPartition(CreatePartitionParam requestParam);
     R<RpcStatus> createPartition(CreatePartitionParam requestParam);
 
 
     /**
     /**
-     * Drops a partition. Note that this method drops all data in this partition 
+     * Drops a partition. Note that this method drops all data in this partition
      * and the _default partition cannot be dropped.
      * and the _default partition cannot be dropped.
      *
      *
      * @param requestParam {@link DropPartitionParam}
      * @param requestParam {@link DropPartitionParam}
@@ -234,7 +283,7 @@ public interface MilvusClient {
     R<RpcStatus> dropIndex(DropIndexParam requestParam);
     R<RpcStatus> dropIndex(DropIndexParam requestParam);
 
 
     /**
     /**
-     * Shows the information of the specified index. Current release of Milvus 
+     * Shows the information of the specified index. Current release of Milvus
      * only supports showing latest built index.
      * only supports showing latest built index.
      *
      *
      * @param requestParam {@link DescribeIndexParam}
      * @param requestParam {@link DescribeIndexParam}
@@ -277,7 +326,7 @@ public interface MilvusClient {
     ListenableFuture<R<MutationResult>> insertAsync(InsertParam requestParam);
     ListenableFuture<R<MutationResult>> insertAsync(InsertParam requestParam);
 
 
     /**
     /**
-     * Deletes entity(s) based on primary key(s) filtered by boolean expression. Current release 
+     * Deletes entity(s) based on primary key(s) filtered by boolean expression. Current release
      * of Milvus only supports expression in the format "pk_field in [1, 2, ...]"
      * of Milvus only supports expression in the format "pk_field in [1, 2, ...]"
      *
      *
      * @param requestParam {@link DeleteParam}
      * @param requestParam {@link DeleteParam}
@@ -326,7 +375,7 @@ public interface MilvusClient {
     ListenableFuture<R<SearchResults>> searchAsync(SearchParam requestParam);
     ListenableFuture<R<SearchResults>> searchAsync(SearchParam requestParam);
 
 
     /**
     /**
-     * Queries entity(s) based on scalar field(s) filtered by boolean expression. 
+     * Queries entity(s) based on scalar field(s) filtered by boolean expression.
      * Note that the order of the returned entities cannot be guaranteed.
      * Note that the order of the returned entities cannot be guaranteed.
      *
      *
      * @param requestParam {@link QueryParam}
      * @param requestParam {@link QueryParam}
@@ -459,4 +508,100 @@ public interface MilvusClient {
      * @return {status:result code, data:ListCredUsersResponse{status,info}}
      * @return {status:result code, data:ListCredUsersResponse{status,info}}
      */
      */
     R<ListCredUsersResponse> listCredUsers(ListCredUsersParam requestParam);
     R<ListCredUsersResponse> listCredUsers(ListCredUsersParam requestParam);
+
+
+    /**
+     * It will success if the role isn't existed, otherwise fail.
+     *
+     * @param requestParam {@link CreateRoleParam}
+     * @return {status:result code, data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> createRole(CreateRoleParam requestParam);
+
+
+    /**
+     * It will success if the role is existed, otherwise fail.
+     *
+     * @param requestParam {@link DropRoleParam}
+     * @return {status:result code, data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> dropRole(DropRoleParam requestParam);
+
+
+    /**
+     * The user will get permissions that the role are allowed to perform operations.
+     *
+     * @param requestParam {@link AddUserToRoleParam}
+     * @return {status:result code, data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> addUserToRole(AddUserToRoleParam requestParam);
+
+
+    /**
+     * The user will remove permissions that the role are allowed to perform operations.
+     *
+     * @param requestParam {@link AddUserToRoleParam}
+     * @return {status:result code, data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> removeUserFromRole(RemoveUserFromRoleParam requestParam);
+
+
+    /**
+     * Get all users who are added to the role.
+     *
+     * @param requestParam {@link SelectRoleParam}
+     * @return {status:result code, data:SelectRoleResponse{status,info}}
+     */
+    R<SelectRoleResponse> selectRole(SelectRoleParam requestParam);
+
+
+    /**
+     * Get all roles the user has.
+     *
+     * @param requestParam {@link SelectUserParam}
+     * @return {status:result code, data:SelectUserResponse{status,info}}
+     */
+    R<SelectUserResponse> selectUser(SelectUserParam requestParam);
+
+
+    /**
+     * Grant Role Privilege.
+     *
+     * @param requestParam {@link GrantRolePrivilegeParam}
+     * @return {status:result code, data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> grantRolePrivilege(GrantRolePrivilegeParam requestParam);
+
+
+    /**
+     * Revoke Role Privilege.
+     *
+     * @param requestParam {@link RevokeRolePrivilegeParam}
+     * @return {status:result code, data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> revokeRolePrivilege(RevokeRolePrivilegeParam requestParam);
+
+
+    /**
+     * List a grant info for the role and the specific object
+     *
+     * @param requestParam {@link SelectGrantForRoleParam}
+     * @return {status:result code, data:SelectRoleResponse{status,info}}
+     */
+    R<SelectGrantResponse> selectGrantForRole(SelectGrantForRoleParam requestParam);
+
+
+    /**
+     * List a grant info for the role
+     *
+     * @param requestParam {@link SelectGrantForRoleAndObjectParam}
+     * @return {status:result code, data:SelectRoleResponse{status,info}}
+     */
+    R<SelectGrantResponse> selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam requestParam);
+
+    R<ImportResponse> bulkInsert(BulkInsertParam requestParam);
+
+    R<GetImportStateResponse> getBulkInsertState(GetBulkInsertStateParam requestParam);
+
+    R<ListImportTasksResponse> listBulkInsertTasks(ListBulkInsertTasksParam requestParam);
 }
 }

+ 121 - 7
src/main/java/io/milvus/client/MilvusMultiServiceClient.java

@@ -23,16 +23,65 @@ import com.google.common.util.concurrent.ListenableFuture;
 import io.milvus.connection.ClusterFactory;
 import io.milvus.connection.ClusterFactory;
 import io.milvus.connection.ServerSetting;
 import io.milvus.connection.ServerSetting;
 import io.milvus.grpc.*;
 import io.milvus.grpc.*;
-import io.milvus.param.*;
+import io.milvus.param.ConnectParam;
+import io.milvus.param.MultiConnectParam;
+import io.milvus.param.R;
+import io.milvus.param.RpcStatus;
+import io.milvus.param.ServerAddress;
 import io.milvus.param.alias.AlterAliasParam;
 import io.milvus.param.alias.AlterAliasParam;
 import io.milvus.param.alias.CreateAliasParam;
 import io.milvus.param.alias.CreateAliasParam;
 import io.milvus.param.alias.DropAliasParam;
 import io.milvus.param.alias.DropAliasParam;
-import io.milvus.param.collection.*;
-import io.milvus.param.control.*;
-import io.milvus.param.credential.*;
-import io.milvus.param.dml.*;
-import io.milvus.param.index.*;
-import io.milvus.param.partition.*;
+import io.milvus.param.bulkinsert.GetBulkInsertStateParam;
+import io.milvus.param.bulkinsert.BulkInsertParam;
+import io.milvus.param.bulkinsert.ListBulkInsertTasksParam;
+import io.milvus.param.collection.CreateCollectionParam;
+import io.milvus.param.collection.DescribeCollectionParam;
+import io.milvus.param.collection.DropCollectionParam;
+import io.milvus.param.collection.FlushParam;
+import io.milvus.param.collection.GetCollectionStatisticsParam;
+import io.milvus.param.collection.HasCollectionParam;
+import io.milvus.param.collection.LoadCollectionParam;
+import io.milvus.param.collection.ReleaseCollectionParam;
+import io.milvus.param.collection.ShowCollectionsParam;
+import io.milvus.param.control.GetCompactionPlansParam;
+import io.milvus.param.control.GetCompactionStateParam;
+import io.milvus.param.control.GetFlushStateParam;
+import io.milvus.param.control.GetMetricsParam;
+import io.milvus.param.control.GetPersistentSegmentInfoParam;
+import io.milvus.param.control.GetQuerySegmentInfoParam;
+import io.milvus.param.control.GetReplicasParam;
+import io.milvus.param.control.LoadBalanceParam;
+import io.milvus.param.control.ManualCompactParam;
+import io.milvus.param.credential.CreateCredentialParam;
+import io.milvus.param.credential.DeleteCredentialParam;
+import io.milvus.param.credential.ListCredUsersParam;
+import io.milvus.param.credential.UpdateCredentialParam;
+import io.milvus.param.dml.DeleteParam;
+import io.milvus.param.dml.InsertParam;
+import io.milvus.param.dml.QueryParam;
+import io.milvus.param.dml.SearchParam;
+import io.milvus.param.index.CreateIndexParam;
+import io.milvus.param.index.DescribeIndexParam;
+import io.milvus.param.index.DropIndexParam;
+import io.milvus.param.index.GetIndexBuildProgressParam;
+import io.milvus.param.index.GetIndexStateParam;
+import io.milvus.param.partition.CreatePartitionParam;
+import io.milvus.param.partition.DropPartitionParam;
+import io.milvus.param.partition.GetPartitionStatisticsParam;
+import io.milvus.param.partition.HasPartitionParam;
+import io.milvus.param.partition.LoadPartitionsParam;
+import io.milvus.param.partition.ReleasePartitionsParam;
+import io.milvus.param.partition.ShowPartitionsParam;
+import io.milvus.param.role.AddUserToRoleParam;
+import io.milvus.param.role.CreateRoleParam;
+import io.milvus.param.role.DropRoleParam;
+import io.milvus.param.role.GrantRolePrivilegeParam;
+import io.milvus.param.role.RemoveUserFromRoleParam;
+import io.milvus.param.role.RevokeRolePrivilegeParam;
+import io.milvus.param.role.SelectGrantForRoleAndObjectParam;
+import io.milvus.param.role.SelectGrantForRoleParam;
+import io.milvus.param.role.SelectUserParam;
+import io.milvus.param.role.SelectRoleParam;
 import lombok.NonNull;
 import lombok.NonNull;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
 
 
@@ -402,6 +451,71 @@ public class MilvusMultiServiceClient implements MilvusClient {
         return this.clusterFactory.getMaster().getClient().listCredUsers(requestParam);
         return this.clusterFactory.getMaster().getClient().listCredUsers(requestParam);
     }
     }
 
 
+    @Override
+    public R<RpcStatus> createRole(CreateRoleParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().createRole(requestParam);
+    }
+
+    @Override
+    public R<RpcStatus> dropRole(DropRoleParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().dropRole(requestParam);
+    }
+
+    @Override
+    public R<RpcStatus> addUserToRole(AddUserToRoleParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().addUserToRole(requestParam);
+    }
+
+    @Override
+    public R<RpcStatus> removeUserFromRole(RemoveUserFromRoleParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().removeUserFromRole(requestParam);
+    }
+
+    @Override
+    public R<SelectRoleResponse> selectRole(SelectRoleParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().selectRole(requestParam);
+    }
+
+    @Override
+    public R<SelectUserResponse> selectUser(SelectUserParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().selectUser(requestParam);
+    }
+
+    @Override
+    public R<RpcStatus> grantRolePrivilege(GrantRolePrivilegeParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().grantRolePrivilege(requestParam);
+    }
+
+    @Override
+    public R<RpcStatus> revokeRolePrivilege(RevokeRolePrivilegeParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().revokeRolePrivilege(requestParam);
+    }
+
+    @Override
+    public R<SelectGrantResponse> selectGrantForRole(SelectGrantForRoleParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().selectGrantForRole(requestParam);
+    }
+
+    @Override
+    public R<SelectGrantResponse> selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().selectGrantForRoleAndObject(requestParam);
+    }
+
+    @Override
+    public R<ImportResponse> bulkInsert(BulkInsertParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().bulkInsert(requestParam);
+    }
+
+    @Override
+    public R<GetImportStateResponse> getBulkInsertState(GetBulkInsertStateParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().getBulkInsertState(requestParam);
+    }
+
+    @Override
+    public R<ListImportTasksResponse> listBulkInsertTasks(ListBulkInsertTasksParam requestParam) {
+        return this.clusterFactory.getMaster().getClient().listBulkInsertTasks(requestParam);
+    }
+
     private <T> R<T> handleResponse(List<R<T>> response) {
     private <T> R<T> handleResponse(List<R<T>> response) {
         if (CollectionUtils.isNotEmpty(response)) {
         if (CollectionUtils.isNotEmpty(response)) {
             R<T> rSuccess = null;
             R<T> rSuccess = null;

+ 1 - 1
src/main/java/io/milvus/common/clientenum/ConsistencyLevelEnum.java

@@ -23,7 +23,7 @@ public enum ConsistencyLevelEnum {
 
 
     private static final ConsistencyLevelEnum[] CONSISTENCY_LEVELS = new ConsistencyLevelEnum[values().length];
     private static final ConsistencyLevelEnum[] CONSISTENCY_LEVELS = new ConsistencyLevelEnum[values().length];
 
 
-    private static ConsistencyLevelEnum getNameByCode(int code) {
+    public static ConsistencyLevelEnum getNameByCode(int code) {
         if (code >= 0 && code < CONSISTENCY_LEVELS.length) {
         if (code >= 0 && code < CONSISTENCY_LEVELS.length) {
             return CONSISTENCY_LEVELS[code];
             return CONSISTENCY_LEVELS[code];
         }
         }

+ 2 - 0
src/main/java/io/milvus/param/IndexType.java

@@ -34,6 +34,8 @@ public enum IndexType {
     RHNSW_FLAT,
     RHNSW_FLAT,
     RHNSW_PQ,
     RHNSW_PQ,
     RHNSW_SQ,
     RHNSW_SQ,
+    DISKANN,
+    AUTOINDEX,
     //Only supported for binary vectors
     //Only supported for binary vectors
     BIN_FLAT,
     BIN_FLAT,
     BIN_IVF_FLAT,
     BIN_IVF_FLAT,

+ 156 - 0
src/main/java/io/milvus/param/bulkinsert/BulkInsertParam.java

@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package io.milvus.param.bulkinsert;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Parameters for <code>bulkInsert</code> interface.
+ */
+@Getter
+public class BulkInsertParam {
+    private final String collectionName;
+    private final String partitionName;
+    private final boolean rowBased;
+    private final List<String> files;
+
+    private BulkInsertParam(@NonNull Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionName = builder.partitionName;
+        this.rowBased = builder.rowBased;
+        this.files = builder.files;
+    }
+
+    public static Builder newBuilder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder for {@link BulkInsertParam} class.
+     */
+    public static final class Builder {
+        private String collectionName;
+        private String partitionName;
+        private Boolean rowBased = false;
+        private final List<String> files = new ArrayList<>();
+        private Builder() {
+        }
+
+        /**
+         * Sets the collection name. Collection name cannot be empty or null.
+         *
+         * @param collectionName collection name
+         * @return <code>Builder</code>
+         */
+        public Builder withCollectionName(@NonNull String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        /**
+         * Sets the partition name. partition name can be null.
+         *
+         * @param partitionName partition name
+         * @return <code>Builder</code>
+         */
+        public Builder withPartitionName(String partitionName) {
+            this.partitionName = partitionName;
+            return this;
+        }
+
+        /**
+         * Sets the file description. The description can be empty. The default is false.
+         *
+         * @param rowBased description of the file
+         * @return <code>Builder</code>
+         */
+        public Builder withRowBased(@NonNull Boolean rowBased) {
+            this.rowBased = rowBased;
+            return this;
+        }
+
+        /**
+         * Sets the path of the files. The files cannot be empty or null.
+         *
+         * @param files a <code>List</code> of {@link String}
+         * @return <code>Builder</code>
+         */
+        public Builder withFiles(@NonNull List<String> files) {
+            this.files.addAll(files);
+            return this;
+        }
+
+        /**
+         * Adds a file path.
+         * @see String
+         *
+         * @param file a {@link String}
+         * @return <code>Builder</code>
+         */
+        public Builder addFile(@NonNull String file) {
+            this.files.add(file);
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link BulkInsertParam} instance.
+         *
+         * @return {@link BulkInsertParam}
+         */
+        public BulkInsertParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
+
+
+            if (files.isEmpty()) {
+                throw new ParamException("Field numbers must be larger than 0");
+            }
+
+            for (String file : files) {
+                if (StringUtils.isEmpty(file)) {
+                    throw new ParamException("file field cannot be empty");
+                }
+            }
+
+            return new BulkInsertParam(this);
+        }
+    }
+
+    /**
+     * Constructs a <code>String</code> by {@link BulkInsertParam} instance.
+     *
+     * @return <code>String</code>
+     */
+    @Override
+    public String toString() {
+        return "BulkInsertParam{" +
+                "collectionName='" + collectionName + '\'' +
+                ", partitionName=" + partitionName +
+                ", rowBased='" + rowBased + '\'' +
+                ", files=" + files.toString() +
+                '}';
+    }
+}

+ 83 - 0
src/main/java/io/milvus/param/bulkinsert/GetBulkInsertStateParam.java

@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package io.milvus.param.bulkinsert;
+
+import io.milvus.exception.ParamException;
+import lombok.Getter;
+import lombok.NonNull;
+
+/**
+ * Parameters for <code>getBulkInsertState</code> interface.
+ */
+@Getter
+public class GetBulkInsertStateParam {
+    private final Long task;
+
+    private GetBulkInsertStateParam(@NonNull Builder builder) {
+        this.task = builder.task;
+    }
+
+    public static Builder newBuilder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder for {@link GetBulkInsertStateParam} class.
+     */
+    public static final class Builder {
+        private Long task;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the task id. task cannot be empty or null.
+         *
+         * @param task task id
+         * @return <code>Builder</code>
+         */
+        public Builder withTask(@NonNull Long task) {
+            this.task = task;
+            return this;
+        }
+
+
+        /**
+         * Verifies parameters and creates a new {@link GetBulkInsertStateParam} instance.
+         *
+         * @return {@link GetBulkInsertStateParam}
+         */
+        public GetBulkInsertStateParam build() throws ParamException {
+            return new GetBulkInsertStateParam(this);
+        }
+    }
+
+    /**
+     * Constructs a <code>String</code> by {@link GetBulkInsertStateParam} instance.
+     *
+     * @return <code>String</code>
+     */
+    @Override
+    public String toString() {
+        return "GetBulkInsertStateParam{" +
+                "task='" + task + '\'' +
+                '}';
+    }
+}

+ 65 - 0
src/main/java/io/milvus/param/bulkinsert/ListBulkInsertTasksParam.java

@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package io.milvus.param.bulkinsert;
+
+import io.milvus.exception.ParamException;
+import lombok.Getter;
+
+/**
+ * Parameters for <code>listBulkInsertTasks</code> interface.
+ */
+@Getter
+public class ListBulkInsertTasksParam {
+
+    private ListBulkInsertTasksParam() {
+    }
+
+    public static Builder newBuilder() {
+        return new Builder();
+    }
+
+    /**
+     * Builder for {@link ListBulkInsertTasksParam} class.
+     */
+    public static final class Builder {
+        private Builder() {
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link ListBulkInsertTasksParam} instance.
+         *
+         * @return {@link ListBulkInsertTasksParam}
+         */
+        public ListBulkInsertTasksParam build() throws ParamException {
+            return new ListBulkInsertTasksParam();
+        }
+    }
+
+    /**
+     * Constructs a <code>String</code> by {@link ListBulkInsertTasksParam} instance.
+     *
+     * @return <code>String</code>
+     */
+    @Override
+    public String toString() {
+        return "ListBulkInsertTasksParam{" +
+                '}';
+    }
+}

+ 11 - 0
src/main/java/io/milvus/param/collection/ShowCollectionsParam.java

@@ -69,6 +69,17 @@ public class ShowCollectionsParam {
             return this;
             return this;
         }
         }
 
 
+        /**
+         * Sets a show type. Show Type can be empty or null, default value is ShowType.All.
+         *
+         * @param showType ShowType
+         * @return <code>Builder</code>
+         */
+        public Builder withShowType(ShowType showType) {
+            this.showType = showType;
+            return this;
+        }
+
         /**
         /**
          * Adds a collection name. Collection name cannot be empty or null.
          * Adds a collection name. Collection name cannot be empty or null.
          *
          *

+ 70 - 0
src/main/java/io/milvus/param/role/AddUserToRoleParam.java

@@ -0,0 +1,70 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class AddUserToRoleParam {
+    private final String userName;
+
+    private final String roleName;
+
+    private AddUserToRoleParam(@NonNull AddUserToRoleParam.Builder builder) {
+        this.userName = builder.userName;
+        this.roleName = builder.roleName;
+    }
+
+    public static AddUserToRoleParam.Builder newBuilder() {
+        return new AddUserToRoleParam.Builder();
+    }
+
+    /**
+     * Builder for {@link AddUserToRoleParam} class.
+     */
+    public static final class Builder {
+        private String userName;
+        private String roleName;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the username. UserName cannot be empty or null.
+         *
+         * @param userName userName
+         * @return <code>Builder</code>
+         */
+        public AddUserToRoleParam.Builder withUserName(@NonNull String userName) {
+            this.userName = userName;
+            return this;
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public AddUserToRoleParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link AddUserToRoleParam} instance.
+         *
+         * @return {@link AddUserToRoleParam}
+         */
+        public AddUserToRoleParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(userName, "UserName");
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+
+            return new AddUserToRoleParam(this);
+        }
+    }
+
+}

+ 55 - 0
src/main/java/io/milvus/param/role/CreateRoleParam.java

@@ -0,0 +1,55 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class CreateRoleParam {
+
+    private final String roleName;
+
+    private CreateRoleParam(@NonNull CreateRoleParam.Builder builder) {
+        this.roleName = builder.roleName;
+    }
+
+    public static CreateRoleParam.Builder newBuilder() {
+        return new CreateRoleParam.Builder();
+    }
+
+    /**
+     * Builder for {@link CreateRoleParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public CreateRoleParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link CreateRoleParam} instance.
+         *
+         * @return {@link CreateRoleParam}
+         */
+        public CreateRoleParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+
+            return new CreateRoleParam(this);
+        }
+    }
+
+}

+ 55 - 0
src/main/java/io/milvus/param/role/DropRoleParam.java

@@ -0,0 +1,55 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class DropRoleParam {
+
+    private final String roleName;
+
+    private DropRoleParam(@NonNull DropRoleParam.Builder builder) {
+        this.roleName = builder.roleName;
+    }
+
+    public static DropRoleParam.Builder newBuilder() {
+        return new DropRoleParam.Builder();
+    }
+
+    /**
+     * Builder for {@link DropRoleParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public DropRoleParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link DropRoleParam} instance.
+         *
+         * @return {@link DropRoleParam}
+         */
+        public DropRoleParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+
+            return new DropRoleParam(this);
+        }
+    }
+
+}

+ 104 - 0
src/main/java/io/milvus/param/role/GrantRolePrivilegeParam.java

@@ -0,0 +1,104 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class GrantRolePrivilegeParam {
+
+    private final String roleName;
+
+    private final String object;
+
+    private final String objectName;
+
+    private final String privilege;
+
+    private GrantRolePrivilegeParam(@NonNull GrantRolePrivilegeParam.Builder builder) {
+        this.roleName = builder.roleName;
+        this.object = builder.object;
+        this.objectName = builder.objectName;
+        this.privilege = builder.privilege;
+    }
+
+    public static GrantRolePrivilegeParam.Builder newBuilder() {
+        return new GrantRolePrivilegeParam.Builder();
+    }
+
+    /**
+     * Builder for {@link GrantRolePrivilegeParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+        private String object;
+        private String objectName;
+        private String privilege;
+
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public GrantRolePrivilegeParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Sets the object. object cannot be empty or null.
+         *
+         * @param object object
+         * @return <code>Builder</code>
+         */
+        public GrantRolePrivilegeParam.Builder withObject(@NonNull String object) {
+            this.object = object;
+            return this;
+        }
+
+        /**
+         * Sets the objectName. objectName cannot be empty or null.
+         *
+         * @param objectName objectName
+         * @return <code>Builder</code>
+         */
+        public GrantRolePrivilegeParam.Builder withObjectName(@NonNull String objectName) {
+            this.objectName = objectName;
+            return this;
+        }
+
+        /**
+         * Sets the privilege. privilege cannot be empty or null.
+         *
+         * @param privilege privilege
+         * @return <code>Builder</code>
+         */
+        public GrantRolePrivilegeParam.Builder withPrivilege(@NonNull String privilege) {
+            this.privilege = privilege;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link GrantRolePrivilegeParam} instance.
+         *
+         * @return {@link GrantRolePrivilegeParam}
+         */
+        public GrantRolePrivilegeParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+            ParamUtils.CheckNullEmptyString(object, "Object");
+            ParamUtils.CheckNullEmptyString(objectName, "ObjectName");
+            ParamUtils.CheckNullEmptyString(privilege, "Privilege");
+
+            return new GrantRolePrivilegeParam(this);
+        }
+    }
+
+}

+ 70 - 0
src/main/java/io/milvus/param/role/RemoveUserFromRoleParam.java

@@ -0,0 +1,70 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class RemoveUserFromRoleParam {
+    private final String userName;
+
+    private final String roleName;
+
+    private RemoveUserFromRoleParam(@NonNull RemoveUserFromRoleParam.Builder builder) {
+        this.userName = builder.userName;
+        this.roleName = builder.roleName;
+    }
+
+    public static RemoveUserFromRoleParam.Builder newBuilder() {
+        return new RemoveUserFromRoleParam.Builder();
+    }
+
+    /**
+     * Builder for {@link RemoveUserFromRoleParam} class.
+     */
+    public static final class Builder {
+        private String userName;
+        private String roleName;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the username. UserName cannot be empty or null.
+         *
+         * @param userName userName
+         * @return <code>Builder</code>
+         */
+        public RemoveUserFromRoleParam.Builder withUserName(@NonNull String userName) {
+            this.userName = userName;
+            return this;
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public RemoveUserFromRoleParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link RemoveUserFromRoleParam} instance.
+         *
+         * @return {@link RemoveUserFromRoleParam}
+         */
+        public RemoveUserFromRoleParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(userName, "UserName");
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+
+            return new RemoveUserFromRoleParam(this);
+        }
+    }
+
+}

+ 104 - 0
src/main/java/io/milvus/param/role/RevokeRolePrivilegeParam.java

@@ -0,0 +1,104 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class RevokeRolePrivilegeParam {
+
+    private final String roleName;
+
+    private final String object;
+
+    private final String objectName;
+
+    private final String privilege;
+
+    private RevokeRolePrivilegeParam(@NonNull RevokeRolePrivilegeParam.Builder builder) {
+        this.roleName = builder.roleName;
+        this.object = builder.object;
+        this.objectName = builder.objectName;
+        this.privilege = builder.privilege;
+    }
+
+    public static RevokeRolePrivilegeParam.Builder newBuilder() {
+        return new RevokeRolePrivilegeParam.Builder();
+    }
+
+    /**
+     * Builder for {@link RevokeRolePrivilegeParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+        private String object;
+        private String objectName;
+        private String privilege;
+
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public RevokeRolePrivilegeParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Sets the object. object cannot be empty or null.
+         *
+         * @param object object
+         * @return <code>Builder</code>
+         */
+        public RevokeRolePrivilegeParam.Builder withObject(@NonNull String object) {
+            this.object = object;
+            return this;
+        }
+
+        /**
+         * Sets the objectName. objectName cannot be empty or null.
+         *
+         * @param objectName objectName
+         * @return <code>Builder</code>
+         */
+        public RevokeRolePrivilegeParam.Builder withObjectName(@NonNull String objectName) {
+            this.objectName = objectName;
+            return this;
+        }
+
+        /**
+         * Sets the privilege. privilege cannot be empty or null.
+         *
+         * @param privilege privilege
+         * @return <code>Builder</code>
+         */
+        public RevokeRolePrivilegeParam.Builder withPrivilege(@NonNull String privilege) {
+            this.privilege = privilege;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link RevokeRolePrivilegeParam} instance.
+         *
+         * @return {@link RevokeRolePrivilegeParam}
+         */
+        public RevokeRolePrivilegeParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+            ParamUtils.CheckNullEmptyString(object, "Object");
+            ParamUtils.CheckNullEmptyString(objectName, "ObjectName");
+            ParamUtils.CheckNullEmptyString(privilege, "Privilege");
+
+            return new RevokeRolePrivilegeParam(this);
+        }
+    }
+
+}

+ 88 - 0
src/main/java/io/milvus/param/role/SelectGrantForRoleAndObjectParam.java

@@ -0,0 +1,88 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class SelectGrantForRoleAndObjectParam {
+
+    private final String roleName;
+
+    private final String object;
+
+    private final String objectName;
+
+    private SelectGrantForRoleAndObjectParam(@NonNull SelectGrantForRoleAndObjectParam.Builder builder) {
+        this.roleName = builder.roleName;
+        this.object = builder.object;
+        this.objectName = builder.objectName;
+    }
+
+    public static SelectGrantForRoleAndObjectParam.Builder newBuilder() {
+        return new SelectGrantForRoleAndObjectParam.Builder();
+    }
+
+    /**
+     * Builder for {@link SelectGrantForRoleAndObjectParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+        private String object;
+        private String objectName;
+
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public SelectGrantForRoleAndObjectParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Sets the object. object cannot be empty or null.
+         *
+         * @param object object
+         * @return <code>Builder</code>
+         */
+        public SelectGrantForRoleAndObjectParam.Builder withObject(@NonNull String object) {
+            this.object = object;
+            return this;
+        }
+
+        /**
+         * Sets the objectName. objectName cannot be empty or null.
+         *
+         * @param objectName objectName
+         * @return <code>Builder</code>
+         */
+        public SelectGrantForRoleAndObjectParam.Builder withObjectName(@NonNull String objectName) {
+            this.objectName = objectName;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link SelectGrantForRoleAndObjectParam} instance.
+         *
+         * @return {@link SelectGrantForRoleAndObjectParam}
+         */
+        public SelectGrantForRoleAndObjectParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+            ParamUtils.CheckNullEmptyString(object, "Object");
+            ParamUtils.CheckNullEmptyString(objectName, "ObjectName");
+
+            return new SelectGrantForRoleAndObjectParam(this);
+        }
+    }
+
+}

+ 55 - 0
src/main/java/io/milvus/param/role/SelectGrantForRoleParam.java

@@ -0,0 +1,55 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class SelectGrantForRoleParam {
+
+    private final String roleName;
+
+    private SelectGrantForRoleParam(@NonNull SelectGrantForRoleParam.Builder builder) {
+        this.roleName = builder.roleName;
+    }
+
+    public static SelectGrantForRoleParam.Builder newBuilder() {
+        return new SelectGrantForRoleParam.Builder();
+    }
+
+    /**
+     * Builder for {@link SelectGrantForRoleParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public SelectGrantForRoleParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link SelectGrantForRoleParam} instance.
+         *
+         * @return {@link SelectGrantForRoleParam}
+         */
+        public SelectGrantForRoleParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+
+            return new SelectGrantForRoleParam(this);
+        }
+    }
+
+}

+ 69 - 0
src/main/java/io/milvus/param/role/SelectRoleParam.java

@@ -0,0 +1,69 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class SelectRoleParam {
+
+    private final String roleName;
+    private final boolean includeUserInfo;
+
+    private SelectRoleParam(@NonNull SelectRoleParam.Builder builder) {
+        this.roleName = builder.roleName;
+        this.includeUserInfo = builder.includeUserInfo;
+    }
+
+    public static SelectRoleParam.Builder newBuilder() {
+        return new SelectRoleParam.Builder();
+    }
+
+    /**
+     * Builder for {@link SelectRoleParam} class.
+     */
+    public static final class Builder {
+        private String roleName;
+        private boolean includeUserInfo;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the roleName. RoleName cannot be empty or null.
+         *
+         * @param roleName roleName
+         * @return <code>Builder</code>
+         */
+        public SelectRoleParam.Builder withRoleName(@NonNull String roleName) {
+            this.roleName = roleName;
+            return this;
+        }
+
+        /**
+         * Sets the includeUserInfo. includeUserInfo default false.
+         *
+         * @param includeUserInfo includeUserInfo
+         * @return <code>Builder</code>
+         */
+        public SelectRoleParam.Builder withIncludeUserInfo(boolean includeUserInfo) {
+            this.includeUserInfo = includeUserInfo;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link SelectRoleParam} instance.
+         *
+         * @return {@link SelectRoleParam}
+         */
+        public SelectRoleParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(roleName, "RoleName");
+
+            return new SelectRoleParam(this);
+        }
+    }
+
+}

+ 70 - 0
src/main/java/io/milvus/param/role/SelectUserParam.java

@@ -0,0 +1,70 @@
+package io.milvus.param.role;
+
+import io.milvus.exception.ParamException;
+import io.milvus.param.ParamUtils;
+import lombok.Getter;
+import lombok.NonNull;
+import lombok.ToString;
+
+@Getter
+@ToString
+public class SelectUserParam {
+
+    private final String userName;
+
+    private final boolean includeRoleInfo;
+
+    private SelectUserParam(@NonNull SelectUserParam.Builder builder) {
+        this.userName = builder.userName;
+        this.includeRoleInfo = builder.includeRoleInfo;
+    }
+
+    public static SelectUserParam.Builder newBuilder() {
+        return new SelectUserParam.Builder();
+    }
+
+    /**
+     * Builder for {@link SelectUserParam} class.
+     */
+    public static final class Builder {
+        private String userName;
+        private boolean includeRoleInfo;
+
+        private Builder() {
+        }
+
+        /**
+         * Sets the userName. userName cannot be empty or null.
+         *
+         * @param userName userName
+         * @return <code>Builder</code>
+         */
+        public SelectUserParam.Builder withUserName(@NonNull String userName) {
+            this.userName = userName;
+            return this;
+        }
+
+        /**
+         * Sets the includeRoleInfo. includeRoleInfo default false.
+         *
+         * @param includeRoleInfo includeRoleInfo
+         * @return <code>Builder</code>
+         */
+        public SelectUserParam.Builder withIncludeRoleInfo(boolean includeRoleInfo) {
+            this.includeRoleInfo = includeRoleInfo;
+            return this;
+        }
+
+        /**
+         * Verifies parameters and creates a new {@link SelectUserParam} instance.
+         *
+         * @return {@link SelectUserParam}
+         */
+        public SelectUserParam build() throws ParamException {
+            ParamUtils.CheckNullEmptyString(userName, "UserName");
+
+            return new SelectUserParam(this);
+        }
+    }
+
+}

+ 19 - 36
src/main/java/io/milvus/response/GetBulkloadStateWrapper.java → src/main/java/io/milvus/response/GetBulkInsertStateWrapper.java

@@ -11,28 +11,28 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
- * Util class to wrap response of <code>getBulkloadState</code> interface.
+ * Util class to wrap response of <code>getBulkInsertState</code> interface.
  */
  */
-public class GetBulkloadStateWrapper {
+public class GetBulkInsertStateWrapper {
     private final GetImportStateResponse response;
     private final GetImportStateResponse response;
 
 
-    public GetBulkloadStateWrapper(@NonNull GetImportStateResponse response) {
+    public GetBulkInsertStateWrapper(@NonNull GetImportStateResponse response) {
         this.response = response;
         this.response = response;
     }
     }
 
 
     /**
     /**
-     * Gets ID of the bulk load task.
+     * Gets ID of the bulk insert task.
      *
      *
-     * @return Long ID of the bulk load task
+     * @return Long ID of the bulk insert task
      */
      */
     public long getTaskID() {
     public long getTaskID() {
         return response.getId();
         return response.getId();
     }
     }
 
 
     /**
     /**
-     * Gets the long ID array for auto-id primary key, generated by bulk load task.
+     * Gets the long ID array for auto-id primary key, generated by bulk insert task.
      *
      *
-     * @return List of Long, ID array returned by bulk load task
+     * @return List of Long, ID array returned by bulk insert task
      */
      */
     public List<Long> getAutoGeneratedIDs() {
     public List<Long> getAutoGeneratedIDs() {
         // the id list of response is id ranges
         // the id list of response is id ranges
@@ -40,7 +40,7 @@ public class GetBulkloadStateWrapper {
         // the full id list should be [1, 2, 3 ... , 99, 100, 200, 201, 202 ... , 249, 250]
         // the full id list should be [1, 2, 3 ... , 99, 100, 200, 201, 202 ... , 249, 250]
         List<Long> ranges = response.getIdListList();
         List<Long> ranges = response.getIdListList();
         if (ranges.size()%2 != 0) {
         if (ranges.size()%2 != 0) {
-            throw new IllegalResponseException("The bulkload state response id range list is illegal");
+            throw new IllegalResponseException("The bulk insert state response id range list is illegal");
         }
         }
         List<Long> ids = new ArrayList<>();
         List<Long> ids = new ArrayList<>();
         for (int i = 0; i < ranges.size()/2; i++) {
         for (int i = 0; i < ranges.size()/2; i++) {
@@ -54,43 +54,43 @@ public class GetBulkloadStateWrapper {
     }
     }
 
 
     /**
     /**
-     * Gets state of the bulk load task.
+     * Gets state of the bulk insert task.
      *
      *
-     * @return ImportState state of the bulk load task
+     * @return ImportState state of the bulk insert task
      */
      */
     public ImportState getState() {
     public ImportState getState() {
         return response.getState();
         return response.getState();
     }
     }
 
 
     /**
     /**
-     * Gets how many rows were imported by the bulk load task.
+     * Gets how many rows were imported by the bulk insert task.
      *
      *
-     * @return Long how many rows were imported by the bulk load task
+     * @return Long how many rows were imported by the bulk insert task
      */
      */
     public long getImportedCount() {
     public long getImportedCount() {
         return response.getRowCount();
         return response.getRowCount();
     }
     }
 
 
     /**
     /**
-     * Gets failed reason of the bulk load task.
+     * Gets failed reason of the bulk insert task.
      *
      *
-     * @return String failed reason of the bulk load task
+     * @return String failed reason of the bulk insert task
      */
      */
     public String getFailedReason() {
     public String getFailedReason() {
         return getInfo(Constant.FAILED_REASON);
         return getInfo(Constant.FAILED_REASON);
     }
     }
 
 
     /**
     /**
-     * Gets target files of the bulk load task.
+     * Gets target files of the bulk insert task.
      *
      *
-     * @return String target files of the bulk load task
+     * @return String target files of the bulk insert task
      */
      */
     public String getFiles() {
     public String getFiles() {
         return getInfo(Constant.IMPORT_FILES);
         return getInfo(Constant.IMPORT_FILES);
     }
     }
 
 
     /**
     /**
-     * Gets target collection name of the bulk load task.
+     * Gets target collection name of the bulk insert task.
      *
      *
      * @return String target collection name
      * @return String target collection name
      */
      */
@@ -99,7 +99,7 @@ public class GetBulkloadStateWrapper {
     }
     }
 
 
     /**
     /**
-     * Gets target partition name of the bulk load task.
+     * Gets target partition name of the bulk insert task.
      *
      *
      * @return String target partition name
      * @return String target partition name
      */
      */
@@ -107,23 +107,6 @@ public class GetBulkloadStateWrapper {
         return getInfo(Constant.IMPORT_PARTITION);
         return getInfo(Constant.IMPORT_PARTITION);
     }
     }
 
 
-    /**
-     * A flag indicating whether import data are queryable (i.e. loaded in query nodes).
-     *
-     * @return boolean whether import data are queryable
-     */
-    public boolean queryable() {
-        return response.getDataQueryable();
-    }
-
-    /**
-     * A flag indicating whether import data are indexed.
-     *
-     * @return boolean whether import data are queryable
-     */
-    public boolean indexed() {
-        return response.getDataIndexed();
-    }
 
 
     private String getInfo(@NonNull String key) {
     private String getInfo(@NonNull String key) {
         List<KeyValuePair> infos = response.getInfosList();
         List<KeyValuePair> infos = response.getInfosList();
@@ -143,7 +126,7 @@ public class GetBulkloadStateWrapper {
      */
      */
     @Override
     @Override
     public String toString() {
     public String toString() {
-        return "bulk load task state{" +
+        return "bulk insert task state{" +
                 ", autoGeneratedIDs:" + getAutoGeneratedIDs() +
                 ", autoGeneratedIDs:" + getAutoGeneratedIDs() +
                 ", state:" + getState().name() +
                 ", state:" + getState().name() +
                 ", failed reason:" + getFailedReason() +
                 ", failed reason:" + getFailedReason() +

+ 1 - 1
src/main/milvus-proto

@@ -1 +1 @@
-Subproject commit df5c6a9fd317e0df9d0241f1a9c0715e5d8d2562
+Subproject commit 7a703d4485b551f20efa5b6d22a211e8967624d1