Browse Source

Refine code (#917)

Signed-off-by: yhmo <yihua.mo@zilliz.com>
groot 1 year ago
parent
commit
9bf2f266de
100 changed files with 2488 additions and 79 deletions
  1. 1 1
      examples/main/java/io/milvus/BinaryVectorExample.java
  2. 26 21
      src/main/java/io/milvus/param/ParamUtils.java
  3. 1 2
      src/main/java/io/milvus/param/dml/InsertParam.java
  4. 19 0
      src/main/java/io/milvus/param/dml/UpsertParam.java
  5. 1 2
      src/main/java/io/milvus/param/highlevel/dml/InsertRowsParam.java
  6. 19 0
      src/main/java/io/milvus/v2/client/ConnectConfig.java
  7. 19 0
      src/main/java/io/milvus/v2/client/MilvusClientV2.java
  8. 19 0
      src/main/java/io/milvus/v2/common/ConsistencyLevel.java
  9. 19 0
      src/main/java/io/milvus/v2/common/DataType.java
  10. 19 0
      src/main/java/io/milvus/v2/common/IndexParam.java
  11. 23 1
      src/main/java/io/milvus/v2/examples/Simple.java
  12. 23 1
      src/main/java/io/milvus/v2/examples/Simple_Schema.java
  13. 19 0
      src/main/java/io/milvus/v2/exception/ErrorCode.java
  14. 19 0
      src/main/java/io/milvus/v2/exception/MilvusClientException.java
  15. 19 0
      src/main/java/io/milvus/v2/service/BaseService.java
  16. 19 0
      src/main/java/io/milvus/v2/service/collection/CollectionService.java
  17. 19 0
      src/main/java/io/milvus/v2/service/collection/request/AddFieldReq.java
  18. 19 0
      src/main/java/io/milvus/v2/service/collection/request/CreateCollectionReq.java
  19. 19 0
      src/main/java/io/milvus/v2/service/collection/request/DescribeCollectionReq.java
  20. 19 0
      src/main/java/io/milvus/v2/service/collection/request/DropCollectionReq.java
  21. 19 0
      src/main/java/io/milvus/v2/service/collection/request/GetCollectionStatsReq.java
  22. 19 0
      src/main/java/io/milvus/v2/service/collection/request/GetLoadStateReq.java
  23. 19 0
      src/main/java/io/milvus/v2/service/collection/request/HasCollectionReq.java
  24. 19 0
      src/main/java/io/milvus/v2/service/collection/request/LoadCollectionReq.java
  25. 19 0
      src/main/java/io/milvus/v2/service/collection/request/ReleaseCollectionReq.java
  26. 19 0
      src/main/java/io/milvus/v2/service/collection/request/RenameCollectionReq.java
  27. 19 0
      src/main/java/io/milvus/v2/service/collection/response/DescribeCollectionResp.java
  28. 19 0
      src/main/java/io/milvus/v2/service/collection/response/GetCollectionStatsResp.java
  29. 19 0
      src/main/java/io/milvus/v2/service/collection/response/ListCollectionsResp.java
  30. 19 0
      src/main/java/io/milvus/v2/service/index/IndexService.java
  31. 19 0
      src/main/java/io/milvus/v2/service/index/request/CreateIndexReq.java
  32. 19 0
      src/main/java/io/milvus/v2/service/index/request/DescribeIndexReq.java
  33. 19 0
      src/main/java/io/milvus/v2/service/index/request/DropIndexReq.java
  34. 19 0
      src/main/java/io/milvus/v2/service/index/request/ListIndexesReq.java
  35. 19 0
      src/main/java/io/milvus/v2/service/index/response/DescribeIndexResp.java
  36. 19 0
      src/main/java/io/milvus/v2/service/partition/PartitionService.java
  37. 19 0
      src/main/java/io/milvus/v2/service/partition/request/CreatePartitionReq.java
  38. 19 0
      src/main/java/io/milvus/v2/service/partition/request/DropPartitionReq.java
  39. 19 0
      src/main/java/io/milvus/v2/service/partition/request/HasPartitionReq.java
  40. 19 0
      src/main/java/io/milvus/v2/service/partition/request/ListPartitionsReq.java
  41. 19 0
      src/main/java/io/milvus/v2/service/partition/request/LoadPartitionsReq.java
  42. 19 0
      src/main/java/io/milvus/v2/service/partition/request/ReleasePartitionsReq.java
  43. 19 0
      src/main/java/io/milvus/v2/service/rbac/RoleService.java
  44. 19 0
      src/main/java/io/milvus/v2/service/rbac/UserService.java
  45. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/CreateRoleReq.java
  46. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/CreateUserReq.java
  47. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/DescribeRoleReq.java
  48. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/DescribeUserReq.java
  49. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/DropRoleReq.java
  50. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/DropUserReq.java
  51. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/GrantPrivilegeReq.java
  52. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/GrantRoleReq.java
  53. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/RevokePrivilegeReq.java
  54. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/RevokeRoleReq.java
  55. 19 0
      src/main/java/io/milvus/v2/service/rbac/request/UpdatePasswordReq.java
  56. 19 0
      src/main/java/io/milvus/v2/service/rbac/response/DescribeRoleResp.java
  57. 19 0
      src/main/java/io/milvus/v2/service/rbac/response/DescribeUserResp.java
  58. 19 0
      src/main/java/io/milvus/v2/service/utility/UtilityService.java
  59. 19 0
      src/main/java/io/milvus/v2/service/utility/request/AlterAliasReq.java
  60. 19 0
      src/main/java/io/milvus/v2/service/utility/request/CreateAliasReq.java
  61. 19 0
      src/main/java/io/milvus/v2/service/utility/request/DescribeAliasReq.java
  62. 19 0
      src/main/java/io/milvus/v2/service/utility/request/DropAliasReq.java
  63. 19 0
      src/main/java/io/milvus/v2/service/utility/request/FlushReq.java
  64. 19 0
      src/main/java/io/milvus/v2/service/utility/request/ListAliasesReq.java
  65. 19 0
      src/main/java/io/milvus/v2/service/utility/response/DescribeAliasResp.java
  66. 19 0
      src/main/java/io/milvus/v2/service/utility/response/ListAliasResp.java
  67. 19 0
      src/main/java/io/milvus/v2/service/vector/VectorService.java
  68. 19 0
      src/main/java/io/milvus/v2/service/vector/request/DeleteReq.java
  69. 19 0
      src/main/java/io/milvus/v2/service/vector/request/GetReq.java
  70. 42 0
      src/main/java/io/milvus/v2/service/vector/request/InsertReq.java
  71. 19 0
      src/main/java/io/milvus/v2/service/vector/request/QueryReq.java
  72. 21 1
      src/main/java/io/milvus/v2/service/vector/request/SearchReq.java
  73. 41 0
      src/main/java/io/milvus/v2/service/vector/request/UpsertReq.java
  74. 27 0
      src/main/java/io/milvus/v2/service/vector/request/data/BaseVector.java
  75. 42 0
      src/main/java/io/milvus/v2/service/vector/request/data/BinaryVec.java
  76. 42 0
      src/main/java/io/milvus/v2/service/vector/request/data/FloatVec.java
  77. 19 0
      src/main/java/io/milvus/v2/service/vector/response/DeleteResp.java
  78. 19 0
      src/main/java/io/milvus/v2/service/vector/response/GetResp.java
  79. 19 0
      src/main/java/io/milvus/v2/service/vector/response/InsertResp.java
  80. 19 0
      src/main/java/io/milvus/v2/service/vector/response/QueryResp.java
  81. 19 0
      src/main/java/io/milvus/v2/service/vector/response/SearchResp.java
  82. 19 0
      src/main/java/io/milvus/v2/service/vector/response/UpsertResp.java
  83. 19 0
      src/main/java/io/milvus/v2/utils/ClientUtils.java
  84. 19 0
      src/main/java/io/milvus/v2/utils/ConvertUtils.java
  85. 19 0
      src/main/java/io/milvus/v2/utils/DataUtils.java
  86. 19 0
      src/main/java/io/milvus/v2/utils/RpcUtils.java
  87. 19 0
      src/main/java/io/milvus/v2/utils/SchemaUtils.java
  88. 37 47
      src/main/java/io/milvus/v2/utils/VectorUtils.java
  89. 19 0
      src/test/java/io/milvus/v2/BaseTest.java
  90. 549 0
      src/test/java/io/milvus/v2/client/MilvusClientV2DockerTest.java
  91. 19 0
      src/test/java/io/milvus/v2/client/MilvusClientV2Test.java
  92. 19 0
      src/test/java/io/milvus/v2/service/collection/CollectionTest.java
  93. 19 0
      src/test/java/io/milvus/v2/service/index/IndexTest.java
  94. 19 0
      src/test/java/io/milvus/v2/service/partition/PartitionTest.java
  95. 19 0
      src/test/java/io/milvus/v2/service/rbac/RoleTest.java
  96. 19 0
      src/test/java/io/milvus/v2/service/rbac/UserTest.java
  97. 19 0
      src/test/java/io/milvus/v2/service/utility/UtilityTest.java
  98. 21 1
      src/test/java/io/milvus/v2/service/vector/VectorTest.java
  99. 6 1
      tests/milvustestv2/src/main/java/com/zilliz/milvustestv2/common/CommonFunction.java
  100. 8 1
      tests/milvustestv2/src/test/java/com/zilliz/milvustestv2/loadRelease/LoadPartitionsTest.java

+ 1 - 1
examples/main/java/io/milvus/BinaryVectorExample.java

@@ -37,7 +37,7 @@ import java.nio.ByteBuffer;
 import java.util.*;
 
 public class BinaryVectorExample {
-    private static final String COLLECTION_NAME = "java_sdk_example_sparse";
+    private static final String COLLECTION_NAME = "java_sdk_example_binary";
     private static final String ID_FIELD = "id";
     private static final String VECTOR_FIELD = "vector";
 

+ 26 - 21
src/main/java/io/milvus/param/ParamUtils.java

@@ -92,11 +92,7 @@ public class ParamUtils {
         if (dataType == DataType.BinaryVector) {
             return byteCount*8; // for BinaryVector, each byte is 8 dimensions
         } else {
-            if (byteCount%2 != 0) {
-                String msg = "Incorrect byte count for %s type field, byte count is %d, cannot be evenly divided by 2";
-                throw new ParamException(String.format(msg, dataType.name(), byteCount));
-            }
-            return byteCount/2; // for float16/bfloat16, each dimension is 2 bytes
+            throw new ParamException(String.format("%s is not binary vector type", dataType.name()));
         }
     }
 
@@ -584,21 +580,8 @@ public class ParamUtils {
     }
 
     @SuppressWarnings("unchecked")
-    public static SearchRequest convertSearchParam(@NonNull SearchParam requestParam) throws ParamException {
-        SearchRequest.Builder builder = SearchRequest.newBuilder()
-                .setCollectionName(requestParam.getCollectionName());
-
-        if (!requestParam.getPartitionNames().isEmpty()) {
-            requestParam.getPartitionNames().forEach(builder::addPartitionNames);
-        }
-        if (StringUtils.isNotEmpty(requestParam.getDatabaseName())) {
-            builder.setDbName(requestParam.getDatabaseName());
-        }
-
-        // prepare target vectors
-        // TODO: check target vector dimension(use DescribeCollection get schema to compare)
+    public static ByteString convertPlaceholder(List<?> vectors, PlaceholderType placeType) throws ParamException {
         PlaceholderType plType = PlaceholderType.None;
-        List<?> vectors = requestParam.getVectors();
         List<ByteString> byteStrings = new ArrayList<>();
         for (Object vector : vectors) {
             if (vector instanceof List) {
@@ -618,11 +601,17 @@ public class ParamUtils {
                 ByteString bs = ByteString.copyFrom(array);
                 byteStrings.add(bs);
             } else {
-                String msg = "Search target vector type is illegal(Only allow List<Float> or ByteBuffer)";
+                String msg = "Search target vector type is illegal." +
+                        " Only allow List<Float> for FloatVector, ByteBuffer for BinaryVector";
                 throw new ParamException(msg);
             }
         }
 
+        // force specify PlaceholderType
+        if (placeType != PlaceholderType.None) {
+            plType = placeType;
+        }
+
         PlaceholderValue.Builder pldBuilder = PlaceholderValue.newBuilder()
                 .setTag(Constant.VECTOR_TAG)
                 .setType(plType);
@@ -633,7 +622,23 @@ public class ParamUtils {
                 .addPlaceholders(plv)
                 .build();
 
-        ByteString byteStr = placeholderGroup.toByteString();
+        return placeholderGroup.toByteString();
+    }
+
+    @SuppressWarnings("unchecked")
+    public static SearchRequest convertSearchParam(@NonNull SearchParam requestParam) throws ParamException {
+        SearchRequest.Builder builder = SearchRequest.newBuilder()
+                .setCollectionName(requestParam.getCollectionName());
+
+        if (!requestParam.getPartitionNames().isEmpty()) {
+            requestParam.getPartitionNames().forEach(builder::addPartitionNames);
+        }
+        if (StringUtils.isNotEmpty(requestParam.getDatabaseName())) {
+            builder.setDbName(requestParam.getDatabaseName());
+        }
+
+        // prepare target vectors
+        ByteString byteStr = convertPlaceholder(requestParam.getVectors(), PlaceholderType.None);
         builder.setPlaceholderGroup(byteStr);
         builder.setNq(requestParam.getNQ());
 

+ 1 - 2
src/main/java/io/milvus/param/dml/InsertParam.java

@@ -123,8 +123,7 @@ public class InsertParam {
          * Internal class for insert data.
          * If dataType is Bool/Int8/Int16/Int32/Int64/Float/Double/Varchar, use JsonObject.addProperty(key, value) to input;
          * If dataType is FloatVector, use JsonObject.add(key, gson.toJsonTree(List[Float]) to input;
-         * If dataType is BinaryVector/Float16Vector/BFloat16Vector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
-         * If dataType is SparseFloatVector, use JsonObject.add(key, gson.toJsonTree(SortedMap[Long, Float])) to input;
+         * If dataType is BinaryVector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
          * If dataType is Array, use JsonObject.add(key, gson.toJsonTree(List of Boolean/Integer/Short/Long/Float/Double/String)) to input;
          * If dataType is JSON, use JsonObject.add(key, JsonElement) to input;
          *

+ 19 - 0
src/main/java/io/milvus/param/dml/UpsertParam.java

@@ -78,6 +78,25 @@ public class UpsertParam extends InsertParam {
         /**
          * Sets the row data to insert. The rows list cannot be empty.
          *
+         * Internal class for insert data.
+         * If dataType is Bool/Int8/Int16/Int32/Int64/Float/Double/Varchar, use JsonObject.addProperty(key, value) to input;
+         * If dataType is FloatVector, use JsonObject.add(key, gson.toJsonTree(List[Float]) to input;
+         * If dataType is BinaryVector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
+         * If dataType is Array, use JsonObject.add(key, gson.toJsonTree(List of Boolean/Integer/Short/Long/Float/Double/String)) to input;
+         * If dataType is JSON, use JsonObject.add(key, JsonElement) to input;
+         *
+         * Note:
+         * 1. For scalar numeric values, value will be cut according to the type of the field.
+         * For example:
+         *   An Int8 field named "XX", you set the value to be 128 by JsonObject.add("XX", 128), the value 128 is cut to -128.
+         *   An Int64 field named "XX", you set the value to be 3.9 by JsonObject.add("XX", 3.9), the value 3.9 is cut to 3.
+         *
+         * 2. String value can be parsed to numeric/boolean type if the value is valid.
+         * For example:
+         *   A Bool field named "XX", you set the value to be "TRUE" by JsonObject.add("XX", "TRUE"), the string "TRUE" is parsed as true.
+         *   A Float field named "XX", you set the value to be "3.5" by JsonObject.add("XX", "3.5", the string "3.5" is parsed as 3.5.
+         *
+         *
          * @param rows insert row data
          * @return <code>Builder</code>
          * @see JsonObject

+ 1 - 2
src/main/java/io/milvus/param/highlevel/dml/InsertRowsParam.java

@@ -74,8 +74,7 @@ public class InsertRowsParam {
          * Internal class for insert data.
          * If dataType is Bool/Int8/Int16/Int32/Int64/Float/Double/Varchar, use JsonObject.addProperty(key, value) to input;
          * If dataType is FloatVector, use JsonObject.add(key, gson.toJsonTree(List[Float])) to input;
-         * If dataType is BinaryVector/Float16Vector/BFloat16Vector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
-         * If dataType is SparseFloatVector, use JsonObject.add(key, gson.toJsonTree(SortedMap[Long, Float])) to input;
+         * If dataType is BinaryVector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
          * If dataType is Array, use JsonObject.add(key, gson.toJsonTree(List of Boolean/Integer/Short/Long/Float/Double/String)) to input;
          * If dataType is JSON, use JsonObject.add(key, JsonElement) to input;
          *

+ 19 - 0
src/main/java/io/milvus/v2/client/ConnectConfig.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.client;
 
 import lombok.Builder;

+ 19 - 0
src/main/java/io/milvus/v2/client/MilvusClientV2.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.client;
 
 import io.grpc.ManagedChannel;

+ 19 - 0
src/main/java/io/milvus/v2/common/ConsistencyLevel.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.common;
 
 import lombok.Getter;

+ 19 - 0
src/main/java/io/milvus/v2/common/DataType.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.common;
 
 import lombok.Getter;

+ 19 - 0
src/main/java/io/milvus/v2/common/IndexParam.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.common;
 
 import lombok.Builder;

+ 23 - 1
src/main/java/io/milvus/v2/examples/Simple.java

@@ -1,6 +1,26 @@
+/*
+ * 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.v2.examples;
 
 import com.google.gson.*;
+import com.google.gson.reflect.TypeToken;
 import io.milvus.v2.client.ConnectConfig;
 import io.milvus.v2.client.MilvusClientV2;
 import io.milvus.v2.exception.MilvusClientException;
@@ -11,6 +31,7 @@ import io.milvus.v2.service.collection.request.HasCollectionReq;
 import io.milvus.v2.service.vector.request.InsertReq;
 import io.milvus.v2.service.vector.request.QueryReq;
 import io.milvus.v2.service.vector.request.SearchReq;
+import io.milvus.v2.service.vector.request.data.FloatVec;
 import io.milvus.v2.service.vector.response.QueryResp;
 import io.milvus.v2.service.vector.response.SearchResp;
 import org.slf4j.Logger;
@@ -82,9 +103,10 @@ public class Simple {
         QueryResp queryResp = client.query(queryReq);
         System.out.println(queryResp);
         //search data
+        List<Float> vector = new Gson().fromJson(insertData.get(0).get("vector"), new TypeToken<List<Float>>() {}.getType());
         SearchReq searchReq = SearchReq.builder()
                 .collectionName(collectionName)
-                .data(Collections.singletonList(insertData.get(0).get("vector")))
+                .data(Collections.singletonList(new FloatVec(vector)))
                 .topK(10)
                 .build();
         SearchResp searchResp = client.search(searchReq);

+ 23 - 1
src/main/java/io/milvus/v2/examples/Simple_Schema.java

@@ -1,6 +1,26 @@
+/*
+ * 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.v2.examples;
 
 import com.google.gson.*;
+import com.google.gson.reflect.TypeToken;
 import io.milvus.v2.client.ConnectConfig;
 import io.milvus.v2.client.MilvusClientV2;
 import io.milvus.v2.common.DataType;
@@ -10,6 +30,7 @@ import io.milvus.v2.service.index.request.CreateIndexReq;
 import io.milvus.v2.service.vector.request.InsertReq;
 import io.milvus.v2.service.vector.request.QueryReq;
 import io.milvus.v2.service.vector.request.SearchReq;
+import io.milvus.v2.service.vector.request.data.FloatVec;
 import io.milvus.v2.service.vector.response.QueryResp;
 import io.milvus.v2.service.vector.response.SearchResp;
 import org.slf4j.Logger;
@@ -95,9 +116,10 @@ public class Simple_Schema {
         queryResp.getQueryResults().get(0).getEntity().get("vector");
         System.out.println(queryResp);
         //search data
+        List<Float> vector = new Gson().fromJson(insertData.get(0).get("vector"), new TypeToken<List<Float>>() {}.getType());
         SearchReq searchReq = SearchReq.builder()
                 .collectionName(collectionName)
-                .data(Collections.singletonList(insertData.get(0).get("vector")))
+                .data(Collections.singletonList(new FloatVec(vector)))
                 .outputFields(Collections.singletonList("vector"))
                 .topK(10)
                 .build();

+ 19 - 0
src/main/java/io/milvus/v2/exception/ErrorCode.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.exception;
 
 import lombok.Getter;

+ 19 - 0
src/main/java/io/milvus/v2/exception/MilvusClientException.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.exception;
 
 import lombok.Getter;

+ 19 - 0
src/main/java/io/milvus/v2/service/BaseService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service;
 
 import io.milvus.grpc.BoolResponse;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/CollectionService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection;
 
 import io.milvus.grpc.*;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/AddFieldReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import io.milvus.v2.common.DataType;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/CreateCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import io.milvus.v2.common.DataType;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/DescribeCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/DropCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Builder;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/GetCollectionStatsReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/GetLoadStateReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/HasCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/LoadCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Builder;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/ReleaseCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Builder;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/request/RenameCollectionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/response/DescribeCollectionResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.response;
 
 import io.milvus.v2.service.collection.request.CreateCollectionReq;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/response/GetCollectionStatsResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/collection/response/ListCollectionsResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/index/IndexService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index;
 
 import io.milvus.grpc.*;

+ 19 - 0
src/main/java/io/milvus/v2/service/index/request/CreateIndexReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index.request;
 
 import io.milvus.v2.common.IndexParam;

+ 19 - 0
src/main/java/io/milvus/v2/service/index/request/DescribeIndexReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/index/request/DropIndexReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/index/request/ListIndexesReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/index/response/DescribeIndexResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/PartitionService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition;
 
 import io.milvus.grpc.CreatePartitionRequest;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/request/CreatePartitionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/request/DropPartitionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/request/HasPartitionReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/request/ListPartitionsReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/request/LoadPartitionsReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/partition/request/ReleasePartitionsReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/RoleService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac;
 
 import io.milvus.grpc.*;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/UserService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac;
 
 import io.milvus.grpc.*;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/CreateRoleReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/CreateUserReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/DescribeRoleReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/DescribeUserReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/DropRoleReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/DropUserReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/GrantPrivilegeReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/GrantRoleReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/RevokePrivilegeReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/RevokeRoleReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/request/UpdatePasswordReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/response/DescribeRoleResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.response;
 
 import io.milvus.grpc.GrantEntity;

+ 19 - 0
src/main/java/io/milvus/v2/service/rbac/response/DescribeUserResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/UtilityService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility;
 
 import io.milvus.grpc.FlushResponse;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/request/AlterAliasReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/request/CreateAliasReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/request/DescribeAliasReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/request/DropAliasReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/request/FlushReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/request/ListAliasesReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.request;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/response/DescribeAliasResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/utility/response/ListAliasResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/VectorService.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector;
 
 import io.milvus.grpc.*;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/request/DeleteReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.request;
 
 import lombok.Builder;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/request/GetReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.request;
 
 import lombok.Builder;

+ 42 - 0
src/main/java/io/milvus/v2/service/vector/request/InsertReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.request;
 
 import com.google.gson.JsonObject;
@@ -11,6 +30,29 @@ import java.util.List;
 @SuperBuilder
 public class InsertReq {
     //private List<> fields;
+
+    /**
+     * Sets the row data to insert. The rows list cannot be empty.
+     *
+     * Internal class for insert data.
+     * If dataType is Bool/Int8/Int16/Int32/Int64/Float/Double/Varchar, use JsonObject.addProperty(key, value) to input;
+     * If dataType is FloatVector, use JsonObject.add(key, gson.toJsonTree(List[Float]) to input;
+     * If dataType is BinaryVector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
+     * If dataType is Array, use JsonObject.add(key, gson.toJsonTree(List of Boolean/Integer/Short/Long/Float/Double/String)) to input;
+     * If dataType is JSON, use JsonObject.add(key, JsonElement) to input;
+     *
+     * Note:
+     * 1. For scalar numeric values, value will be cut according to the type of the field.
+     * For example:
+     *   An Int8 field named "XX", you set the value to be 128 by JsonObject.add("XX", 128), the value 128 is cut to -128.
+     *   An Int64 field named "XX", you set the value to be 3.9 by JsonObject.add("XX", 3.9), the value 3.9 is cut to 3.
+     *
+     * 2. String value can be parsed to numeric/boolean type if the value is valid.
+     * For example:
+     *   A Bool field named "XX", you set the value to be "TRUE" by JsonObject.add("XX", "TRUE"), the string "TRUE" is parsed as true.
+     *   A Float field named "XX", you set the value to be "3.5" by JsonObject.add("XX", "3.5", the string "3.5" is parsed as 3.5.
+     *
+     */
     private List<JsonObject> data;
     private String collectionName;
     @Builder.Default

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/request/QueryReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.request;
 
 import io.milvus.v2.common.ConsistencyLevel;

+ 21 - 1
src/main/java/io/milvus/v2/service/vector/request/SearchReq.java

@@ -1,6 +1,26 @@
+/*
+ * 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.v2.service.vector.request;
 
 import io.milvus.v2.common.ConsistencyLevel;
+import io.milvus.v2.service.vector.request.data.BaseVector;
 import lombok.Builder;
 import lombok.Data;
 import lombok.experimental.SuperBuilder;
@@ -22,7 +42,7 @@ public class SearchReq {
     private String filter;
     @Builder.Default
     private List<String> outputFields = new ArrayList<>();
-    private List<?> data;
+    private List<BaseVector> data;
     private long offset;
     private long limit;
 

+ 41 - 0
src/main/java/io/milvus/v2/service/vector/request/UpsertReq.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.request;
 
 import com.google.gson.JsonObject;
@@ -10,6 +29,28 @@ import java.util.List;
 @Data
 @SuperBuilder
 public class UpsertReq {
+    /**
+     * Sets the row data to insert. The rows list cannot be empty.
+     *
+     * Internal class for insert data.
+     * If dataType is Bool/Int8/Int16/Int32/Int64/Float/Double/Varchar, use JsonObject.addProperty(key, value) to input;
+     * If dataType is FloatVector, use JsonObject.add(key, gson.toJsonTree(List[Float]) to input;
+     * If dataType is BinaryVector, use JsonObject.add(key, gson.toJsonTree(byte[])) to input;
+     * If dataType is Array, use JsonObject.add(key, gson.toJsonTree(List of Boolean/Integer/Short/Long/Float/Double/String)) to input;
+     * If dataType is JSON, use JsonObject.add(key, JsonElement) to input;
+     *
+     * Note:
+     * 1. For scalar numeric values, value will be cut according to the type of the field.
+     * For example:
+     *   An Int8 field named "XX", you set the value to be 128 by JsonObject.add("XX", 128), the value 128 is cut to -128.
+     *   An Int64 field named "XX", you set the value to be 3.9 by JsonObject.add("XX", 3.9), the value 3.9 is cut to 3.
+     *
+     * 2. String value can be parsed to numeric/boolean type if the value is valid.
+     * For example:
+     *   A Bool field named "XX", you set the value to be "TRUE" by JsonObject.add("XX", "TRUE"), the string "TRUE" is parsed as true.
+     *   A Float field named "XX", you set the value to be "3.5" by JsonObject.add("XX", "3.5", the string "3.5" is parsed as 3.5.
+     *
+     */
     private List<JsonObject> data;
     private String collectionName;
     @Builder.Default

+ 27 - 0
src/main/java/io/milvus/v2/service/vector/request/data/BaseVector.java

@@ -0,0 +1,27 @@
+/*
+ * 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.v2.service.vector.request.data;
+
+import io.milvus.grpc.PlaceholderType;
+
+public interface BaseVector {
+    PlaceholderType getPlaceholderType();
+    Object getData();
+}

+ 42 - 0
src/main/java/io/milvus/v2/service/vector/request/data/BinaryVec.java

@@ -0,0 +1,42 @@
+/*
+ * 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.v2.service.vector.request.data;
+
+import io.milvus.grpc.PlaceholderType;
+
+import java.nio.ByteBuffer;
+
+public class BinaryVec implements BaseVector {
+    private final ByteBuffer data;
+
+    public BinaryVec(ByteBuffer data) {
+        this.data = data;
+    }
+
+    @Override
+    public PlaceholderType getPlaceholderType() {
+        return PlaceholderType.BinaryVector;
+    }
+
+    @Override
+    public Object getData() {
+        return this.data;
+    }
+}

+ 42 - 0
src/main/java/io/milvus/v2/service/vector/request/data/FloatVec.java

@@ -0,0 +1,42 @@
+/*
+ * 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.v2.service.vector.request.data;
+
+
+import io.milvus.grpc.PlaceholderType;
+import java.util.List;
+
+public class FloatVec implements BaseVector {
+    private final List<Float> data;
+
+    public FloatVec(List<Float> data) {
+        this.data = data;
+    }
+
+    @Override
+    public PlaceholderType getPlaceholderType() {
+        return PlaceholderType.FloatVector;
+    }
+
+    @Override
+    public Object getData() {
+        return this.data;
+    }
+}

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/response/DeleteResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/response/GetResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/response/InsertResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/response/QueryResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/response/SearchResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/service/vector/response/UpsertResp.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.vector.response;
 
 import lombok.Data;

+ 19 - 0
src/main/java/io/milvus/v2/utils/ClientUtils.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.utils;
 
 import io.grpc.ManagedChannel;

+ 19 - 0
src/main/java/io/milvus/v2/utils/ConvertUtils.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.utils;
 
 import io.milvus.grpc.*;

+ 19 - 0
src/main/java/io/milvus/v2/utils/DataUtils.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.utils;
 
 import com.google.gson.JsonElement;

+ 19 - 0
src/main/java/io/milvus/v2/utils/RpcUtils.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.utils;
 
 import io.milvus.grpc.Status;

+ 19 - 0
src/main/java/io/milvus/v2/utils/SchemaUtils.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.utils;
 
 import io.milvus.grpc.CollectionSchema;

+ 37 - 47
src/main/java/io/milvus/v2/utils/VectorUtils.java

@@ -1,26 +1,40 @@
+/*
+ * 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.v2.utils;
 
 import com.google.gson.Gson;
 import com.google.protobuf.ByteString;
-import io.milvus.common.clientenum.ConsistencyLevelEnum;
+import io.milvus.v2.common.ConsistencyLevel;
 import io.milvus.exception.ParamException;
 import io.milvus.grpc.*;
 import io.milvus.param.Constant;
-import io.milvus.v2.service.vector.request.QueryReq;
-import io.milvus.v2.service.vector.request.SearchReq;
+import io.milvus.param.ParamUtils;
+import io.milvus.v2.service.vector.request.*;
+import io.milvus.v2.service.vector.request.data.*;
 
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 public class VectorUtils {
     private static final Gson GSON_INSTANCE = new Gson();
 
     public QueryRequest ConvertToGrpcQueryRequest(QueryReq request){
-//        long guaranteeTimestamp = getGuaranteeTimestamp(ConsistencyLevelEnum.valueOf(request.getConsistencyLevel().name()),
-//                request.getGuaranteeTimestamp(), request.getGracefulTime());
         QueryRequest.Builder builder = QueryRequest.newBuilder()
                 .setCollectionName(request.getCollectionName())
                 .addAllPartitionNames(request.getPartitionNames())
@@ -62,7 +76,7 @@ public class VectorUtils {
 
     }
 
-    private static long getGuaranteeTimestamp(ConsistencyLevelEnum consistencyLevel,
+    private static long getGuaranteeTimestamp(ConsistencyLevel consistencyLevel,
                                               long guaranteeTimestamp, Long gracefulTime){
         if(consistencyLevel == null){
             return 1L;
@@ -90,44 +104,20 @@ public class VectorUtils {
 
 
         // prepare target vectors
-        // TODO: check target vector dimension(use DescribeCollection get schema to compare)
-        PlaceholderType plType = PlaceholderType.None;
-        List<?> vectors = request.getData();
-        List<ByteString> byteStrings = new ArrayList<>();
-        for (Object vector : vectors) {
-            if (vector instanceof List) {
-                plType = PlaceholderType.FloatVector;
-                List<Float> list = (List<Float>) vector;
-                ByteBuffer buf = ByteBuffer.allocate(Float.BYTES * list.size());
-                buf.order(ByteOrder.LITTLE_ENDIAN);
-                list.forEach(buf::putFloat);
-
-                byte[] array = buf.array();
-                ByteString bs = ByteString.copyFrom(array);
-                byteStrings.add(bs);
-            } else if (vector instanceof ByteBuffer) {
-                plType = PlaceholderType.BinaryVector;
-                ByteBuffer buf = (ByteBuffer) vector;
-                byte[] array = buf.array();
-                ByteString bs = ByteString.copyFrom(array);
-                byteStrings.add(bs);
-            } else {
-                String msg = "Search target vector type is illegal(Only allow List<Float> or ByteBuffer)";
-                throw new ParamException(msg);
+        List<BaseVector> vectors = request.getData();
+        if (vectors.isEmpty()) {
+            throw new ParamException("Target vectors list of search request is empty.");
+        }
+        PlaceholderType plType = vectors.get(0).getPlaceholderType();
+        List<Object> data = new ArrayList<>();
+        for (BaseVector vector : vectors) {
+            if (vector.getPlaceholderType() != plType) {
+                throw new ParamException("Different types of target vectors in a search request is not allowed.");
             }
+            data.add(vector.getData());
         }
 
-        PlaceholderValue.Builder pldBuilder = PlaceholderValue.newBuilder()
-                .setTag(Constant.VECTOR_TAG)
-                .setType(plType);
-        byteStrings.forEach(pldBuilder::addValues);
-
-        PlaceholderValue plv = pldBuilder.build();
-        PlaceholderGroup placeholderGroup = PlaceholderGroup.newBuilder()
-                .addPlaceholders(plv)
-                .build();
-
-        ByteString byteStr = placeholderGroup.toByteString();
+        ByteString byteStr = ParamUtils.convertPlaceholder(data, plType);
         builder.setPlaceholderGroup(byteStr);
 
         // search parameters
@@ -181,7 +171,7 @@ public class VectorUtils {
             builder.setDsl(request.getFilter());
         }
 
-        long guaranteeTimestamp = getGuaranteeTimestamp(ConsistencyLevelEnum.valueOf(request.getConsistencyLevel().name()),
+        long guaranteeTimestamp = getGuaranteeTimestamp(request.getConsistencyLevel(),
                 request.getGuaranteeTimestamp(), request.getGracefulTime());
         //builder.setTravelTimestamp(request.getTravelTimestamp());
         builder.setGuaranteeTimestamp(guaranteeTimestamp);

+ 19 - 0
src/test/java/io/milvus/v2/BaseTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2;
 
 import io.milvus.grpc.*;

+ 549 - 0
src/test/java/io/milvus/v2/client/MilvusClientV2DockerTest.java

@@ -0,0 +1,549 @@
+/*
+ * 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.v2.client;
+
+import com.google.gson.*;
+
+import com.google.gson.reflect.TypeToken;
+import io.milvus.v2.common.ConsistencyLevel;
+import io.milvus.v2.common.DataType;
+import io.milvus.v2.common.IndexParam;
+import io.milvus.v2.service.collection.request.AddFieldReq;
+import io.milvus.v2.service.collection.request.CreateCollectionReq;
+import io.milvus.v2.service.collection.request.DropCollectionReq;
+import io.milvus.v2.service.partition.request.CreatePartitionReq;
+import io.milvus.v2.service.vector.request.*;
+import io.milvus.v2.service.vector.request.data.*;
+import io.milvus.v2.service.vector.response.*;
+import org.apache.commons.text.RandomStringGenerator;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
+import org.testcontainers.junit.jupiter.Container;
+import org.testcontainers.junit.jupiter.Testcontainers;
+import org.testcontainers.milvus.MilvusContainer;
+
+import java.nio.ByteBuffer;
+import java.util.*;
+
+@Testcontainers(disabledWithoutDocker = true)
+class MilvusClientV2DockerTest {
+    private static MilvusClientV2 client;
+    private static RandomStringGenerator generator;
+    private static final int dimension = 256;
+
+    private static final Gson GSON_INSTANCE = new Gson();
+
+    private static final Random RANDOM = new Random();
+
+    @Container
+    private static final MilvusContainer milvus = new MilvusContainer("milvusdb/milvus:v2.4.1");
+
+    @BeforeAll
+    public static void setUp() {
+        ConnectConfig config = ConnectConfig.builder()
+                .uri(milvus.getEndpoint())
+                .build();
+        client = new MilvusClientV2(config);
+        generator = new RandomStringGenerator.Builder().withinRange('a', 'z').build();
+    }
+
+    @AfterAll
+    public static void tearDown() throws InterruptedException {
+        if (client != null) {
+            client.close(5L);
+        }
+    }
+
+    private List<Float> generateFolatVector() {
+        List<Float> vector = new ArrayList<>();
+        for (int i = 0; i < dimension; ++i) {
+            vector.add(RANDOM.nextFloat());
+        }
+        return vector;
+    }
+
+    private List<List<Float>> generateFloatVectors(int count) {
+        List<List<Float>> vectors = new ArrayList<>();
+        for (int n = 0; n < count; ++n) {
+            vectors.add(generateFolatVector());
+        }
+
+        return vectors;
+    }
+
+    private ByteBuffer generateBinaryVector() {
+        int byteCount = dimension / 8;
+        ByteBuffer vector = ByteBuffer.allocate(byteCount);
+        for (int i = 0; i < byteCount; ++i) {
+            vector.put((byte) RANDOM.nextInt(Byte.MAX_VALUE));
+        }
+        return vector;
+    }
+
+    private List<ByteBuffer> generateBinaryVectors(int count) {
+        List<ByteBuffer> vectors = new ArrayList<>();
+        for (int n = 0; n < count; ++n) {
+            vectors.add(generateBinaryVector());
+        }
+        return vectors;
+
+    }
+
+
+    private CreateCollectionReq.CollectionSchema baseSchema() {
+        CreateCollectionReq.CollectionSchema collectionSchema = CreateCollectionReq.CollectionSchema.builder()
+                .build();
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("id")
+                .dataType(DataType.Int64)
+                .isPrimaryKey(Boolean.TRUE)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("bool_field")
+                .dataType(DataType.Bool)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("int8_field")
+                .dataType(DataType.Int8)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("int16_field")
+                .dataType(DataType.Int16)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("int32_field")
+                .dataType(DataType.Int32)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("int64_field")
+                .dataType(DataType.Int64)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("float_field")
+                .dataType(DataType.Float)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("double_field")
+                .dataType(DataType.Double)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("varchar_field")
+                .dataType(DataType.VarChar)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("json_field")
+                .dataType(DataType.JSON)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("arr_int_field")
+                .dataType(DataType.Array)
+                .maxCapacity(50)
+                .elementType(DataType.Int32)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("arr_float_field")
+                .dataType(DataType.Array)
+                .maxCapacity(20)
+                .elementType(DataType.Float)
+                .build());
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName("arr_varchar_field")
+                .dataType(DataType.Array)
+                .maxCapacity(10)
+                .elementType(DataType.VarChar)
+                .build());
+        return collectionSchema;
+    }
+
+    private JsonArray generateRandomArray(CreateCollectionReq.FieldSchema field) {
+        DataType dataType = field.getDataType();
+        if (dataType != DataType.Array) {
+            Assertions.fail();
+        }
+
+        DataType eleType = field.getElementType();
+        int eleCnt = RANDOM.nextInt(field.getMaxCapacity());
+        switch (eleType) {
+            case Bool: {
+                List<Boolean> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(i%10 == 0);
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            case Int8: {
+                List<Integer> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(RANDOM.nextInt(256));
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            case Int16:
+            case Int32: {
+                List<Integer> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(RANDOM.nextInt());
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            case Int64: {
+                List<Long> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(RANDOM.nextLong());
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            case Float: {
+                List<Float> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(RANDOM.nextFloat());
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            case Double: {
+                List<Double> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(RANDOM.nextDouble());
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            case VarChar: {
+                List<String> values = new ArrayList<>();
+                for (int i = 0; i < eleCnt; i++) {
+                    values.add(String.format("varchar_arr_%d", i));
+                }
+                return GSON_INSTANCE.toJsonTree(values).getAsJsonArray();
+            }
+            default:
+                Assertions.fail();
+        }
+        return null;
+    }
+
+    private List<JsonObject> generateRandomData(CreateCollectionReq.CollectionSchema schema, long count) {
+        List<CreateCollectionReq.FieldSchema> fields = schema.getFieldSchemaList();
+        List<JsonObject> rows = new ArrayList<>();
+        for (long i = 0; i < count; i++) {
+            JsonObject row = new JsonObject();
+            for (CreateCollectionReq.FieldSchema field : fields) {
+                DataType dataType = field.getDataType();
+                switch (dataType) {
+                    case Bool:
+                        row.addProperty(field.getName(), i%3==0);
+                        break;
+                    case Int8:
+                        row.addProperty(field.getName(), i%128);
+                        break;
+                    case Int16:
+                        row.addProperty(field.getName(), i%32768);
+                        break;
+                    case Int32:
+                        row.addProperty(field.getName(), i%65536);
+                        break;
+                    case Int64:
+                        row.addProperty(field.getName(), i);
+                        break;
+                    case Float:
+                        row.addProperty(field.getName(), i/8);
+                        break;
+                    case Double:
+                        row.addProperty(field.getName(), i/3);
+                        break;
+                    case VarChar:
+                        row.addProperty(field.getName(), String.format("varchar_%d", i));
+                        break;
+                    case JSON: {
+                        JsonObject jsonObj = new JsonObject();
+                        jsonObj.addProperty(String.format("JSON_%d", i), i);
+                        row.add(field.getName(), jsonObj);
+                        break;
+                    }
+                    case Array: {
+                        JsonArray array = generateRandomArray(field);
+                        row.add(field.getName(), array);
+                        break;
+                    }
+                    case FloatVector: {
+                        List<Float> vector = generateFolatVector();
+                        row.add(field.getName(), GSON_INSTANCE.toJsonTree(vector));
+                        break;
+                    }
+                    case BinaryVector: {
+                        ByteBuffer vector = generateBinaryVector();
+                        row.add(field.getName(), GSON_INSTANCE.toJsonTree(vector.array()));
+                        break;
+                    }
+                    default:
+                        Assertions.fail();
+                }
+            }
+            rows.add(row);
+        }
+
+        return rows;
+    }
+
+    private void verifyOutput(JsonObject row, Map<String, Object> entity) {
+        Boolean b = (Boolean) entity.get("bool_field");
+        Assertions.assertEquals(row.get("bool_field").getAsBoolean(), b);
+        Integer i8 = (Integer) entity.get("int8_field");
+        Assertions.assertEquals(row.get("int8_field").getAsInt(), i8);
+        Integer i16 = (Integer) entity.get("int16_field");
+        Assertions.assertEquals(row.get("int16_field").getAsInt(), i16);
+        Integer i32 = (Integer) entity.get("int32_field");
+        Assertions.assertEquals(row.get("int32_field").getAsInt(), i32);
+        Long i64 = (Long) entity.get("int64_field");
+        Assertions.assertEquals(row.get("int64_field").getAsLong(), i64);
+        Float f32 = (Float) entity.get("float_field");
+        Assertions.assertEquals(row.get("float_field").getAsFloat(), f32);
+        Double f64 = (Double) entity.get("double_field");
+        Assertions.assertEquals(row.get("double_field").getAsDouble(), f64);
+        String str = (String) entity.get("varchar_field");
+        Assertions.assertEquals(row.get("varchar_field").getAsString(), str);
+        JsonObject jsn = (JsonObject) entity.get("json_field");
+        Assertions.assertEquals(row.get("json_field").toString(), jsn.toString());
+
+        List<Integer> arrInt = (List<Integer>) entity.get("arr_int_field");
+        List<Integer> arrIntOri = GSON_INSTANCE.fromJson(row.get("arr_int_field"), new TypeToken<List<Integer>>() {}.getType());
+        Assertions.assertEquals(arrIntOri, arrInt);
+        List<Float> arrFloat = (List<Float>) entity.get("arr_float_field");
+        List<Float> arrFloatOri = GSON_INSTANCE.fromJson(row.get("arr_float_field"), new TypeToken<List<Float>>() {}.getType());
+        Assertions.assertEquals(arrFloatOri, arrFloat);
+        List<String> arrStr = (List<String>) entity.get("arr_varchar_field");
+        List<String> arrStrOri = GSON_INSTANCE.fromJson(row.get("arr_varchar_field"), new TypeToken<List<String>>() {}.getType());
+        Assertions.assertEquals(arrStrOri, arrStr);
+    }
+
+
+    @Test
+    void testFloatVectors() {
+        String randomCollectionName = generator.generate(10);
+
+        String vectorFieldName = "float_vector";
+        CreateCollectionReq.CollectionSchema collectionSchema = baseSchema();
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName(vectorFieldName)
+                .dataType(DataType.FloatVector)
+                .dimension(dimension)
+                .build());
+
+        Map<String,Object> extraParams = new HashMap<>();
+        extraParams.put("M",16);
+        extraParams.put("efConstruction",64);
+        IndexParam indexParam = IndexParam.builder()
+                .fieldName(vectorFieldName)
+                .indexType(IndexParam.IndexType.HNSW)
+                .metricType(IndexParam.MetricType.COSINE)
+                .extraParams(extraParams)
+                .build();
+
+        CreateCollectionReq requestCreate = CreateCollectionReq.builder()
+                .collectionName(randomCollectionName)
+                .collectionSchema(collectionSchema)
+                .indexParams(Collections.singletonList(indexParam))
+                .build();
+        client.createCollection(requestCreate);
+
+        // insert rows
+        long count = 10000;
+        List<JsonObject> data = generateRandomData(collectionSchema, count);
+        InsertResp insertResp = client.insert(InsertReq.builder()
+                .collectionName(randomCollectionName)
+                .data(data)
+                .build());
+        Assertions.assertEquals(count, insertResp.getInsertCnt());
+
+        // create partition, upsert one row to the partition
+        String partitionName = "PPP";
+        client.createPartition(CreatePartitionReq.builder()
+                .collectionName(randomCollectionName)
+                .partitionName(partitionName)
+                .build());
+
+        List<JsonObject> upsertData = new ArrayList<>();
+        upsertData.add(data.get((int) (count - 1)));
+        UpsertResp upsertResp = client.upsert(UpsertReq.builder()
+                .collectionName(randomCollectionName)
+                .partitionName(partitionName)
+                .data(upsertData)
+                .build());
+        Assertions.assertEquals(1, upsertResp.getUpsertCnt());
+
+        // get row count
+        QueryResp queryResp = client.query(QueryReq.builder()
+                .collectionName(randomCollectionName)
+                .filter("")
+                .outputFields(Collections.singletonList("count(*)"))
+                .consistencyLevel(ConsistencyLevel.STRONG)
+                .build());
+        List<QueryResp.QueryResult> queryResults = queryResp.getQueryResults();
+        Assertions.assertEquals(1, queryResults.size());
+        Assertions.assertEquals(count + 1, queryResults.get(0).getEntity().get("count(*)"));
+
+        // search in partition
+        SearchResp searchResp = client.search(SearchReq.builder()
+                .collectionName(randomCollectionName)
+                .partitionNames(Collections.singletonList(partitionName))
+                .annsField(vectorFieldName)
+                .data(Collections.singletonList(new FloatVec(generateFolatVector())))
+                .topK(10)
+                .build());
+        List<List<SearchResp.SearchResult>> searchResults = searchResp.getSearchResults();
+        Assertions.assertEquals(1, searchResults.size());
+        Assertions.assertEquals(1, searchResults.get(0).size());
+        Assertions.assertEquals(count - 1, searchResults.get(0).get(0).getId());
+
+
+        // query entities
+        int nq = 5;
+        List<Long> targetIDs = new ArrayList<>();
+        List<BaseVector> targetVectors = new ArrayList<>();
+        for (int i = 0; i < nq; i++) {
+            JsonObject row = data.get(RANDOM.nextInt((int)count));
+            targetIDs.add(row.get("id").getAsLong());
+            List<Float> vector = GSON_INSTANCE.fromJson(row.get(vectorFieldName), new TypeToken<List<Float>>() {}.getType());
+            targetVectors.add(new FloatVec(vector));
+        }
+
+        GetResp getResp = client.get(GetReq.builder()
+                .collectionName(randomCollectionName)
+                .ids(new ArrayList<>(targetIDs))
+                .outputFields(Collections.singletonList("*"))
+                .build());
+        for (QueryResp.QueryResult result : getResp.getGetResults()) {
+            boolean found = false;
+            for (int i = 0; i < nq; i++) {
+                Map<String, Object> entity = result.getEntity();
+                if (Objects.equals(targetIDs.get(i), entity.get("id"))) {
+                    JsonObject row = data.get(targetIDs.get(i).intValue());
+                    verifyOutput(row, entity);
+                    found = true;
+                    break;
+                }
+            }
+            if (!found) {
+                Assertions.fail();
+            }
+        }
+
+        // search in collection
+        int topk = 10;
+        searchResp = client.search(SearchReq.builder()
+                .collectionName(randomCollectionName)
+                .annsField(vectorFieldName)
+                .data(targetVectors)
+                .topK(10)
+                .outputFields(Collections.singletonList("*"))
+                .build());
+        searchResults = searchResp.getSearchResults();
+        Assertions.assertEquals(nq, searchResults.size());
+        for (int i = 0; i < nq; i++) {
+            List<SearchResp.SearchResult> results = searchResults.get(i);
+            Assertions.assertEquals(topk, results.size());
+            SearchResp.SearchResult result = results.get(0);
+            Assertions.assertEquals(targetIDs.get(i), result.getId());
+
+            Map<String, Object> entity = result.getEntity();
+            JsonObject row = data.get(targetIDs.get(i).intValue());
+            verifyOutput(row, entity);
+        }
+
+        client.dropCollection(DropCollectionReq.builder().collectionName(randomCollectionName).build());
+    }
+
+    @Test
+    void testBinaryVectors() {
+        String randomCollectionName = generator.generate(10);
+
+        String vectorFieldName = "binary_vector";
+        CreateCollectionReq.CollectionSchema collectionSchema = baseSchema();
+        collectionSchema.addField(AddFieldReq.builder()
+                .fieldName(vectorFieldName)
+                .dataType(DataType.BinaryVector)
+                .dimension(dimension)
+                .build());
+
+        Map<String,Object> extraParams = new HashMap<>();
+        extraParams.put("nlist",64);
+        IndexParam indexParam = IndexParam.builder()
+                .fieldName(vectorFieldName)
+                .indexType(IndexParam.IndexType.BIN_IVF_FLAT)
+                .metricType(IndexParam.MetricType.JACCARD)
+                .extraParams(extraParams)
+                .build();
+
+        CreateCollectionReq requestCreate = CreateCollectionReq.builder()
+                .collectionName(randomCollectionName)
+                .collectionSchema(collectionSchema)
+                .indexParams(Collections.singletonList(indexParam))
+                .build();
+        client.createCollection(requestCreate);
+
+        // insert rows
+        long count = 10000;
+        List<JsonObject> data = generateRandomData(collectionSchema, count);
+        InsertResp insertResp = client.insert(InsertReq.builder()
+                .collectionName(randomCollectionName)
+                .data(data)
+                .build());
+        Assertions.assertEquals(count, insertResp.getInsertCnt());
+
+        // get row count
+        QueryResp queryResp = client.query(QueryReq.builder()
+                .collectionName(randomCollectionName)
+                .filter("")
+                .outputFields(Collections.singletonList("count(*)"))
+                .consistencyLevel(ConsistencyLevel.STRONG)
+                .build());
+        List<QueryResp.QueryResult> queryResults = queryResp.getQueryResults();
+        Assertions.assertEquals(1, queryResults.size());
+        Assertions.assertEquals(count, queryResults.get(0).getEntity().get("count(*)"));
+
+        // search in collection
+        int nq = 5;
+        int topk = 10;
+        List<Long> targetIDs = new ArrayList<>();
+        List<BaseVector> targetVectors = new ArrayList<>();
+        for (int i = 0; i < nq; i++) {
+            JsonObject row = data.get(RANDOM.nextInt((int)count));
+            targetIDs.add(row.get("id").getAsLong());
+            byte[] vector = GSON_INSTANCE.fromJson(row.get(vectorFieldName), new TypeToken<byte[]>() {}.getType());
+            targetVectors.add(new BinaryVec(ByteBuffer.wrap(vector)));
+        }
+        SearchResp searchResp = client.search(SearchReq.builder()
+                .collectionName(randomCollectionName)
+                .annsField(vectorFieldName)
+                .data(targetVectors)
+                .topK(10)
+                .build());
+        List<List<SearchResp.SearchResult>> searchResults = searchResp.getSearchResults();
+        Assertions.assertEquals(nq, searchResults.size());
+        for (int i = 0; i < nq; i++) {
+            List<SearchResp.SearchResult> results = searchResults.get(i);
+            Assertions.assertEquals(topk, results.size());
+            Assertions.assertEquals(targetIDs.get(i), results.get(0).getId());
+        }
+
+        client.dropCollection(DropCollectionReq.builder().collectionName(randomCollectionName).build());
+    }
+}

+ 19 - 0
src/test/java/io/milvus/v2/client/MilvusClientV2Test.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.client;
 
 import io.milvus.v2.BaseTest;

+ 19 - 0
src/test/java/io/milvus/v2/service/collection/CollectionTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.collection;
 
 import io.milvus.v2.BaseTest;

+ 19 - 0
src/test/java/io/milvus/v2/service/index/IndexTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.index;
 
 import io.milvus.v2.BaseTest;

+ 19 - 0
src/test/java/io/milvus/v2/service/partition/PartitionTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.partition;
 
 import io.milvus.v2.BaseTest;

+ 19 - 0
src/test/java/io/milvus/v2/service/rbac/RoleTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac;
 
 import io.milvus.v2.BaseTest;

+ 19 - 0
src/test/java/io/milvus/v2/service/rbac/UserTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.rbac;
 
 import io.milvus.v2.BaseTest;

+ 19 - 0
src/test/java/io/milvus/v2/service/utility/UtilityTest.java

@@ -1,3 +1,22 @@
+/*
+ * 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.v2.service.utility;
 
 import io.milvus.v2.BaseTest;

+ 21 - 1
src/test/java/io/milvus/v2/service/vector/VectorTest.java

@@ -1,8 +1,28 @@
+/*
+ * 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.v2.service.vector;
 
 import com.google.gson.*;
 import io.milvus.v2.BaseTest;
 import io.milvus.v2.service.vector.request.*;
+import io.milvus.v2.service.vector.request.data.FloatVec;
 import io.milvus.v2.service.vector.response.*;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
@@ -77,7 +97,7 @@ class VectorTest extends BaseTest {
         vectorList.add(2.0f);
         SearchReq request = SearchReq.builder()
                 .collectionName("test2")
-                .data(Collections.singletonList(vectorList))
+                .data(Collections.singletonList(new FloatVec(vectorList)))
                 .topK(10)
                 .offset(0L)
                 .build();

+ 6 - 1
tests/milvustestv2/src/main/java/com/zilliz/milvustestv2/common/CommonFunction.java

@@ -12,6 +12,8 @@ import io.milvus.v2.service.collection.request.CreateCollectionReq;
 import io.milvus.v2.service.index.request.CreateIndexReq;
 import io.milvus.v2.service.partition.request.CreatePartitionReq;
 import io.milvus.v2.service.vector.request.SearchReq;
+import io.milvus.v2.service.vector.request.data.BaseVector;
+import io.milvus.v2.service.vector.request.data.FloatVec;
 import io.milvus.v2.service.vector.response.SearchResp;
 import lombok.extern.slf4j.Slf4j;
 
@@ -272,12 +274,15 @@ public class CommonFunction {
     }
 
     public static SearchResp defaultSearch(String collectionName){
+        List<List<Float>> vectors = GenerateUtil.generateFloatVector(10, 3, CommonData.dim);
+        List<BaseVector> data = new ArrayList<>();
+        vectors.forEach((v)->{data.add(new FloatVec(v));});
         return BaseTest.milvusClientV2.search(SearchReq.builder()
                 .collectionName(collectionName)
                 .outputFields(Lists.newArrayList("*"))
                 .consistencyLevel(ConsistencyLevel.STRONG)
                 .annsField(CommonData.fieldFloatVector)
-                .data(GenerateUtil.generateFloatVector(10, 3, CommonData.dim))
+                .data(data)
                 .topK(CommonData.topK)
                 .build());
     }

+ 8 - 1
tests/milvustestv2/src/test/java/com/zilliz/milvustestv2/loadRelease/LoadPartitionsTest.java

@@ -14,6 +14,8 @@ import io.milvus.v2.service.partition.request.CreatePartitionReq;
 import io.milvus.v2.service.partition.request.LoadPartitionsReq;
 import io.milvus.v2.service.vector.request.InsertReq;
 import io.milvus.v2.service.vector.request.SearchReq;
+import io.milvus.v2.service.vector.request.data.BaseVector;
+import io.milvus.v2.service.vector.request.data.FloatVec;
 import io.milvus.v2.service.vector.response.SearchResp;
 import org.testng.Assert;
 import org.testng.annotations.AfterClass;
@@ -21,6 +23,7 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
@@ -54,13 +57,17 @@ public class LoadPartitionsTest extends BaseTest {
                 .collectionName(newCollection)
                 .partitionNames(Collections.singletonList(CommonData.partitionName))
                 .build());
+
+        List<List<Float>> vectors = GenerateUtil.generateFloatVector(10, 3, CommonData.dim);
+        List<BaseVector> data = new ArrayList<>();
+        vectors.forEach((v)->{data.add(new FloatVec(v));});
         SearchResp searchResp = milvusClientV2.search(SearchReq.builder()
                 .collectionName(newCollection)
                 .outputFields(Lists.newArrayList("*"))
                 .consistencyLevel(ConsistencyLevel.STRONG)
                 .annsField(CommonData.fieldFloatVector)
                 .partitionNames(Lists.newArrayList(CommonData.partitionName))
-                .data(GenerateUtil.generateFloatVector(10, 3, CommonData.dim))
+                .data(data)
                 .topK(CommonData.topK)
                 .build());
         Assert.assertEquals(searchResp.getSearchResults().size(), CommonData.topK);

Some files were not shown because too many files changed in this diff