Ver código fonte

complete ddl rpc implementation (#199)

Signed-off-by: 常泽川 <66781781@qq.com>
chinamcafee 3 anos atrás
pai
commit
41c62b3a12
29 arquivos alterados com 2906 adições e 14 exclusões
  1. 288 0
      examples/main/src/io/milvus/DDLExample.java
  2. 7 1
      examples/pom.xml
  3. 6 0
      pom.xml
  4. 832 7
      src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java
  5. 191 3
      src/main/java/io/milvus/client/MilvusClient.java
  6. 15 2
      src/main/java/io/milvus/client/MilvusServiceClient.java
  7. 19 1
      src/main/java/io/milvus/param/R.java
  8. 46 0
      src/main/java/io/milvus/param/RpcStatus.java
  9. 107 0
      src/main/java/io/milvus/param/collection/CreateCollectionParam.java
  10. 57 0
      src/main/java/io/milvus/param/collection/DescribeCollectionParam.java
  11. 57 0
      src/main/java/io/milvus/param/collection/DropCollectionParam.java
  12. 146 0
      src/main/java/io/milvus/param/collection/FieldType.java
  13. 57 0
      src/main/java/io/milvus/param/collection/GetCollectionStatisticsParam.java
  14. 57 0
      src/main/java/io/milvus/param/collection/HasCollectionParam.java
  15. 57 0
      src/main/java/io/milvus/param/collection/LoadCollectionParam.java
  16. 57 0
      src/main/java/io/milvus/param/collection/ReleaseCollectionParam.java
  17. 73 0
      src/main/java/io/milvus/param/collection/ShowCollectionParam.java
  18. 82 0
      src/main/java/io/milvus/param/index/CreateIndexParam.java
  19. 67 0
      src/main/java/io/milvus/param/index/DescribeIndexParam.java
  20. 67 0
      src/main/java/io/milvus/param/index/DropIndexParam.java
  21. 79 0
      src/main/java/io/milvus/param/index/GetIndexBuildProgressParam.java
  22. 67 0
      src/main/java/io/milvus/param/index/GetIndexStateParam.java
  23. 69 0
      src/main/java/io/milvus/param/partition/CreatePartitionParam.java
  24. 69 0
      src/main/java/io/milvus/param/partition/DropPartitionParam.java
  25. 69 0
      src/main/java/io/milvus/param/partition/GetPartitionStatisticsParam.java
  26. 69 0
      src/main/java/io/milvus/param/partition/HasPartitionParam.java
  27. 69 0
      src/main/java/io/milvus/param/partition/LoadPartitionsParam.java
  28. 69 0
      src/main/java/io/milvus/param/partition/ReleasePartitionsParam.java
  29. 58 0
      src/main/java/io/milvus/param/partition/ShowPartitionParam.java

+ 288 - 0
examples/main/src/io/milvus/DDLExample.java

@@ -0,0 +1,288 @@
+package io.milvus;
+
+import io.milvus.client.MilvusServiceClient;
+import io.milvus.grpc.DataType;
+import io.milvus.grpc.DescribeCollectionResponse;
+import io.milvus.grpc.DescribeIndexResponse;
+import io.milvus.grpc.GetCollectionStatisticsResponse;
+import io.milvus.grpc.GetIndexBuildProgressResponse;
+import io.milvus.grpc.GetIndexStateResponse;
+import io.milvus.grpc.GetPartitionStatisticsResponse;
+import io.milvus.grpc.ShowCollectionsResponse;
+import io.milvus.grpc.ShowPartitionsResponse;
+import io.milvus.grpc.ShowType;
+import io.milvus.param.ConnectParam;
+import io.milvus.param.R;
+import io.milvus.param.RpcStatus;
+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.GetCollectionStatisticsParam;
+import io.milvus.param.collection.HasCollectionParam;
+import io.milvus.param.collection.LoadCollectionParam;
+import io.milvus.param.collection.ReleaseCollectionParam;
+import io.milvus.param.collection.ShowCollectionParam;
+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.ShowPartitionParam;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Milvus ddl api example
+ *
+ * @author changzechuan
+ */
+public class DDLExample {
+
+    public static MilvusServiceClient milvusClient;
+
+    static {
+        ConnectParam connectParam = ConnectParam.Builder.newBuilder()
+                .withHost("localhost")
+                .withPort(19530)
+                .build();
+        milvusClient = new MilvusServiceClient(connectParam);
+    }
+
+    @Test
+    public void createCollection(){
+        FieldType[] fieldTypes = new FieldType[2];
+        FieldType fieldType1 = FieldType.Builder.newBuilder()
+                .withName("userID")
+                .withDescription("userId")
+                .withDataType(DataType.Int64)
+                .withAutoID(true)
+                .withPrimaryKey(true).build();
+
+        Map<String,String> typeParamsMap = new HashMap<>();
+        typeParamsMap.put("dim","512");
+        FieldType fieldType2 = FieldType.Builder.newBuilder()
+                .withName("vector1")
+                .withDescription("match Vector")
+                .withDataType(DataType.FloatVector)
+                .withTypeParams(typeParamsMap).build();
+        fieldTypes[0] = fieldType1;
+        fieldTypes[1] = fieldType2;
+
+        CreateCollectionParam createCollectionReq = CreateCollectionParam.Builder.newBuilder()
+                .withCollectionName("collection1")
+                .withDescription("first collection")
+                .withShardsNum(2)
+                .withFieldTypes(fieldTypes).build();
+        R<RpcStatus> createCollection = milvusClient.createCollection(createCollectionReq);
+
+        System.out.println(createCollection);
+    }
+
+    @Test
+    public void dropCollection(){
+        R<RpcStatus> dropCollection = milvusClient.dropCollection(DropCollectionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+        System.out.println(dropCollection);
+    }
+
+    @Test
+    public void hasCollection(){
+        R<Boolean> hasCollection = milvusClient.hasCollection(HasCollectionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+
+        System.out.println(hasCollection);
+    }
+
+    @Test
+    public void loadCollection(){
+        R<RpcStatus> loadCollection = milvusClient.loadCollection(LoadCollectionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+        System.out.println(loadCollection);
+    }
+
+    @Test
+    public void releaseCollection(){
+        R<RpcStatus> releaseCollection = milvusClient.releaseCollection(ReleaseCollectionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+        System.out.println(releaseCollection);
+    }
+
+    @Test
+    public void describeCollection(){
+        R<DescribeCollectionResponse> describeCollection = milvusClient.describeCollection(DescribeCollectionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+        System.out.println(describeCollection);
+    }
+
+    @Test
+    public void getCollectionStatistics(){
+        R<GetCollectionStatisticsResponse> getCollectionStatistics = milvusClient.getCollectionStatistics(GetCollectionStatisticsParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+        System.out.println(getCollectionStatistics);
+    }
+
+    @Test
+    public void showCollections(){
+        String[] collectionNames = new String[]{"collection1"};
+        R<ShowCollectionsResponse> showCollections = milvusClient.showCollections(ShowCollectionParam.Builder
+                .newBuilder()
+                .withCollectionNames(collectionNames)
+                .withShowType(ShowType.All)
+                .build());
+        System.out.println(showCollections);
+    }
+
+    @Test
+    public void createPartition(){
+        R<RpcStatus> createPartition = milvusClient.createPartition(CreatePartitionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withPartitionName("par1")
+                .build());
+
+        System.out.println(createPartition);
+    }
+
+    @Test
+    public void dropPartition(){
+        R<RpcStatus> dropPartition = milvusClient.dropPartition(DropPartitionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withPartitionName("par1")
+                .build());
+
+        System.out.println(dropPartition);
+    }
+
+    @Test
+    public void hasPartition(){
+        R<Boolean> hasPartition = milvusClient.hasPartition(HasPartitionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withPartitionName("par1")
+                .build());
+
+        System.out.println(hasPartition);
+    }
+
+    @Test
+    public void loadPartitions(){
+        String[] partitionNames = new String[]{"par1"};
+        R<RpcStatus> loadPartition = milvusClient.loadPartitions(LoadPartitionsParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withPartitionNames(partitionNames)
+                .build());
+
+        System.out.println(loadPartition);
+    }
+
+    @Test
+    public void releasePartitions(){
+        String[] releaseNames = new String[]{"par1"};
+        R<RpcStatus> releasePartition = milvusClient.releasePartitions(ReleasePartitionsParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withPartitionNames(releaseNames)
+                .build());
+
+        System.out.println(releasePartition);
+    }
+
+    @Test
+    public void getPartitionStatistics(){
+        R<GetPartitionStatisticsResponse> getPartitionStatistics = milvusClient.getPartitionStatistics(GetPartitionStatisticsParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withPartitionName("par1")
+                .build());
+
+        System.out.println(getPartitionStatistics);
+    }
+
+    @Test
+    public void showPartitions(){
+        R<ShowPartitionsResponse> showPartitionsResponse = milvusClient.showPartitions(ShowPartitionParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .build());
+        System.out.println(showPartitionsResponse);
+    }
+
+    @Test
+    public void createIndex(){
+        Map<String,String> extraParam = new HashMap<>();
+        extraParam.put("index_type","IVF_FLAT");
+        extraParam.put("metric_type", "IP");
+        extraParam.put("params","{\"nlist\":10}");
+        R<RpcStatus> createIndex = milvusClient.createIndex(CreateIndexParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withFieldName("vector1")
+                .withExtraParam(extraParam)
+                .build());
+        System.out.println(createIndex);
+    }
+
+    @Test
+    public void dropIndex(){
+        R<RpcStatus> dropIndex = milvusClient.dropIndex(DropIndexParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withFieldName("vector1")
+                .build());
+        System.out.println(dropIndex);
+    }
+
+    @Test
+    public void describeIndex(){
+        R<DescribeIndexResponse> describeIndex = milvusClient.describeIndex(DescribeIndexParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withFieldName("vector1")
+                .build());
+        System.out.println(describeIndex);
+    }
+
+    @Test
+    public void getIndexState(){
+        R<GetIndexStateResponse> getIndexState = milvusClient.getIndexState(GetIndexStateParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withFieldName("vector1")
+                .build());
+        System.out.println(getIndexState);
+    }
+
+    @Test
+    public void getIndexBuildProgress(){
+        R<GetIndexBuildProgressResponse> getIndexBuildProgress = milvusClient.getIndexBuildProgress(GetIndexBuildProgressParam.Builder
+                .newBuilder()
+                .withCollectionName("collection1")
+                .withFieldName("vector1")
+                .withIndexName("_default_idx")
+                .build());
+        System.out.println(getIndexBuildProgress);
+    }
+}

+ 7 - 1
examples/pom.xml

@@ -63,7 +63,7 @@
         <dependency>
             <groupId>io.milvus</groupId>
             <artifactId>milvus-sdk-java</artifactId>
-            <version>1.0.0</version>
+            <version>2.0.0</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>
@@ -75,6 +75,12 @@
             <artifactId>slf4j-api</artifactId>
             <version>1.7.30</version>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.13.2</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 6 - 0
pom.xml

@@ -67,6 +67,7 @@
         <grpc.version>1.38.0</grpc.version>
         <protobuf.version>3.12.0</protobuf.version>
         <protoc.version>3.12.0</protoc.version>
+        <commons-collections4.version>4.3</commons-collections4.version>
         <maven.compiler.source>1.8</maven.compiler.source>
         <maven.compiler.target>1.8</maven.compiler.target>
     </properties>
@@ -126,6 +127,11 @@
             <artifactId>commons-text</artifactId>
             <version>1.6</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+            <version>${commons-collections4.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>

+ 832 - 7
src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java

@@ -2,13 +2,74 @@ package io.milvus.client;
 
 import io.grpc.StatusRuntimeException;
 import io.milvus.grpc.BoolResponse;
+import io.milvus.grpc.CollectionSchema;
+import io.milvus.grpc.CreateCollectionRequest;
+import io.milvus.grpc.CreateIndexRequest;
+import io.milvus.grpc.CreatePartitionRequest;
+import io.milvus.grpc.DescribeCollectionRequest;
+import io.milvus.grpc.DescribeCollectionResponse;
+import io.milvus.grpc.DescribeIndexRequest;
+import io.milvus.grpc.DescribeIndexResponse;
+import io.milvus.grpc.DropCollectionRequest;
+import io.milvus.grpc.DropIndexRequest;
+import io.milvus.grpc.DropPartitionRequest;
 import io.milvus.grpc.ErrorCode;
+import io.milvus.grpc.FieldSchema;
+import io.milvus.grpc.GetCollectionStatisticsRequest;
+import io.milvus.grpc.GetCollectionStatisticsResponse;
+import io.milvus.grpc.GetIndexBuildProgressRequest;
+import io.milvus.grpc.GetIndexBuildProgressResponse;
+import io.milvus.grpc.GetIndexStateRequest;
+import io.milvus.grpc.GetIndexStateResponse;
+import io.milvus.grpc.GetPartitionStatisticsRequest;
+import io.milvus.grpc.GetPartitionStatisticsResponse;
 import io.milvus.grpc.HasCollectionRequest;
+import io.milvus.grpc.HasPartitionRequest;
+import io.milvus.grpc.KeyValuePair;
+import io.milvus.grpc.LoadCollectionRequest;
+import io.milvus.grpc.LoadPartitionsRequest;
 import io.milvus.grpc.MilvusServiceGrpc;
+import io.milvus.grpc.ReleaseCollectionRequest;
+import io.milvus.grpc.ReleasePartitionsRequest;
+import io.milvus.grpc.ShowCollectionsRequest;
+import io.milvus.grpc.ShowCollectionsResponse;
+import io.milvus.grpc.ShowPartitionsRequest;
+import io.milvus.grpc.ShowPartitionsResponse;
+import io.milvus.grpc.Status;
 import io.milvus.param.R;
+import io.milvus.param.RpcStatus;
+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.GetCollectionStatisticsParam;
+import io.milvus.param.collection.HasCollectionParam;
+import io.milvus.param.collection.LoadCollectionParam;
+import io.milvus.param.collection.ReleaseCollectionParam;
+import io.milvus.param.collection.ShowCollectionParam;
+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.ShowPartitionParam;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 
 public abstract class AbstractMilvusGrpcClient implements MilvusClient {
@@ -19,25 +80,789 @@ public abstract class AbstractMilvusGrpcClient implements MilvusClient {
 
     protected abstract MilvusServiceGrpc.MilvusServiceFutureStub futureStub();
 
+    protected abstract boolean maybeAvailable();
+
     @Override
-    public R<Boolean> hasCollection(String collectionName) {
+    public R<Boolean> hasCollection(HasCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name is empty or not
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
         HasCollectionRequest hasCollectionRequest = HasCollectionRequest.newBuilder()
-                .setCollectionName(collectionName)
+                .setCollectionName(requestParam.getCollectionName())
                 .build();
 
         BoolResponse response;
         try {
             response = blockingStub().hasCollection(hasCollectionRequest);
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Has collection check successfully!\n{}", requestParam.toString());
+                Boolean aBoolean = Optional.ofNullable(response)
+                        .map(BoolResponse::getValue)
+                        .orElse(false);
+                return R.success(aBoolean);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+
+        } catch (StatusRuntimeException e) {
+            logger.error("[milvus] hasCollection:{} request error: {}", requestParam.getCollectionName(), e.getMessage());
+            return R.failed(e);
+        }
+
+    }
+
+
+    @Override
+    public R<RpcStatus> createCollection(CreateCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // Check whether the parameters are correct or not
+        if (requestParam == null || StringUtils.isBlank(requestParam.getCollectionName())
+                || requestParam.getShardsNum() <= 0
+                || requestParam.getFieldTypes().length == 0) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        // Construct CollectionSchema Params
+        CollectionSchema.Builder collectionSchemaBuilder = CollectionSchema.newBuilder();
+        collectionSchemaBuilder.setName(requestParam.getCollectionName())
+                               .setDescription(requestParam.getDescription());
+
+
+        for (FieldType fieldType : requestParam.getFieldTypes()) {
+            FieldSchema.Builder fieldSchemaBuilder = FieldSchema.newBuilder()
+                    .setFieldID(fieldType.getFieldID())
+                    .setName(fieldType.getName())
+                    .setIsPrimaryKey(fieldType.isPrimaryKey())
+                    .setDescription(fieldType.getDescription())
+                    .setDataType(fieldType.getDataType())
+                    .setAutoID(fieldType.isAutoID());
+
+            // assemble typeParams for CollectionSchema
+            List<KeyValuePair> typeParamsList = assembleKvPair(fieldType.getTypeParams());
+            if (CollectionUtils.isNotEmpty(typeParamsList)) {
+                typeParamsList.forEach(fieldSchemaBuilder::addTypeParams);
+            }
+
+            // assemble indexParams for CollectionSchema
+            List<KeyValuePair> indexParamsList = assembleKvPair(fieldType.getIndexParams());
+            if (CollectionUtils.isNotEmpty(indexParamsList)) {
+                indexParamsList.forEach(fieldSchemaBuilder::addIndexParams);
+            }
+
+            collectionSchemaBuilder.addFields(fieldSchemaBuilder.build());
+        }
+
+        // Construct CreateCollectionRequest
+        CreateCollectionRequest createCollectionRequest = CreateCollectionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setShardsNum(requestParam.getShardsNum())
+                .setSchema(collectionSchemaBuilder.build().toByteString())
+                .build();
+
+        Status response;
+
+        try {
+            response = blockingStub().createCollection(createCollectionRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Created collection successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("createCollection RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> dropCollection(DropCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name is empty or not
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        DropCollectionRequest dropCollectionRequest = DropCollectionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .build();
+
+        Status response;
+        try {
+            response = blockingStub().dropCollection(dropCollectionRequest);
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Drop collection successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("dropCollectionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+
+    @Override
+    public R<RpcStatus> loadCollection(LoadCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name is empty or not
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        LoadCollectionRequest loadCollectionRequest = LoadCollectionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .build();
+
+        Status response;
+        try {
+            response = blockingStub().loadCollection(loadCollectionRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Load collection successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("loadCollectionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> releaseCollection(ReleaseCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name is empty or not
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        ReleaseCollectionRequest releaseCollectionRequest = ReleaseCollectionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .build();
+
+        Status response;
+        try {
+            response = blockingStub().releaseCollection(releaseCollectionRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Release collection successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("releaseCollectionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+
+    }
+
+    @Override
+    public R<DescribeCollectionResponse> describeCollection(DescribeCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name is empty or not
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        DescribeCollectionRequest describeCollectionRequest = DescribeCollectionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .build();
+
+        DescribeCollectionResponse response;
+        try {
+            response = blockingStub().describeCollection(describeCollectionRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Describe collection successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("describeCollectionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<GetCollectionStatisticsResponse> getCollectionStatistics(GetCollectionStatisticsParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name is empty or not
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        GetCollectionStatisticsRequest getCollectionStatisticsRequest = GetCollectionStatisticsRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .build();
+
+        GetCollectionStatisticsResponse response;
+        try {
+            response = blockingStub().getCollectionStatistics(getCollectionStatisticsRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Get collection statistics successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("getCollectionStatisticsRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<ShowCollectionsResponse> showCollections(ShowCollectionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+        ShowCollectionsRequest.Builder showCollectionRequestBuilder = ShowCollectionsRequest.newBuilder();
+
+        String[] collectionNames = requestParam.getCollectionNames();
+        if (collectionNames == null || collectionNames.length <= 0) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        // add collectionNames
+        Arrays.stream(collectionNames).forEach(showCollectionRequestBuilder::addCollectionNames);
+
+        ShowCollectionsRequest showCollectionsRequest = showCollectionRequestBuilder
+                .setType(requestParam.getShowType()).build();
+
+        ShowCollectionsResponse response;
+        try {
+            response = blockingStub().showCollections(showCollectionsRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Show collection successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("showCollectionsRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> createPartition(CreatePartitionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name or partition name is empty or not
+        if (checkPartitionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        CreatePartitionRequest createPartitionRequest = CreatePartitionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setPartitionName(requestParam.getPartitionName())
+                .build();
+
+        Status response;
+        try {
+            response = blockingStub().createPartition(createPartitionRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Create partition successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("createPartitionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> dropPartition(DropPartitionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name or partition name is empty or not
+        if (checkPartitionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        DropPartitionRequest dropPartitionRequest = DropPartitionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setPartitionName(requestParam.getPartitionName())
+                .build();
+
+        Status response;
+        try {
+            response = blockingStub().dropPartition(dropPartitionRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Drop partition successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("createPartitionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<Boolean> hasPartition(HasPartitionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name or partition name is empty or not
+        if (checkPartitionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        HasPartitionRequest hasPartitionRequest = HasPartitionRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setPartitionName(requestParam.getPartitionName())
+                .build();
+
+        BoolResponse response;
+        try {
+            response = blockingStub().hasPartition(hasPartitionRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("HasPartition call successfully!\n{}", requestParam.toString());
+
+                Boolean result = Optional.ofNullable(response)
+                        .map(BoolResponse::getValue)
+                        .orElse(false);
+
+                return R.success(result);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("hasPartitionRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> loadPartitions(LoadPartitionsParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check requestParam
+        if (requestParam == null || StringUtils.isEmpty(requestParam.getCollectionName())
+                || requestParam.getPartitionNames() == null
+                || requestParam.getPartitionNames().length == 0) {
+            return R.failed(R.Status.ParamError);
+        }
+        LoadPartitionsRequest.Builder loadPartitionsRequestBuilder = LoadPartitionsRequest.newBuilder();
+
+        String[] partitionNames = requestParam.getPartitionNames();
+        // add partitionNames
+        Arrays.stream(partitionNames).forEach(loadPartitionsRequestBuilder::addPartitionNames);
+
+        LoadPartitionsRequest loadPartitionsRequest = loadPartitionsRequestBuilder
+                .setCollectionName(requestParam.getCollectionName()).build();
+
+        Status response;
+        try {
+            response = blockingStub().loadPartitions(loadPartitionsRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Load partition successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("loadPartitionsRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> releasePartitions(ReleasePartitionsParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check requestParam
+        if (requestParam == null || StringUtils.isEmpty(requestParam.getCollectionName())
+                || requestParam.getPartitionNames() == null
+                || requestParam.getPartitionNames().length == 0) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        ReleasePartitionsRequest.Builder releasePartitionsRequestBuilder = ReleasePartitionsRequest.newBuilder();
+
+        String[] partitionNames = requestParam.getPartitionNames();
+        // add partitionNames
+        Arrays.stream(partitionNames).forEach(releasePartitionsRequestBuilder::addPartitionNames);
+
+        ReleasePartitionsRequest releasePartitionsRequest = releasePartitionsRequestBuilder
+                .setCollectionName(requestParam.getCollectionName()).build();
+
+        Status response;
+        try {
+            response = blockingStub().releasePartitions(releasePartitionsRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Release partition successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("releasePartitionsRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<GetPartitionStatisticsResponse> getPartitionStatistics(GetPartitionStatisticsParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if collection name or partition name is empty or not
+        if (checkPartitionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        GetPartitionStatisticsRequest getPartitionStatisticsRequest = GetPartitionStatisticsRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setPartitionName(requestParam.getPartitionName())
+                .build();
+
+        GetPartitionStatisticsResponse response;
+        try {
+            response = blockingStub().getPartitionStatistics(getPartitionStatisticsRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Get partition statistics successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("getPartitionStatisticsRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<ShowPartitionsResponse> showPartitions(ShowPartitionParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        if (checkCollectionParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        ShowPartitionsRequest showPartitionsRequest = ShowPartitionsRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .build();
+
+        ShowPartitionsResponse response;
+        try {
+            response = blockingStub().showPartitions(showPartitionsRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Show partition successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("showPartitionsRequest RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> createIndex(CreateIndexParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // check whether if create index param is valid or not
+        if (requestParam == null || StringUtils.isEmpty(requestParam.getCollectionName())
+                || StringUtils.isEmpty(requestParam.getFieldName())
+                || MapUtils.isEmpty(requestParam.getExtraParam())) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        CreateIndexRequest.Builder createIndexRequestBuilder = CreateIndexRequest.newBuilder();
+        List<KeyValuePair> extraParamList = assembleKvPair(requestParam.getExtraParam());
+
+        if (CollectionUtils.isNotEmpty(extraParamList)) {
+            extraParamList.forEach(createIndexRequestBuilder::addExtraParams);
+        }
+
+        CreateIndexRequest createIndexRequest = createIndexRequestBuilder.setCollectionName(requestParam.getCollectionName())
+                .setFieldName(requestParam.getFieldName()).build();
+
+        Status response;
+        try {
+            response = blockingStub().createIndex(createIndexRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Create index successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("createIndex RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<RpcStatus> dropIndex(DropIndexParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        if (checkIndexParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        DropIndexRequest dropIndexRequest = DropIndexRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setFieldName(requestParam.getFieldName())
+                .build();
+
+        Status response;
+        try {
+            response = blockingStub().dropIndex(dropIndexRequest);
+
+            if (response.getErrorCode() == ErrorCode.Success) {
+                logInfo("Drop index successfully!\n{}", requestParam.toString());
+                return R.success(new RpcStatus(RpcStatus.SUCCESS_MSG));
+            } else {
+                return R.failed(R.Status.valueOf(response.getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("dropIndex RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    @Override
+    public R<DescribeIndexResponse> describeIndex(DescribeIndexParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        if (checkIndexParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        DescribeIndexRequest describeIndexRequest = DescribeIndexRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setFieldName(requestParam.getFieldName())
+                .build();
+
+        DescribeIndexResponse response;
+        try {
+            response = blockingStub().describeIndex(describeIndexRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Describe index successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
         } catch (StatusRuntimeException e) {
-            logger.error("[milvus] hasCollection:{} request error: {}", collectionName, e.getMessage());
+            logError("describeIndex RPC failed:\n{}", e.getStatus().toString());
             return R.failed(e);
         }
-        Boolean aBoolean = Optional.ofNullable(response)
-                .map(BoolResponse::getValue)
-                .orElse(false);
+    }
+
+    @Override
+    public R<GetIndexStateResponse> getIndexState(GetIndexStateParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        if (checkIndexParam(requestParam)) {
+            return R.failed(R.Status.ParamError);
+        }
 
-        return R.success(aBoolean);
+        GetIndexStateRequest getIndexStateRequest = GetIndexStateRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setFieldName(requestParam.getFieldName())
+                .build();
+
+        GetIndexStateResponse response;
+
+        try {
+            response = blockingStub().getIndexState(getIndexStateRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Get index state successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("getIndexState RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
 
+    @Override
+    public R<GetIndexBuildProgressResponse> getIndexBuildProgress(GetIndexBuildProgressParam requestParam) {
+        if (checkServerConnection()) {
+            return R.failed(R.Status.ConnectFailed);
+        }
+
+        // indexName is required in this rpc
+        if (checkIndexParam(requestParam) || StringUtils.isEmpty(requestParam.getIndexName())) {
+            return R.failed(R.Status.ParamError);
+        }
+
+        GetIndexBuildProgressRequest getIndexBuildProgressRequest = GetIndexBuildProgressRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName())
+                .setFieldName(requestParam.getFieldName())
+                .setIndexName(requestParam.getIndexName())
+                .build();
+
+        GetIndexBuildProgressResponse response;
+
+        try {
+            response = blockingStub().getIndexBuildProgress(getIndexBuildProgressRequest);
+
+            if (response.getStatus().getErrorCode() == ErrorCode.Success) {
+                logInfo("Get index build progress successfully!\n{}", requestParam.toString());
+                return R.success(response);
+            } else {
+                return R.failed(R.Status.valueOf(response.getStatus().getErrorCode().getNumber()));
+            }
+        } catch (StatusRuntimeException e) {
+            logError("getIndexBuildProgress RPC failed:\n{}", e.getStatus().toString());
+            return R.failed(e);
+        }
+    }
+
+    private <T> boolean checkCollectionParam(T requestParam) {
+        Class<?> clazz = requestParam.getClass();
+        try {
+            Field collectionNameField = clazz.getDeclaredField("collectionName");
+            collectionNameField.setAccessible(true);
+            String collectionName = (String) collectionNameField.get(requestParam);
+            // if collectionName is empty, return true, else return false
+            return StringUtils.isEmpty(collectionName);
+        } catch (Exception e) {
+            logError("checkCollectionParam failed:\n{}", e.getMessage());
+            return true;
+        }
+    }
+
+    private <T> boolean checkPartitionParam(T requestParam) {
+        Class<?> clazz = requestParam.getClass();
+        try {
+            Field collectionNameField = clazz.getDeclaredField("collectionName");
+            collectionNameField.setAccessible(true);
+            String collectionName = (String) collectionNameField.get(requestParam);
+
+            Field partitionNameField = clazz.getDeclaredField("partitionName");
+            partitionNameField.setAccessible(true);
+            String partitionName = (String) partitionNameField.get(requestParam);
+
+            // if collectionName or partitionName is empty, return true, else return false
+            return (StringUtils.isEmpty(collectionName) || StringUtils.isEmpty(partitionName));
+        } catch (Exception e) {
+            // if param check failed, return true
+            return true;
+        }
+    }
+
+    private <T> boolean checkIndexParam(T requestParam) {
+        Class<?> clazz = requestParam.getClass();
+        try {
+            Field collectionNameField = clazz.getDeclaredField("collectionName");
+            collectionNameField.setAccessible(true);
+            String collectionName = (String) collectionNameField.get(requestParam);
+
+            Field fieldNameField = clazz.getDeclaredField("fieldName");
+            fieldNameField.setAccessible(true);
+            String fieldName = (String) fieldNameField.get(requestParam);
+            // if collectionName or fieldName is empty, return true, else return false
+            return (StringUtils.isEmpty(collectionName) || StringUtils.isEmpty(fieldName));
+        } catch (Exception e) {
+            // if param check failed, return true
+            return true;
+        }
+    }
+
+    private boolean checkServerConnection() {
+        if (!maybeAvailable()) {
+            logWarning("You are not connected to Milvus server");
+            return true;
+        }
+        return false;
+    }
+
+    private List<KeyValuePair> assembleKvPair(Map<String, String> sourceMap) {
+        List<KeyValuePair> result = new ArrayList<>();
+        if (MapUtils.isNotEmpty(sourceMap)) {
+            sourceMap.forEach((key, value) -> {
+                KeyValuePair kv = KeyValuePair.newBuilder()
+                        .setKey(key)
+                        .setValue(value).build();
+                result.add(kv);
+            });
+        }
+        return result;
+    }
+
+    ///////////////////// Log Functions//////////////////////
+
+    private void logInfo(String msg, Object... params) {
+        logger.info(msg, params);
+    }
+
+    private void logWarning(String msg, Object... params) {
+        logger.warn(msg, params);
+    }
 
+    private void logError(String msg, Object... params) {
+        logger.error(msg, params);
     }
 }

+ 191 - 3
src/main/java/io/milvus/client/MilvusClient.java

@@ -19,18 +19,206 @@
 
 package io.milvus.client;
 
+import io.milvus.grpc.DescribeCollectionResponse;
+import io.milvus.grpc.DescribeIndexResponse;
+import io.milvus.grpc.GetCollectionStatisticsResponse;
+import io.milvus.grpc.GetIndexBuildProgressResponse;
+import io.milvus.grpc.GetIndexStateResponse;
+import io.milvus.grpc.GetPartitionStatisticsResponse;
+import io.milvus.grpc.ShowCollectionsResponse;
+import io.milvus.grpc.ShowPartitionsResponse;
 import io.milvus.param.R;
+import io.milvus.param.RpcStatus;
+import io.milvus.param.collection.CreateCollectionParam;
+import io.milvus.param.collection.DescribeCollectionParam;
+import io.milvus.param.collection.DropCollectionParam;
+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.ShowCollectionParam;
+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.ShowPartitionParam;
 
 import java.util.concurrent.TimeUnit;
 
 /** The Milvus Client Interface */
 public interface MilvusClient {
 
-  default void close() {
+    default void close() {
     close(TimeUnit.MINUTES.toSeconds(1));
   }
 
-  void close(long maxWaitSeconds);
+    void close(long maxWaitSeconds);
 
-  R<Boolean> hasCollection(String collectionName);
+    /**
+     * Check if a collection exists.
+     *
+     * @param requestParam {@link HasCollectionParam}
+     * @return {status:result code,data: boolean, whether if has collection or not}
+     */
+    R<Boolean> hasCollection(HasCollectionParam requestParam);
+
+    /**
+     * Create a collection in Milvus.
+     *
+     * @param requestParam {@link CreateCollectionParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> createCollection(CreateCollectionParam requestParam);
+
+    /**
+     * Drop a collection. Note that this drops all data in the collection.
+     *
+     * @param requestParam {@link DropCollectionParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> dropCollection(DropCollectionParam requestParam);
+
+    /**
+     * Load collection to cache before search.
+     *
+     * @param requestParam {@link LoadCollectionParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> loadCollection(LoadCollectionParam requestParam);
+
+    /**
+     * Release a collection from cache to reduce cache usage. Note that you cannot
+     * search while the corresponding collection is unloaded.
+     *
+     * @param requestParam {@link ReleaseCollectionParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> releaseCollection(ReleaseCollectionParam requestParam);
+
+    /**
+     * Show the details of a collection, e.g. name, schema.
+     *
+     * @param requestParam {@link DescribeCollectionParam}
+     * @return {status:result code,data:DescribeCollectionResponse{schema,collectionID}}
+     */
+    R<DescribeCollectionResponse> describeCollection(DescribeCollectionParam requestParam);
+
+    /**
+     * Show the statistics information of a collection.
+     *
+     * @param requestParam {@link GetCollectionStatisticsParam}
+     * @return {status:result code, data: GetCollectionStatisticsResponse{status,stats}}
+     */
+    R<GetCollectionStatisticsResponse> getCollectionStatistics(GetCollectionStatisticsParam requestParam);
+
+    /**
+     * List all collections or get collection loading status.
+     *
+     * @param requestParam {@link ShowCollectionParam}
+     * @return {status:result code, data: ShowCollectionsResponse{status,collection_names,collection_ids,created_timestamps,created_utc_timestamps}}
+     */
+    R<ShowCollectionsResponse> showCollections(ShowCollectionParam requestParam);
+
+    /**
+     * Create a partition in a collection.
+     *
+     * @param requestParam {@link CreatePartitionParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> createPartition(CreatePartitionParam requestParam);
+
+    /**
+     * To drop a partition will drop all data in this partition and the _default partition cannot be dropped.
+     *
+     * @param requestParam {@link DropPartitionParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> dropPartition(DropPartitionParam requestParam);
+
+    /**
+     * Check if a partition exists in a collection.
+     *
+     * @param requestParam {@link HasPartitionParam}
+     * @return {status:result code,data: boolean, whether if has collection or not}
+     */
+    R<Boolean> hasPartition(HasPartitionParam requestParam);
+
+    /**
+     * Load a partition into cache.
+     *
+     * @param requestParam {@link LoadPartitionsParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> loadPartitions(LoadPartitionsParam requestParam);
+
+    /**
+     * Release a partition from cache.
+     *
+     * @param requestParam {@link ReleasePartitionsParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> releasePartitions(ReleasePartitionsParam requestParam);
+
+    /**
+     * Show the statistics information of a partition.
+     *
+     * @param requestParam {@link GetPartitionStatisticsParam}
+     * @return  {status:result code,data:GetPartitionStatisticsResponse{status,stats}}
+     */
+    R<GetPartitionStatisticsResponse> getPartitionStatistics(GetPartitionStatisticsParam requestParam);
+
+    /**
+     * Show all partitions in a collection.
+     *
+     * @param requestParam {@link ShowPartitionParam}
+     * @return {status:result code,data:ShowPartitionsResponse{partition_names,partitionIDs,created_timestamps,created_utc_timestamps}}
+     */
+    R<ShowPartitionsResponse> showPartitions(ShowPartitionParam requestParam);
+
+    /**
+     * Create an index on a vector field. Note that index building is an async progress.
+     *
+     * @param requestParam {@link CreateIndexParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> createIndex(CreateIndexParam requestParam);
+
+    /**
+     * Drop an index.
+     *
+     * @param requestParam {@link DropIndexParam}
+     * @return {status:result code,data:RpcStatus{msg: result message}}
+     */
+    R<RpcStatus> dropIndex(DropIndexParam requestParam);
+
+    /**
+     * Show index information. Current release of Milvus only supports showing latest built index.
+     *
+     * @param requestParam {@link DescribeIndexParam}
+     * @return {status:result code,data:DescribeIndexResponse{status,index_descriptions}}
+     */
+    R<DescribeIndexResponse> describeIndex(DescribeIndexParam requestParam);
+
+    /**
+     * Show index building state.
+     *
+     * @param requestParam {@link GetIndexStateParam}
+     * @return {status:result code,data:GetIndexStateResponse{status,state}}
+     */
+    R<GetIndexStateResponse> getIndexState(GetIndexStateParam requestParam);
+
+    /**
+     * Show index building progress.
+     *
+     * @param requestParam {@link GetIndexBuildProgressParam}
+     * @return {status:result code,data:GetIndexStateResponse{status,indexed_rows}}
+     */
+    R<GetIndexBuildProgressResponse> getIndexBuildProgress(GetIndexBuildProgressParam requestParam);
 }

+ 15 - 2
src/main/java/io/milvus/client/MilvusServiceClient.java

@@ -21,9 +21,10 @@ package io.milvus.client;
 
 import io.grpc.ManagedChannel;
 import io.grpc.ManagedChannelBuilder;
-import io.milvus.grpc.*;
+import io.milvus.grpc.MilvusServiceGrpc;
 import io.milvus.param.ConnectParam;
 import io.milvus.param.R;
+import io.milvus.param.collection.HasCollectionParam;
 
 import java.util.concurrent.TimeUnit;
 
@@ -56,6 +57,18 @@ public class MilvusServiceClient extends AbstractMilvusGrpcClient {
         return this.futureStub;
     }
 
+    @Override
+    protected boolean maybeAvailable() {
+        switch (channel.getState(false)) {
+            case IDLE:
+            case CONNECTING:
+            case READY:
+                return true;
+            default:
+                return false;
+        }
+    }
+
     @Override
     public void close(long maxWaitSeconds) {
 
@@ -71,7 +84,7 @@ public class MilvusServiceClient extends AbstractMilvusGrpcClient {
 
         MilvusServiceClient milvusServiceClient = new MilvusServiceClient(build);
 
-        R<Boolean> chuwutest = milvusServiceClient.hasCollection("chuwutest");
+        R<Boolean> chuwutest = milvusServiceClient.hasCollection(HasCollectionParam.Builder.newBuilder().withCollectionName("czc1").build());
 
         System.out.println(chuwutest);
     }

+ 19 - 1
src/main/java/io/milvus/param/R.java

@@ -97,7 +97,8 @@ public class R<T> {
         RpcError(-1),
         ClientNotConnected(-2),
         Unknown(-3),
-        VersionMismatch(-4);
+        VersionMismatch(-4),
+        ParamError(-5);
 
         private final int code;
 
@@ -115,4 +116,21 @@ public class R<T> {
             return code;
         }
     }
+
+    @Override
+    public String toString() {
+        if(exception != null){
+            return "R{" +
+                    "exception=" + exception.getMessage() +
+                    ", status=" + status +
+                    ", data=" + data +
+                    '}';
+        }else{
+            return "R{" +
+                    "status=" + status +
+                    ", data=" + data +
+                    '}';
+        }
+
+    }
 }

+ 46 - 0
src/main/java/io/milvus/param/RpcStatus.java

@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+/**
+ * Extend partial DDL rpc invoke result
+ *
+ * @author changzechuan
+ */
+public class RpcStatus {
+    public static final String SUCCESS_MSG = "Success";
+
+    private final String msg;
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public RpcStatus(String msg) {
+        this.msg = msg;
+    }
+
+    @Override
+    public String toString() {
+        return "RpcStatus{" +
+                "msg='" + msg + '\'' +
+                '}';
+    }
+}

+ 107 - 0
src/main/java/io/milvus/param/collection/CreateCollectionParam.java

@@ -0,0 +1,107 @@
+/*
+ * 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.collection;
+
+import javax.annotation.Nonnull;
+import java.util.Arrays;
+
+/**
+ * request for create collection
+ *
+ * @author changzechuan
+ */
+public class CreateCollectionParam {
+    private final String collectionName;
+    private final int shardsNum;
+    private final String description;
+    private final FieldType[] fieldTypes;
+
+    private CreateCollectionParam(@Nonnull Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.shardsNum = builder.shardsNum;
+        this.description = builder.description;
+        this.fieldTypes = builder.fieldTypes;
+    }
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public int getShardsNum() {
+        return shardsNum;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public FieldType[] getFieldTypes() {
+        return fieldTypes;
+    }
+
+
+    public static final class Builder {
+        private String collectionName;
+        private int shardsNum;
+        private String description;
+        private FieldType[] fieldTypes;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withShardsNum(int shardsNum) {
+            this.shardsNum = shardsNum;
+            return this;
+        }
+
+        public Builder withDescription(String description) {
+            this.description = description;
+            return this;
+        }
+
+        public Builder withFieldTypes(FieldType[] fieldTypes) {
+            this.fieldTypes = fieldTypes;
+            return this;
+        }
+
+        public CreateCollectionParam build() {
+            return new CreateCollectionParam(this);
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "CreateCollectionParam{" +
+                "collectionName='" + collectionName + '\'' +
+                ", shardsNum=" + shardsNum +
+                ", description='" + description + '\'' +
+                ", fieldTypes=" + Arrays.toString(fieldTypes) +
+                '}';
+    }
+}

+ 57 - 0
src/main/java/io/milvus/param/collection/DescribeCollectionParam.java

@@ -0,0 +1,57 @@
+/*
+ * 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.collection;
+
+/**
+ * Params for create collection RPC operation
+ *
+ * @author changzechuan
+ */
+public class DescribeCollectionParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public DescribeCollectionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public DescribeCollectionParam build() {
+            return new DescribeCollectionParam(this);
+        }
+    }
+}

+ 57 - 0
src/main/java/io/milvus/param/collection/DropCollectionParam.java

@@ -0,0 +1,57 @@
+/*
+ * 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.collection;
+
+/**
+ * Params for create collection RPC operation
+ *
+ * @author changzechuan
+ */
+public class DropCollectionParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public DropCollectionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public DropCollectionParam build() {
+            return new DropCollectionParam(this);
+        }
+    }
+}

+ 146 - 0
src/main/java/io/milvus/param/collection/FieldType.java

@@ -0,0 +1,146 @@
+/*
+ * 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.collection;
+
+
+import io.milvus.grpc.DataType;
+
+import javax.annotation.Nonnull;
+import java.util.Map;
+
+/**
+ * Field schema for collection
+ *
+ * @author changzechuan
+ */
+public class FieldType {
+    private final long fieldID;
+    private final String name;
+    private final boolean primaryKey;
+    private final String description;
+    private final DataType dataType;
+    private final Map<String,String> typeParams;
+    private final Map<String,String> indexParams;
+    private final boolean autoID;
+
+    private FieldType(@Nonnull Builder builder){
+        this.fieldID = builder.fieldID;
+        this.name = builder.name;
+        this.primaryKey = builder.primaryKey;
+        this.description = builder.description;
+        this.dataType = builder.dataType;
+        this.typeParams = builder.typeParams;
+        this.indexParams = builder.indexParams;
+        this.autoID = builder.autoID;
+    }
+
+    public long getFieldID() {
+        return fieldID;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public boolean isPrimaryKey() {
+        return primaryKey;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public DataType getDataType() {
+        return dataType;
+    }
+
+    public Map<String, String> getTypeParams() {
+        return typeParams;
+    }
+
+    public Map<String, String> getIndexParams() {
+        return indexParams;
+    }
+
+    public boolean isAutoID() {
+        return autoID;
+    }
+
+    public static final class Builder {
+        private long fieldID;
+        private String name;
+        private boolean primaryKey;
+        private String description;
+        private DataType dataType;
+        private Map<String,String> typeParams;
+        private Map<String,String> indexParams;
+        private boolean autoID;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withFieldID(long fieldID) {
+            this.fieldID = fieldID;
+            return this;
+        }
+
+        public Builder withName(String name) {
+            this.name = name;
+            return this;
+        }
+
+        public Builder withPrimaryKey(boolean primaryKey) {
+            this.primaryKey = primaryKey;
+            return this;
+        }
+
+        public Builder withDescription(String description) {
+            this.description = description;
+            return this;
+        }
+
+        public Builder withDataType(DataType dataType) {
+            this.dataType = dataType;
+            return this;
+        }
+
+        public Builder withTypeParams(Map<String, String> typeParams) {
+            this.typeParams = typeParams;
+            return this;
+        }
+
+        public Builder withIndexParams(Map<String, String> indexParams) {
+            this.indexParams = indexParams;
+            return this;
+        }
+
+        public Builder withAutoID(boolean autoID) {
+            this.autoID = autoID;
+            return this;
+        }
+
+        public FieldType build() {
+            return new FieldType(this);
+        }
+    }
+}

+ 57 - 0
src/main/java/io/milvus/param/collection/GetCollectionStatisticsParam.java

@@ -0,0 +1,57 @@
+/*
+ * 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.collection;
+
+/**
+ * Params for create collection RPC operation
+ *
+ * @author changzechuan
+ */
+public class GetCollectionStatisticsParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public GetCollectionStatisticsParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public GetCollectionStatisticsParam build() {
+            return new GetCollectionStatisticsParam(this);
+        }
+    }
+}

+ 57 - 0
src/main/java/io/milvus/param/collection/HasCollectionParam.java

@@ -0,0 +1,57 @@
+/*
+ * 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.collection;
+
+/**
+ * Params for create collection RPC operation
+ *
+ * @author changzechuan
+ */
+public class HasCollectionParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public HasCollectionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public HasCollectionParam build() {
+            return new HasCollectionParam(this);
+        }
+    }
+}

+ 57 - 0
src/main/java/io/milvus/param/collection/LoadCollectionParam.java

@@ -0,0 +1,57 @@
+/*
+ * 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.collection;
+
+/**
+ * Params for create collection RPC operation
+ *
+ * @author changzechuan
+ */
+public class LoadCollectionParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public LoadCollectionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public LoadCollectionParam build() {
+            return new LoadCollectionParam(this);
+        }
+    }
+}

+ 57 - 0
src/main/java/io/milvus/param/collection/ReleaseCollectionParam.java

@@ -0,0 +1,57 @@
+/*
+ * 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.collection;
+
+/**
+ * Params for create collection RPC operation
+ *
+ * @author changzechuan
+ */
+public class ReleaseCollectionParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public ReleaseCollectionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public ReleaseCollectionParam build() {
+            return new ReleaseCollectionParam(this);
+        }
+    }
+}

+ 73 - 0
src/main/java/io/milvus/param/collection/ShowCollectionParam.java

@@ -0,0 +1,73 @@
+/*
+ * 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.collection;
+
+import io.milvus.grpc.ShowType;
+
+import javax.annotation.Nonnull;
+
+/**
+ * Params for ShowCollections RPC operation
+ *
+ * @author changzechuan
+ */
+public class ShowCollectionParam {
+    private final String[] collectionNames;
+    private final ShowType showType;
+
+    public String[] getCollectionNames() {
+        return collectionNames;
+    }
+
+    public ShowType getShowType() {
+        return showType;
+    }
+
+    public ShowCollectionParam(@Nonnull Builder builder) {
+        this.collectionNames = builder.collectionNames;
+        this.showType = builder.showType;
+    }
+
+    public static final class Builder {
+        private String[] collectionNames;
+        private ShowType showType;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionNames(String[] collectionNames) {
+            this.collectionNames = collectionNames;
+            return this;
+        }
+
+        public Builder withShowType(ShowType showType) {
+            this.showType = showType;
+            return this;
+        }
+
+        public ShowCollectionParam build() {
+            return new ShowCollectionParam(this);
+        }
+    }
+}

+ 82 - 0
src/main/java/io/milvus/param/index/CreateIndexParam.java

@@ -0,0 +1,82 @@
+/*
+ * 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.index;
+
+import java.util.Map;
+
+/**
+ * @author changzechuan
+ */
+public class CreateIndexParam {
+    private final String collectionName;
+    private final String fieldName;
+    private final Map<String,String> extraParam;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getFieldName() {
+        return fieldName;
+    }
+
+    public Map<String,String> getExtraParam() {
+        return extraParam;
+    }
+
+
+    public CreateIndexParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.fieldName = builder.fieldName;
+        this.extraParam = builder.extraParam;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String fieldName;
+        private Map<String,String> extraParam;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withFieldName(String fieldName) {
+            this.fieldName = fieldName;
+            return this;
+        }
+
+        public Builder withExtraParam(Map<String,String> extraParam) {
+            this.extraParam = extraParam;
+            return this;
+        }
+
+        public CreateIndexParam build() {
+            return new CreateIndexParam(this);
+        }
+    }
+}

+ 67 - 0
src/main/java/io/milvus/param/index/DescribeIndexParam.java

@@ -0,0 +1,67 @@
+/*
+ * 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.index;
+
+/**
+ * @author changzechuan
+ */
+public class DescribeIndexParam {
+    private final String collectionName;
+    private final String fieldName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getFieldName() {
+        return fieldName;
+    }
+
+    public DescribeIndexParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.fieldName = builder.fieldName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String fieldName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withFieldName(String fieldName) {
+            this.fieldName = fieldName;
+            return this;
+        }
+
+        public DescribeIndexParam build() {
+            return new DescribeIndexParam(this);
+        }
+    }
+}

+ 67 - 0
src/main/java/io/milvus/param/index/DropIndexParam.java

@@ -0,0 +1,67 @@
+/*
+ * 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.index;
+
+/**
+ * @author changzechuan
+ */
+public class DropIndexParam {
+    private final String collectionName;
+    private final String fieldName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getFieldName() {
+        return fieldName;
+    }
+
+    public DropIndexParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.fieldName = builder.fieldName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String fieldName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withFieldName(String fieldName) {
+            this.fieldName = fieldName;
+            return this;
+        }
+
+        public DropIndexParam build() {
+            return new DropIndexParam(this);
+        }
+    }
+}

+ 79 - 0
src/main/java/io/milvus/param/index/GetIndexBuildProgressParam.java

@@ -0,0 +1,79 @@
+/*
+ * 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.index;
+
+/**
+ * @author changzechuan
+ */
+public class GetIndexBuildProgressParam {
+    private final String collectionName;
+    private final String fieldName;
+    private final String indexName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getFieldName() {
+        return fieldName;
+    }
+
+    public String getIndexName() {
+        return indexName;
+    }
+
+    public GetIndexBuildProgressParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.fieldName = builder.fieldName;
+        this.indexName = builder.indexName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String fieldName;
+        private String indexName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withFieldName(String fieldName) {
+            this.fieldName = fieldName;
+            return this;
+        }
+
+        public Builder withIndexName(String indexName) {
+            this.indexName = indexName;
+            return this;
+        }
+
+        public GetIndexBuildProgressParam build() {
+            return new GetIndexBuildProgressParam(this);
+        }
+    }
+}

+ 67 - 0
src/main/java/io/milvus/param/index/GetIndexStateParam.java

@@ -0,0 +1,67 @@
+/*
+ * 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.index;
+
+/**
+ * @author changzechuan
+ */
+public class GetIndexStateParam {
+    private final String collectionName;
+    private final String fieldName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getFieldName() {
+        return fieldName;
+    }
+
+    public GetIndexStateParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.fieldName = builder.fieldName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String fieldName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withFieldName(String fieldName) {
+            this.fieldName = fieldName;
+            return this;
+        }
+
+        public GetIndexStateParam build() {
+            return new GetIndexStateParam(this);
+        }
+    }
+}

+ 69 - 0
src/main/java/io/milvus/param/partition/CreatePartitionParam.java

@@ -0,0 +1,69 @@
+/*
+ * 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.partition;
+
+/**
+ * Params for create partition RPC operation
+ *
+ * @author changzechuan
+ */
+public class CreatePartitionParam {
+    private final String collectionName;
+    private final String partitionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getPartitionName() {
+        return partitionName;
+    }
+
+    public CreatePartitionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionName = builder.partitionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String partitionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withPartitionName(String partitionName) {
+            this.partitionName = partitionName;
+            return this;
+        }
+
+        public CreatePartitionParam build() {
+            return new CreatePartitionParam(this);
+        }
+    }
+}

+ 69 - 0
src/main/java/io/milvus/param/partition/DropPartitionParam.java

@@ -0,0 +1,69 @@
+/*
+ * 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.partition;
+
+/**
+ * Params for drop partition RPC operation
+ *
+ * @author changzechuan
+ */
+public class DropPartitionParam {
+    private final String collectionName;
+    private final String partitionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getPartitionName() {
+        return partitionName;
+    }
+
+    public DropPartitionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionName = builder.partitionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String partitionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withPartitionName(String partitionName) {
+            this.partitionName = partitionName;
+            return this;
+        }
+
+        public DropPartitionParam build() {
+            return new DropPartitionParam(this);
+        }
+    }
+}

+ 69 - 0
src/main/java/io/milvus/param/partition/GetPartitionStatisticsParam.java

@@ -0,0 +1,69 @@
+/*
+ * 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.partition;
+
+/**
+ * Params for get partition statistics RPC operation
+ *
+ * @author changzechuan
+ */
+public class GetPartitionStatisticsParam {
+    private final String collectionName;
+    private final String partitionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getPartitionName() {
+        return partitionName;
+    }
+
+    public GetPartitionStatisticsParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionName = builder.partitionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String partitionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withPartitionName(String partitionName) {
+            this.partitionName = partitionName;
+            return this;
+        }
+
+        public GetPartitionStatisticsParam build() {
+            return new GetPartitionStatisticsParam(this);
+        }
+    }
+}

+ 69 - 0
src/main/java/io/milvus/param/partition/HasPartitionParam.java

@@ -0,0 +1,69 @@
+/*
+ * 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.partition;
+
+/**
+ * Params for has partition RPC operation
+ *
+ * @author changzechuan
+ */
+public class HasPartitionParam {
+    private final String collectionName;
+    private final String partitionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String getPartitionName() {
+        return partitionName;
+    }
+
+    public HasPartitionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionName = builder.partitionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String partitionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withPartitionName(String partitionName) {
+            this.partitionName = partitionName;
+            return this;
+        }
+
+        public HasPartitionParam build() {
+            return new HasPartitionParam(this);
+        }
+    }
+}

+ 69 - 0
src/main/java/io/milvus/param/partition/LoadPartitionsParam.java

@@ -0,0 +1,69 @@
+/*
+ * 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.partition;
+
+/**
+ * Params for load partitions RPC operation
+ *
+ * @author changzechuan
+ */
+public class LoadPartitionsParam {
+    private final String collectionName;
+    private final String[] partitionNames;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String[] getPartitionNames() {
+        return partitionNames;
+    }
+
+    public LoadPartitionsParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionNames = builder.partitionNames;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String[] partitionNames;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withPartitionNames(String[] partitionNames) {
+            this.partitionNames = partitionNames;
+            return this;
+        }
+
+        public LoadPartitionsParam build() {
+            return new LoadPartitionsParam(this);
+        }
+    }
+}

+ 69 - 0
src/main/java/io/milvus/param/partition/ReleasePartitionsParam.java

@@ -0,0 +1,69 @@
+/*
+ * 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.partition;
+
+/**
+ * Params release partitions RPC operation
+ *
+ * @author changzechuan
+ */
+public class ReleasePartitionsParam {
+    private final String collectionName;
+    private final String[] partitionNames;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+    public String[] getPartitionNames() {
+        return partitionNames;
+    }
+
+    public ReleasePartitionsParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+        this.partitionNames = builder.partitionNames;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+        private String[] partitionNames;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public Builder withPartitionNames(String[] partitionNames) {
+            this.partitionNames = partitionNames;
+            return this;
+        }
+
+        public ReleasePartitionsParam build() {
+            return new ReleasePartitionsParam(this);
+        }
+    }
+}

+ 58 - 0
src/main/java/io/milvus/param/partition/ShowPartitionParam.java

@@ -0,0 +1,58 @@
+/*
+ * 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.partition;
+
+/**
+ * Params for show partition RPC operation
+ *
+ * @author changzechuan
+ */
+public class ShowPartitionParam {
+    private final String collectionName;
+
+    public String getCollectionName() {
+        return collectionName;
+    }
+
+
+    public ShowPartitionParam(Builder builder) {
+        this.collectionName = builder.collectionName;
+    }
+
+    public static final class Builder {
+        private String collectionName;
+
+        private Builder() {
+        }
+
+        public static Builder newBuilder() {
+            return new Builder();
+        }
+
+        public Builder withCollectionName(String collectionName) {
+            this.collectionName = collectionName;
+            return this;
+        }
+
+        public ShowPartitionParam build() {
+            return new ShowPartitionParam(this);
+        }
+    }
+}