Jelajahi Sumber

release v0.2.0

Zhiru Zhu 5 tahun lalu
induk
melakukan
cf5edd8a41
30 mengubah file dengan 478 tambahan dan 981 penghapusan
  1. 3 3
      README.md
  2. 15 13
      examples/pom.xml
  3. 29 36
      examples/src/main/java/MilvusClientExample.java
  4. 15 13
      pom.xml
  5. 0 74
      src/main/java/io/milvus/client/CommandParam.java
  6. 19 0
      src/main/java/io/milvus/client/ConnectFailedException.java
  7. 15 13
      src/main/java/io/milvus/client/ConnectParam.java
  8. 15 34
      src/main/java/io/milvus/client/CreateIndexParam.java
  9. 14 12
      src/main/java/io/milvus/client/DateRange.java
  10. 0 94
      src/main/java/io/milvus/client/DeleteByRangeParam.java
  11. 14 12
      src/main/java/io/milvus/client/DescribeIndexResponse.java
  12. 14 12
      src/main/java/io/milvus/client/DescribeTableResponse.java
  13. 14 12
      src/main/java/io/milvus/client/GetTableRowCountResponse.java
  14. 14 12
      src/main/java/io/milvus/client/HasTableResponse.java
  15. 14 12
      src/main/java/io/milvus/client/Index.java
  16. 15 12
      src/main/java/io/milvus/client/IndexType.java
  17. 14 31
      src/main/java/io/milvus/client/InsertParam.java
  18. 14 12
      src/main/java/io/milvus/client/InsertResponse.java
  19. 14 12
      src/main/java/io/milvus/client/MetricType.java
  20. 43 141
      src/main/java/io/milvus/client/MilvusClient.java
  21. 50 99
      src/main/java/io/milvus/client/MilvusGrpcClient.java
  22. 14 12
      src/main/java/io/milvus/client/Response.java
  23. 14 33
      src/main/java/io/milvus/client/SearchInFilesParam.java
  24. 15 32
      src/main/java/io/milvus/client/SearchParam.java
  25. 14 12
      src/main/java/io/milvus/client/SearchResponse.java
  26. 14 12
      src/main/java/io/milvus/client/ShowTablesResponse.java
  27. 0 78
      src/main/java/io/milvus/client/TableParam.java
  28. 14 12
      src/main/java/io/milvus/client/TableSchema.java
  29. 0 77
      src/main/java/io/milvus/client/TableSchemaParam.java
  30. 48 54
      src/test/java/io/milvus/client/MilvusGrpcClientTest.java

+ 3 - 3
README.md

@@ -3,7 +3,7 @@
 [![Maven Central](https://img.shields.io/maven-central/v/io.milvus/milvus-sdk-java.svg)](https://search.maven.org/artifact/io.milvus/milvus-sdk-java/)
 
 Java SDK for Milvus distributed high-performance vector search engine. 
-If you want to contribute to this repo, please read our [contribution guidelines]().
+If you want to contribute to this repo, please read our [contribution guidelines](https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md).
 
 ## Getting started
 
@@ -14,13 +14,13 @@ Apache Maven
 <dependency>
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java</artifactId>
-    <version>0.1.1</version>
+    <version>0.2.0</version>
 </dependency>
 ```
 
 Gradle/Grails 
 
-`compile 'io.milvus:milvus-sdk-java:0.1.1'`
+`compile 'io.milvus:milvus-sdk-java:0.2.0'`
 
 ### Examples
 

+ 15 - 13
examples/pom.xml

@@ -1,19 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~ 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
+  ~ 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
+  ~   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.
+  ~ 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.
   -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0"
@@ -46,7 +48,7 @@
         <dependency>
             <groupId>io.milvus</groupId>
             <artifactId>milvus-sdk-java</artifactId>
-            <version>0.1.2</version>
+            <version>0.2.0</version>
         </dependency>
     </dependencies>
 

+ 29 - 36
examples/src/main/java/MilvusClientExample.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.
  */
 
 import io.milvus.client.*;
@@ -31,6 +33,7 @@ public class MilvusClientExample {
     SplittableRandom splittableRandom = new SplittableRandom();
     List<List<Float>> vectors = new ArrayList<>();
     for (int i = 0; i < vectorCount; ++i) {
+      splittableRandom = splittableRandom.split();
       DoubleStream doubleStream = splittableRandom.doubles(dimension);
       List<Float> vector =
           doubleStream.boxed().map(Double::floatValue).collect(Collectors.toList());
@@ -80,26 +83,23 @@ public class MilvusClientExample {
             .withIndexFileSize(indexFileSize)
             .withMetricType(metricType)
             .build();
-    TableSchemaParam tableSchemaParam =
-        new TableSchemaParam.Builder(tableSchema).withTimeout(10).build();
-    Response createTableResponse = client.createTable(tableSchemaParam);
+    Response createTableResponse = client.createTable(tableSchema);
     System.out.println(createTableResponse);
 
     // Check whether the table exists
-    TableParam hasTableParam = new TableParam.Builder(tableName).withTimeout(1).build();
-    HasTableResponse hasTableResponse = client.hasTable(hasTableParam);
+    HasTableResponse hasTableResponse = client.hasTable(tableName);
     System.out.println(hasTableResponse);
 
     // Describe the table
-    TableParam describeTableParam = new TableParam.Builder(tableName).withTimeout(1).build();
-    DescribeTableResponse describeTableResponse = client.describeTable(describeTableParam);
+    DescribeTableResponse describeTableResponse = client.describeTable(tableName);
     System.out.println(describeTableResponse);
 
     // Insert randomly generated vectors to table
     final int vectorCount = 100000;
     List<List<Float>> vectors = generateVectors(vectorCount, dimension);
-    vectors.forEach(MilvusClientExample::normalizeVector);
-    InsertParam insertParam = new InsertParam.Builder(tableName, vectors).withTimeout(10).build();
+    vectors =
+        vectors.stream().map(MilvusClientExample::normalizeVector).collect(Collectors.toList());
+    InsertParam insertParam = new InsertParam.Builder(tableName, vectors).build();
     InsertResponse insertResponse = client.insert(insertParam);
     System.out.println(insertResponse);
     // Insert returns a list of vector ids that you will be using (if you did not supply them
@@ -111,26 +111,21 @@ public class MilvusClientExample {
     TimeUnit.SECONDS.sleep(1);
 
     // Get current row count of table
-    TableParam getTableRowCountParam = new TableParam.Builder(tableName).withTimeout(1).build();
-    GetTableRowCountResponse getTableRowCountResponse =
-        client.getTableRowCount(getTableRowCountParam);
+    GetTableRowCountResponse getTableRowCountResponse = client.getTableRowCount(tableName);
     System.out.println(getTableRowCountResponse);
 
     // Create index for the table
     // We choose IVF_SQ8 as our index type here. Refer to IndexType javadoc for a
     // complete explanation of different index types
-    final IndexType indexType =
-        IndexType
-            .IVF_SQ8;
+    final IndexType indexType = IndexType.IVF_SQ8;
     Index index = new Index.Builder().withIndexType(IndexType.IVF_SQ8).build();
     CreateIndexParam createIndexParam =
-        new CreateIndexParam.Builder(tableName).withIndex(index).withTimeout(10).build();
+        new CreateIndexParam.Builder(tableName).withIndex(index).build();
     Response createIndexResponse = client.createIndex(createIndexParam);
     System.out.println(createIndexResponse);
 
     // Describe the index for your table
-    TableParam describeIndexParam = new TableParam.Builder(tableName).withTimeout(1).build();
-    DescribeIndexResponse describeIndexResponse = client.describeIndex(describeIndexParam);
+    DescribeIndexResponse describeIndexResponse = client.describeIndex(tableName);
     System.out.println(describeIndexResponse);
 
     // Search vectors
@@ -139,7 +134,7 @@ public class MilvusClientExample {
     List<List<Float>> vectorsToSearch = vectors.subList(0, searchBatchSize);
     final long topK = 10;
     SearchParam searchParam =
-        new SearchParam.Builder(tableName, vectorsToSearch).withTopK(topK).withTimeout(10).build();
+        new SearchParam.Builder(tableName, vectorsToSearch).withTopK(topK).build();
     SearchResponse searchResponse = client.search(searchParam);
     System.out.println(searchResponse);
     if (searchResponse.getResponse().ok()) {
@@ -152,20 +147,18 @@ public class MilvusClientExample {
         // very close to 1 (some precision is lost during the process)
         SearchResponse.QueryResult firstQueryResult = queryResultsList.get(i).get(0);
         if (firstQueryResult.getVectorId() != vectorIds.get(i)
-            || firstQueryResult.getDistance() <= (1 - epsilon)) {
+            || Math.abs(1 - firstQueryResult.getDistance()) > (1 - epsilon)) {
           throw new AssertionError("Wrong results!");
         }
       }
     }
 
     // Drop index for the table
-    TableParam dropIndexParam = new TableParam.Builder(tableName).withTimeout(1).build();
-    Response dropIndexResponse = client.dropIndex(dropIndexParam);
+    Response dropIndexResponse = client.dropIndex(tableName);
     System.out.println(dropIndexResponse);
 
     // Drop table
-    TableParam dropTableParam = new TableParam.Builder(tableName).withTimeout(1).build();
-    Response dropTableResponse = client.dropTable(dropTableParam);
+    Response dropTableResponse = client.dropTable(tableName);
     System.out.println(dropTableResponse);
 
     // Disconnect from Milvus server

+ 15 - 13
pom.xml

@@ -1,19 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-  ~ 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
+  ~ 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
+  ~   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.
+  ~ 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.
   -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0"
@@ -23,7 +25,7 @@
 
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java</artifactId>
-    <version>0.1.2</version>
+    <version>0.2.0</version>
     <packaging>jar</packaging>
 
     <name>io.milvus:milvus-sdk-java</name>

+ 0 - 74
src/main/java/io/milvus/client/CommandParam.java

@@ -1,74 +0,0 @@
-/*
- * 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.client;
-
-import javax.annotation.Nonnull;
-
-/** Contains parameters for <code>command</code> */
-class CommandParam {
-  private final String command;
-  private final long timeout;
-
-  private CommandParam(@Nonnull Builder builder) {
-    this.command = builder.command;
-    this.timeout = builder.timeout;
-  }
-
-  String getCommand() {
-    return command;
-  }
-
-  long getTimeout() {
-    return timeout;
-  }
-
-  @Override
-  public String toString() {
-    return "CommandParam {" + "command='" + command + '\'' + ", timeout=" + timeout + '}';
-  }
-
-  /** Builder for <code>CommandParam</code> */
-  public static class Builder {
-    // Required parameters
-    private final String command;
-
-    // Optional parameters - initialized to default values
-    private long timeout = 86400;
-
-    /** @param command a string command */
-    public Builder(@Nonnull String command) {
-      this.command = command;
-    }
-
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
-    public CommandParam build() {
-      return new CommandParam(this);
-    }
-  }
-}

+ 19 - 0
src/main/java/io/milvus/client/ConnectFailedException.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.client;
 
 /** Thrown when client failed to connect to server */

+ 15 - 13
src/main/java/io/milvus/client/ConnectParam.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -39,7 +41,7 @@ public class ConnectParam {
 
   @Override
   public String toString() {
-    return "ConnectParam {" + "host='" + host + '\'' + ", port='" + port + '\'' + '}';
+    return "ConnectParam{" + "host='" + host + '\'' + ", port='" + port + '\'' + '}';
   }
 
   /** Builder for <code>ConnectParam</code> */

+ 15 - 34
src/main/java/io/milvus/client/CreateIndexParam.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -24,12 +26,10 @@ public class CreateIndexParam {
 
   private final String tableName;
   private final Index index;
-  private final long timeout;
 
   private CreateIndexParam(@Nonnull Builder builder) {
     this.tableName = builder.tableName;
     this.index = builder.index;
-    this.timeout = builder.timeout;
   }
 
   public String getTableName() {
@@ -40,15 +40,9 @@ public class CreateIndexParam {
     return index;
   }
 
-  public long getTimeout() {
-    return timeout;
-  }
-
   @Override
   public String toString() {
-    return String.format(
-        "IndexParam = {tableName = %s, index = {indexType = %s, nList = %d}, timeout = %d}",
-        tableName, index.getIndexType().name(), index.getNList(), timeout);
+    return "CreateIndexParam{" + "tableName='" + tableName + '\'' + ", index=" + index + '}';
   }
 
   /** Builder for <code>CreateIndexParam</code> */
@@ -58,7 +52,6 @@ public class CreateIndexParam {
 
     // Optional parameters - initialized to default values
     private Index index;
-    private long timeout = 86400;
 
     /** @param tableName table to create index on */
     public Builder(@Nonnull String tableName) {
@@ -77,18 +70,6 @@ public class CreateIndexParam {
       return this;
     }
 
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
     public CreateIndexParam build() {
       return new CreateIndexParam(this);
     }

+ 14 - 12
src/main/java/io/milvus/client/DateRange.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 0 - 94
src/main/java/io/milvus/client/DeleteByRangeParam.java

@@ -1,94 +0,0 @@
-/*
- * 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.client;
-
-import javax.annotation.Nonnull;
-
-/** Contains parameters for <code>deleteByRange</code> */
-public class DeleteByRangeParam {
-  private final DateRange dateRange;
-  private final String tableName;
-  private final long timeout;
-
-  private DeleteByRangeParam(@Nonnull Builder builder) {
-    this.dateRange = builder.dateRange;
-    this.tableName = builder.tableName;
-    this.timeout = builder.timeout;
-  }
-
-  public DateRange getDateRange() {
-    return dateRange;
-  }
-
-  public String getTableName() {
-    return tableName;
-  }
-
-  public long getTimeout() {
-    return timeout;
-  }
-
-  @Override
-  public String toString() {
-    return "DeleteByRangeParam {"
-        + "dateRange = "
-        + dateRange.toString()
-        + ", tableName = '"
-        + tableName
-        + '\''
-        + ", timeout = "
-        + timeout
-        + '}';
-  }
-
-  /** Builder for <code>DeleteByRangeParam</code> */
-  public static final class Builder {
-    // Required parameters
-    private final DateRange dateRange;
-    private final String tableName;
-
-    // Optional parameters - initialized to default values
-    private long timeout = 86400;
-
-    /**
-     * @param dateRange a <code>DateRange</code> object
-     * @param tableName table to delete from
-     * @see DateRange
-     */
-    public Builder(@Nonnull DateRange dateRange, @Nonnull String tableName) {
-      this.dateRange = dateRange;
-      this.tableName = tableName;
-    }
-
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
-    public DeleteByRangeParam build() {
-      return new DeleteByRangeParam(this);
-    }
-  }
-}

+ 14 - 12
src/main/java/io/milvus/client/DescribeIndexResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 12
src/main/java/io/milvus/client/DescribeTableResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 12
src/main/java/io/milvus/client/GetTableRowCountResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 12
src/main/java/io/milvus/client/HasTableResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 12
src/main/java/io/milvus/client/Index.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 15 - 12
src/main/java/io/milvus/client/IndexType.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -22,6 +24,7 @@ import java.util.Optional;
 
 /**
  * Represents different types of indexing method to query the table:
+ *
  * <pre>
  *
  * 1. FLAT - Provides 100% accuracy for recalls. However, performance might be downgraded due to huge computation effort;

+ 14 - 31
src/main/java/io/milvus/client/InsertParam.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -26,13 +28,11 @@ public class InsertParam {
   private final String tableName;
   private final List<List<Float>> vectors;
   private final List<Long> vectorIds;
-  private final long timeout;
 
   private InsertParam(@Nonnull Builder builder) {
     this.tableName = builder.tableName;
     this.vectors = builder.vectors;
     this.vectorIds = builder.vectorIds;
-    this.timeout = builder.timeout;
   }
 
   public String getTableName() {
@@ -47,10 +47,6 @@ public class InsertParam {
     return vectorIds;
   }
 
-  public long getTimeout() {
-    return timeout;
-  }
-
   /** Builder for <code>InsertParam</code> */
   public static class Builder {
     // Required parameters
@@ -59,7 +55,6 @@ public class InsertParam {
 
     // Optional parameters - initialized to default values
     private List<Long> vectorIds = new ArrayList<>();
-    private long timeout = 86400;
 
     /**
      * @param tableName table to insert vectors to
@@ -82,18 +77,6 @@ public class InsertParam {
       return this;
     }
 
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
     public InsertParam build() {
       return new InsertParam(this);
     }

+ 14 - 12
src/main/java/io/milvus/client/InsertResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 12
src/main/java/io/milvus/client/MetricType.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 43 - 141
src/main/java/io/milvus/client/MilvusClient.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -20,7 +22,7 @@ package io.milvus.client;
 /** The Milvus Client Interface */
 public interface MilvusClient {
 
-  String clientVersion = "0.1.2";
+  String clientVersion = "0.2.0";
 
   /** @return the current Milvus client version */
   default String getClientVersion() {
@@ -31,7 +33,7 @@ public interface MilvusClient {
    * Connects to Milvus server
    *
    * @param connectParam the <code>ConnectParam</code> object
-   *     <pre>
+   * <pre>
    * example usage:
    * <code>
    * ConnectParam connectParam = new ConnectParam.Builder()
@@ -64,72 +66,48 @@ public interface MilvusClient {
   /**
    * Creates table specified by <code>tableSchemaParam</code>
    *
-   * @param tableSchemaParam the <code>TableSchemaParam</code> object
-   *     <pre>
+   * @param tableSchema the <code>TableSchema</code> object
+   * <pre>
    * example usage:
    * <code>
    * TableSchema tableSchema = new TableSchema.Builder(tableName, dimension)
    *                                          .withIndexFileSize(1024)
    *                                          .withMetricType(MetricType.IP)
    *                                          .build();
-   * TableSchemaParam tableSchemaParam = new TableSchemaParam.Builder(tableSchema)
-   *                                                         .withTimeout(timeout)
-   *                                                         .build();
    * </code>
    * </pre>
    *
    * @return <code>Response</code>
    * @see TableSchema
-   * @see TableSchemaParam
    * @see MetricType
    * @see Response
    */
-  Response createTable(TableSchemaParam tableSchemaParam);
+  Response createTable(TableSchema tableSchema);
 
   /**
-   * Check whether the table specified by <code>tableParam</code> exists
-   *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
+   * Check whether table exists
    *
+   * @param tableName table to check
    * @return <code>HasTableResponse</code>
-   * @see TableParam
    * @see HasTableResponse
    * @see Response
    */
-  HasTableResponse hasTable(TableParam tableParam);
+  HasTableResponse hasTable(String tableName);
 
   /**
-   * Drops the table specified by <code>tableParam</code>
-   *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
+   * Drops table
    *
+   * @param tableName table to drop
    * @return <code>Response</code>
-   * @see TableParam
    * @see Response
    */
-  Response dropTable(TableParam tableParam);
+  Response dropTable(String tableName);
 
   /**
    * Creates index specified by <code>indexParam</code>
    *
    * @param createIndexParam the <code>CreateIndexParam</code> object
-   *     <pre>
+   * <pre>
    * example usage:
    * <code>
    * Index index = new Index.Builder()
@@ -138,7 +116,6 @@ public interface MilvusClient {
    *                        .build();
    * CreateIndexParam createIndexParam = new CreateIndexParam.Builder(tableName)
    *                                                         .withIndex(index)
-   *                                                         .withTimeout(timeout)
    *                                                         .build();
    * </code>
    * </pre>
@@ -155,12 +132,11 @@ public interface MilvusClient {
    * Inserts data specified by <code>insertParam</code>
    *
    * @param insertParam the <code>InsertParam</code> object
-   *     <pre>
+   * <pre>
    * example usage:
    * <code>
    * InsertParam insertParam = new InsertParam.Builder(tableName, vectors)
    *                                          .withVectorIds(vectorIds)
-   *                                          .withTimeout(timeout)
    *                                          .build();
    * </code>
    * </pre>
@@ -176,14 +152,13 @@ public interface MilvusClient {
    * Searches vectors specified by <code>searchParam</code>
    *
    * @param searchParam the <code>SearchParam</code> object
-   *     <pre>
+   * <pre>
    * example usage:
    * <code>
    * SearchParam searchParam = new SearchParam.Builder(tableName, vectorsToSearch)
    *                                          .withTopK(topK)
    *                                          .withNProbe(nProbe)
    *                                          .withDateRanges(dateRanges)
-   *                                          .withTimeout(timeout)
    *                                          .build();
    * </code>
    * </pre>
@@ -201,7 +176,7 @@ public interface MilvusClient {
    * Searches vectors in specific files specified by <code>searchInFilesParam</code>
    *
    * @param searchInFilesParam the <code>SearchInFilesParam</code> object
-   *     <pre>
+   * <pre>
    * example usage:
    * <code>
    * SearchParam searchParam = new SearchParam.Builder(tableName, vectorsToSearch)
@@ -210,7 +185,6 @@ public interface MilvusClient {
    *                                          .withDateRanges(dateRanges)
    *                                          .build();
    * SearchInFilesParam searchInFilesParam = new SearchInFilesParam.Builder(fileIds, searchParam)
-   *                                                               .withTimeout(timeout)
    *                                                               .build();
    * </code>
    * </pre>
@@ -226,24 +200,13 @@ public interface MilvusClient {
   SearchResponse searchInFiles(SearchInFilesParam searchInFilesParam);
 
   /**
-   * Describes table specified by <code>tableParam</code>
+   * Describes table
    *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
-   *
-   * @return <code>DescribeTableResponse</code>
-   * @see TableParam
+   * @param tableName table to describe
    * @see DescribeTableResponse
    * @see Response
    */
-  DescribeTableResponse describeTable(TableParam tableParam);
+  DescribeTableResponse describeTable(String tableName);
 
   /**
    * Shows current tables
@@ -255,23 +218,14 @@ public interface MilvusClient {
   ShowTablesResponse showTables();
 
   /**
-   * Gets current row count of table specified by <code>tableParam</code>
-   *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
+   * Gets current row count of table
    *
+   * @param tableName table to count
    * @return <code>GetTableRowCountResponse</code>
    * @see GetTableRowCountResponse
    * @see Response
    */
-  GetTableRowCountResponse getTableRowCount(TableParam tableParam);
+  GetTableRowCountResponse getTableRowCount(String tableName);
 
   /**
    * Prints server status
@@ -289,82 +243,30 @@ public interface MilvusClient {
    */
   Response getServerVersion();
 
-  /**
-   * Deletes vectors by date range, specified by <code>deleteByRangeParam</code>
-   *
-   * @param deleteByRangeParam the <code>DeleteByRangeParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * DeleteByRangeParam deleteByRangeParam = new DeleteByRangeParam.Builder(dateRange, tableName)
-   *                                                               .withTimeout(timeout)
-   *                                                               .build();
-   * </code>
-   * </pre>
-   *
-   * @return <code>Response</code>
-   * @see DeleteByRangeParam
-   * @see DateRange
-   * @see Response
-   */
-  Response deleteByRange(DeleteByRangeParam deleteByRangeParam);
-
   /**
    * Pre-loads table to memory
    *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
-   *
+   * @param tableName table to preload
    * @return <code>Response</code>
-   * @see TableParam
    * @see Response
    */
-  Response preloadTable(TableParam tableParam);
+  Response preloadTable(String tableName);
 
   /**
-   * Describes table index specified by <code>tableParam</code>
-   *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
+   * Describes table index
    *
-   * @return <code>DescribeIndexResponse</code>
-   * @see TableParam
+   * @param tableName table to describe index of
    * @see DescribeIndexResponse
    * @see Index
    * @see Response
    */
-  DescribeIndexResponse describeIndex(TableParam tableParam);
+  DescribeIndexResponse describeIndex(String tableName);
 
   /**
-   * Drops table index specified by <code>tableParam</code>
-   *
-   * @param tableParam the <code>TableParam</code> object
-   *     <pre>
-   * example usage:
-   * <code>
-   * TableParam tableParam = new TableParam.Builder(tableName)
-   *                                       .withTimeout(timeout)
-   *                                       .build();
-   * </code>
-   * </pre>
+   * Drops table index
    *
-   * @return <code>dropIndex</code>
-   * @see TableParam
+   * @param tableName table to drop index of
    * @see Response
    */
-  Response dropIndex(TableParam tableParam);
+  Response dropIndex(String tableName);
 }

+ 50 - 99
src/main/java/io/milvus/client/MilvusGrpcClient.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -41,7 +43,7 @@ public class MilvusGrpcClient implements MilvusClient {
   private static final String ANSI_BRIGHT_PURPLE = "\u001B[95m";
 
   private ManagedChannel channel = null;
-  private io.milvus.grpc.MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub;
+  private io.milvus.grpc.MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub = null;
 
   /////////////////////// Client Calls///////////////////////
 
@@ -82,7 +84,9 @@ public class MilvusGrpcClient implements MilvusClient {
       blockingStub = io.milvus.grpc.MilvusServiceGrpc.newBlockingStub(channel);
 
     } catch (Exception e) {
-      logSevere("Connect failed! {0}\n{1}", connectParam.toString(), e.toString());
+      if (!(e instanceof ConnectFailedException)) {
+        logSevere("Connect failed! {0}\n{1}", connectParam.toString(), e.toString());
+      }
       throw new ConnectFailedException("Exception occurred: " + e.toString());
     }
 
@@ -121,14 +125,13 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public Response createTable(@Nonnull TableSchemaParam tableSchemaParam) {
+  public Response createTable(@Nonnull TableSchema tableSchema) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new Response(Response.Status.CLIENT_NOT_CONNECTED);
     }
 
-    TableSchema tableSchema = tableSchemaParam.getTableSchema();
     io.milvus.grpc.TableSchema request =
         io.milvus.grpc.TableSchema.newBuilder()
             .setTableName(tableSchema.getTableName())
@@ -140,10 +143,7 @@ public class MilvusGrpcClient implements MilvusClient {
     io.milvus.grpc.Status response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableSchemaParam.getTimeout(), TimeUnit.SECONDS)
-              .createTable(request);
+      response = blockingStub.createTable(request);
 
       if (response.getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Created table successfully!\n{0}", tableSchema.toString());
@@ -164,23 +164,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public HasTableResponse hasTable(@Nonnull TableParam tableParam) {
+  public HasTableResponse hasTable(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new HasTableResponse(new Response(Response.Status.CLIENT_NOT_CONNECTED), false);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.BoolReply response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .hasTable(request);
+      response = blockingStub.hasTable(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("hasTable `{0}` = {1}", tableName, response.getBoolReply());
@@ -200,23 +196,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public Response dropTable(@Nonnull TableParam tableParam) {
+  public Response dropTable(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new Response(Response.Status.CLIENT_NOT_CONNECTED);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.Status response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .dropTable(request);
+      response = blockingStub.dropTable(request);
 
       if (response.getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Dropped table `{0}` successfully!", tableName);
@@ -254,10 +246,7 @@ public class MilvusGrpcClient implements MilvusClient {
     io.milvus.grpc.Status response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(createIndexParam.getTimeout(), TimeUnit.SECONDS)
-              .createIndex(request);
+      response = blockingStub.createIndex(request);
 
       if (response.getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Created index successfully!\n{0}", createIndexParam.toString());
@@ -299,10 +288,7 @@ public class MilvusGrpcClient implements MilvusClient {
     io.milvus.grpc.VectorIds response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(insertParam.getTimeout(), TimeUnit.SECONDS)
-              .insert(request);
+      response = blockingStub.insert(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         Optional<List<Long>> resultVectorIds = Optional.ofNullable(response.getVectorIdArrayList());
@@ -351,10 +337,7 @@ public class MilvusGrpcClient implements MilvusClient {
     io.milvus.grpc.TopKQueryResultList response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(searchParam.getTimeout(), TimeUnit.SECONDS)
-              .search(request);
+      response = blockingStub.search(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         List<List<SearchResponse.QueryResult>> queryResultsList = getQueryResultsList(response);
@@ -410,10 +393,7 @@ public class MilvusGrpcClient implements MilvusClient {
     io.milvus.grpc.TopKQueryResultList response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(searchInFilesParam.getTimeout(), TimeUnit.SECONDS)
-              .searchInFiles(request);
+      response = blockingStub.searchInFiles(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Search in files {0} completed successfully!", searchInFilesParam.getFileIds());
@@ -438,23 +418,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public DescribeTableResponse describeTable(@Nonnull TableParam tableParam) {
+  public DescribeTableResponse describeTable(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new DescribeTableResponse(new Response(Response.Status.CLIENT_NOT_CONNECTED), null);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.TableSchema response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .describeTable(request);
+      response = blockingStub.describeTable(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         TableSchema tableSchema =
@@ -513,23 +489,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public GetTableRowCountResponse getTableRowCount(@Nonnull TableParam tableParam) {
+  public GetTableRowCountResponse getTableRowCount(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new GetTableRowCountResponse(new Response(Response.Status.CLIENT_NOT_CONNECTED), 0);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.TableRowCount response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .countTable(request);
+      response = blockingStub.countTable(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         long tableRowCount = response.getTableRowCount();
@@ -551,30 +523,26 @@ public class MilvusGrpcClient implements MilvusClient {
 
   @Override
   public Response getServerStatus() {
-    CommandParam commandParam = new CommandParam.Builder("OK").build();
-    return command(commandParam);
+    return command("OK");
   }
 
   @Override
   public Response getServerVersion() {
-    CommandParam commandParam = new CommandParam.Builder("version").build();
-    return command(commandParam);
+    return command("version");
   }
 
-  private Response command(@Nonnull CommandParam commandParam) {
+  private Response command(@Nonnull String command) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new Response(Response.Status.CLIENT_NOT_CONNECTED);
     }
 
-    String command = commandParam.getCommand();
     io.milvus.grpc.Command request = io.milvus.grpc.Command.newBuilder().setCmd(command).build();
     io.milvus.grpc.StringReply response;
 
     try {
-      response =
-          blockingStub.withDeadlineAfter(commandParam.getTimeout(), TimeUnit.SECONDS).cmd(request);
+      response = blockingStub.cmd(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Command `{0}`: {1}", command, response.getStringReply());
@@ -591,7 +559,8 @@ public class MilvusGrpcClient implements MilvusClient {
     }
   }
 
-  public Response deleteByRange(@Nonnull DeleteByRangeParam deleteByRangeParam) {
+  // TODO: make deleteByRange private for now
+  private Response deleteByRange(@Nonnull String tableName, @Nonnull DateRange dateRange) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
@@ -600,28 +569,22 @@ public class MilvusGrpcClient implements MilvusClient {
 
     io.milvus.grpc.DeleteByRangeParam request =
         io.milvus.grpc.DeleteByRangeParam.newBuilder()
-            .setRange(getRange(deleteByRangeParam.getDateRange()))
-            .setTableName(deleteByRangeParam.getTableName())
+            .setRange(getRange(dateRange))
+            .setTableName(tableName)
             .build();
     io.milvus.grpc.Status response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(deleteByRangeParam.getTimeout(), TimeUnit.SECONDS)
-              .deleteByRange(request);
+      response = blockingStub.deleteByRange(request);
 
       if (response.getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo(
-            "Deleted vectors from table `{0}` in range {1} successfully!",
-            deleteByRangeParam.getTableName(), deleteByRangeParam.getDateRange().toString());
+            "Deleted vectors from table `{0}` in range {1} successfully!", tableName, dateRange);
         return new Response(Response.Status.SUCCESS);
       } else {
         logSevere(
             "Deleted vectors from table `{0}` in range {1} failed:\n{2}",
-            deleteByRangeParam.getTableName(),
-            deleteByRangeParam.getDateRange().toString(),
-            response.toString());
+            tableName, dateRange, response.toString());
         return new Response(
             Response.Status.valueOf(response.getErrorCodeValue()), response.getReason());
       }
@@ -632,23 +595,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public Response preloadTable(@Nonnull TableParam tableParam) {
+  public Response preloadTable(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new Response(Response.Status.CLIENT_NOT_CONNECTED);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.Status response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .preloadTable(request);
+      response = blockingStub.preloadTable(request);
 
       if (response.getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Preloaded table `{0}` successfully!", tableName);
@@ -665,23 +624,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public DescribeIndexResponse describeIndex(@Nonnull TableParam tableParam) {
+  public DescribeIndexResponse describeIndex(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new DescribeIndexResponse(new Response(Response.Status.CLIENT_NOT_CONNECTED), null);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.IndexParam response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .describeIndex(request);
+      response = blockingStub.describeIndex(request);
 
       if (response.getStatus().getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         Index index =
@@ -706,23 +661,19 @@ public class MilvusGrpcClient implements MilvusClient {
   }
 
   @Override
-  public Response dropIndex(@Nonnull TableParam tableParam) {
+  public Response dropIndex(@Nonnull String tableName) {
 
     if (!isConnected()) {
       logWarning("You are not connected to Milvus server");
       return new Response(Response.Status.CLIENT_NOT_CONNECTED);
     }
 
-    String tableName = tableParam.getTableName();
     io.milvus.grpc.TableName request =
         io.milvus.grpc.TableName.newBuilder().setTableName(tableName).build();
     io.milvus.grpc.Status response;
 
     try {
-      response =
-          blockingStub
-              .withDeadlineAfter(tableParam.getTimeout(), TimeUnit.SECONDS)
-              .dropIndex(request);
+      response = blockingStub.dropIndex(request);
 
       if (response.getErrorCode() == io.milvus.grpc.ErrorCode.SUCCESS) {
         logInfo("Dropped index for table `{0}` successfully!", tableName);
@@ -753,7 +704,7 @@ public class MilvusGrpcClient implements MilvusClient {
     List<io.milvus.grpc.Range> queryRangeList = new ArrayList<>();
     String datePattern = "yyyy-MM-dd";
     SimpleDateFormat simpleDateFormat = new SimpleDateFormat(datePattern);
-    for (DateRange queryRange : searchParam.getdateRanges()) {
+    for (DateRange queryRange : searchParam.getDateRanges()) {
       io.milvus.grpc.Range dateRange =
           io.milvus.grpc.Range.newBuilder()
               .setStartValue(simpleDateFormat.format(queryRange.getStartDate()))

+ 14 - 12
src/main/java/io/milvus/client/Response.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 33
src/main/java/io/milvus/client/SearchInFilesParam.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -24,12 +26,10 @@ import java.util.List;
 public class SearchInFilesParam {
   private final List<String> fileIds;
   private final SearchParam searchParam;
-  private final long timeout;
 
   private SearchInFilesParam(@Nonnull Builder builder) {
     this.fileIds = builder.fileIds;
     this.searchParam = builder.searchParam;
-    this.timeout = builder.timeout;
   }
 
   public List<String> getFileIds() {
@@ -40,19 +40,12 @@ public class SearchInFilesParam {
     return searchParam;
   }
 
-  public long getTimeout() {
-    return timeout;
-  }
-
   /** Builder for <code>SearchInFilesParam</code> */
   public static class Builder {
     // Required parameters
     private final List<String> fileIds;
     private final SearchParam searchParam;
 
-    // Optional parameters - initialized to default values
-    private long timeout = 86400;
-
     /**
      * @param fileIds a <code>List</code> of file ids to search from
      * @param searchParam a <code>searchParam</code> object
@@ -62,18 +55,6 @@ public class SearchInFilesParam {
       this.searchParam = searchParam;
     }
 
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
     public SearchInFilesParam build() {
       return new SearchInFilesParam(this);
     }

+ 15 - 32
src/main/java/io/milvus/client/SearchParam.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -29,7 +31,6 @@ public class SearchParam {
   private final List<DateRange> dateRanges;
   private final long topK;
   private final long nProbe;
-  private final long timeout;
 
   private SearchParam(@Nonnull Builder builder) {
     this.tableName = builder.tableName;
@@ -37,7 +38,6 @@ public class SearchParam {
     this.dateRanges = builder.dateRanges;
     this.nProbe = builder.nProbe;
     this.topK = builder.topK;
-    this.timeout = builder.timeout;
   }
 
   public String getTableName() {
@@ -48,7 +48,7 @@ public class SearchParam {
     return queryVectors;
   }
 
-  public List<DateRange> getdateRanges() {
+  public List<DateRange> getDateRanges() {
     return dateRanges;
   }
 
@@ -60,10 +60,6 @@ public class SearchParam {
     return nProbe;
   }
 
-  public long getTimeout() {
-    return timeout;
-  }
-
   /** Builder for <code>SearchParam</code> */
   public static class Builder {
     // Required parameters
@@ -74,7 +70,6 @@ public class SearchParam {
     private List<DateRange> dateRanges = new ArrayList<>();
     private long topK = 1024;
     private long nProbe = 20;
-    private long timeout = 86400;
 
     /**
      * @param tableName table to search from
@@ -121,18 +116,6 @@ public class SearchParam {
       return this;
     }
 
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
     public SearchParam build() {
       return new SearchParam(this);
     }

+ 14 - 12
src/main/java/io/milvus/client/SearchResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 14 - 12
src/main/java/io/milvus/client/ShowTablesResponse.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 0 - 78
src/main/java/io/milvus/client/TableParam.java

@@ -1,78 +0,0 @@
-/*
- * 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.client;
-
-import javax.annotation.Nonnull;
-
-/**
- * Contains parameters for <code>hasTable</code>, <code>dropTable</code>, <code>describeTable</code>
- * , <code>getTableRowCount</code>, <code>preloadTable</code>, <code>describeIndex</code> and <code>
- * dropIndex</code>
- */
-public class TableParam {
-  private final String tableName;
-  private final long timeout;
-
-  private TableParam(@Nonnull Builder builder) {
-    this.tableName = builder.tableName;
-    this.timeout = builder.timeout;
-  }
-
-  public String getTableName() {
-    return tableName;
-  }
-
-  public long getTimeout() {
-    return timeout;
-  }
-
-  @Override
-  public String toString() {
-    return "TableParam {" + "tableName = '" + tableName + '\'' + ", timeout = " + timeout + '}';
-  }
-
-  /** Builder for <code>TableParam</code> */
-  public static class Builder {
-    // Required parameters
-    private final String tableName;
-
-    // Optional parameters - initialized to default values
-    private long timeout = 86400;
-
-    /** @param tableName table name */
-    public Builder(@Nonnull String tableName) {
-      this.tableName = tableName;
-    }
-
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
-    public TableParam build() {
-      return new TableParam(this);
-    }
-  }
-}

+ 14 - 12
src/main/java/io/milvus/client/TableSchema.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;

+ 0 - 77
src/main/java/io/milvus/client/TableSchemaParam.java

@@ -1,77 +0,0 @@
-/*
- * 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.client;
-
-import javax.annotation.Nonnull;
-
-/** Contains parameters for <code>createTable</code> */
-public class TableSchemaParam {
-  private final TableSchema tableSchema;
-  private final long timeout;
-
-  private TableSchemaParam(@Nonnull Builder builder) {
-    this.tableSchema = builder.tableSchema;
-    this.timeout = builder.timeout;
-  }
-
-  public TableSchema getTableSchema() {
-    return tableSchema;
-  }
-
-  public long getTimeout() {
-    return timeout;
-  }
-
-  @Override
-  public String toString() {
-    return "CreateTableParam {" + tableSchema + ", timeout = " + timeout + '}';
-  }
-
-  /** Builder for <code>TableSchemaParam</code> */
-  public static class Builder {
-    // Required parameters
-    private final TableSchema tableSchema;
-
-    // Optional parameters - initialized to default values
-    private long timeout = 86400;
-
-    /**
-     * @param tableSchema a <code>TableSchema</code> object
-     * @see TableSchema
-     */
-    public Builder(@Nonnull TableSchema tableSchema) {
-      this.tableSchema = tableSchema;
-    }
-
-    /**
-     * Optional. Sets the deadline from when the client RPC is set to when the response is picked up
-     * by the client. Default to 86400s (1 day).
-     *
-     * @param timeout in seconds
-     * @return <code>Builder</code>
-     */
-    public Builder withTimeout(long timeout) {
-      this.timeout = timeout;
-      return this;
-    }
-
-    public TableSchemaParam build() {
-      return new TableSchemaParam(this);
-    }
-  }
-}

+ 48 - 54
src/test/java/io/milvus/client/MilvusGrpcClientTest.java

@@ -1,18 +1,20 @@
 /*
- * 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
+ * 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
+ *   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.
+ * 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.client;
@@ -26,22 +28,22 @@ import java.util.stream.DoubleStream;
 
 import static org.junit.jupiter.api.Assertions.*;
 
-class MilvusGrpcClientTest {
+class MilvusClientTest {
 
-  private MilvusGrpcClient client;
+  private MilvusClient client;
 
   private RandomStringGenerator generator;
 
   private String randomTableName;
   private long size;
   private long dimension;
-  private TableParam tableParam;
 
   // Helper function that generates random vectors
   static List<List<Float>> generateVectors(long vectorCount, long dimension) {
     SplittableRandom splittableRandom = new SplittableRandom();
     List<List<Float>> vectors = new ArrayList<>();
     for (int i = 0; i < vectorCount; ++i) {
+      splittableRandom = splittableRandom.split();
       DoubleStream doubleStream = splittableRandom.doubles(dimension);
       List<Float> vector =
           doubleStream.boxed().map(Double::floatValue).collect(Collectors.toList());
@@ -71,49 +73,60 @@ class MilvusGrpcClientTest {
     randomTableName = generator.generate(10);
     size = 100000;
     dimension = 128;
-    tableParam = new TableParam.Builder(randomTableName).build();
-    TableSchema tableSchema = new TableSchema.Builder(randomTableName, dimension)
+    TableSchema tableSchema =
+        new TableSchema.Builder(randomTableName, dimension)
             .withIndexFileSize(1024)
             .withMetricType(MetricType.IP)
             .build();
-    TableSchemaParam tableSchemaParam = new TableSchemaParam.Builder(tableSchema).build();
 
-    assertTrue(client.createTable(tableSchemaParam).ok());
+    assertTrue(client.createTable(tableSchema).ok());
   }
 
   @org.junit.jupiter.api.AfterEach
   void tearDown() throws InterruptedException {
-    assertTrue(client.dropTable(tableParam).ok());
+    assertTrue(client.dropTable(randomTableName).ok());
     client.disconnect();
   }
 
+  @org.junit.jupiter.api.Test
+  void connectInvalidPort() {
+    MilvusClient client = new MilvusGrpcClient();
+    ConnectParam connectParam =
+        new ConnectParam.Builder().withHost("localhost").withPort("66666").build();
+    assertThrows(ConnectFailedException.class, () -> client.connect(connectParam));
+  }
+
+  @org.junit.jupiter.api.Test
+  void connectUnreachableHost() {
+    MilvusClient client = new MilvusGrpcClient();
+    ConnectParam connectParam = new ConnectParam.Builder().withHost("250.250.250.250").build();
+    assertThrows(ConnectFailedException.class, () -> client.connect(connectParam));
+  }
+
   @org.junit.jupiter.api.Test
   void isConnected() {
     assertTrue(client.isConnected());
   }
 
   @org.junit.jupiter.api.Test
-  void createTable() {
+  void createInvalidTable() {
     String invalidTableName = "╯°□°)╯";
     TableSchema invalidTableSchema = new TableSchema.Builder(invalidTableName, dimension).build();
-    TableSchemaParam invalidTableSchemaParam =
-        new TableSchemaParam.Builder(invalidTableSchema).withTimeout(20).build();
-    Response createTableResponse = client.createTable(invalidTableSchemaParam);
+    Response createTableResponse = client.createTable(invalidTableSchema);
     assertFalse(createTableResponse.ok());
     assertEquals(Response.Status.ILLEGAL_TABLE_NAME, createTableResponse.getStatus());
   }
 
   @org.junit.jupiter.api.Test
   void hasTable() {
-    HasTableResponse hasTableResponse = client.hasTable(tableParam);
+    HasTableResponse hasTableResponse = client.hasTable(randomTableName);
     assertTrue(hasTableResponse.getResponse().ok());
   }
 
   @org.junit.jupiter.api.Test
   void dropTable() {
     String nonExistingTableName = generator.generate(10);
-    TableParam tableParam = new TableParam.Builder(nonExistingTableName).build();
-    Response dropTableResponse = client.dropTable(tableParam);
+    Response dropTableResponse = client.dropTable(nonExistingTableName);
     assertFalse(dropTableResponse.ok());
     assertEquals(Response.Status.TABLE_NOT_EXISTS, dropTableResponse.getStatus());
   }
@@ -139,7 +152,7 @@ class MilvusGrpcClientTest {
   @org.junit.jupiter.api.Test
   void search() throws InterruptedException {
     List<List<Float>> vectors = generateVectors(size, dimension);
-    vectors.forEach(MilvusGrpcClientTest::normalizeVector);
+    vectors = vectors.stream().map(MilvusClientTest::normalizeVector).collect(Collectors.toList());
     InsertParam insertParam = new InsertParam.Builder(randomTableName, vectors).build();
     InsertResponse insertResponse = client.insert(insertParam);
     assertTrue(insertResponse.getResponse().ok());
@@ -161,7 +174,6 @@ class MilvusGrpcClientTest {
     c.add(Calendar.DAY_OF_MONTH, 1);
     Date tomorrow = c.getTime();
     queryRanges.add(new DateRange(yesterday, tomorrow));
-    System.out.println(queryRanges);
     final long topK = 1000;
     SearchParam searchParam =
         new SearchParam.Builder(randomTableName, vectorsToSearch)
@@ -178,7 +190,7 @@ class MilvusGrpcClientTest {
     for (int i = 0; i < searchSize; i++) {
       SearchResponse.QueryResult firstQueryResult = queryResultsList.get(i).get(0);
       assertEquals(vectorIds.get(i), firstQueryResult.getVectorId());
-      assertTrue(firstQueryResult.getDistance() > (1 - epsilon));
+      assertTrue(Math.abs(1 - firstQueryResult.getDistance()) < (1 - epsilon));
     }
   }
 
@@ -188,13 +200,12 @@ class MilvusGrpcClientTest {
 
   @org.junit.jupiter.api.Test
   void describeTable() {
-    DescribeTableResponse describeTableResponse = client.describeTable(tableParam);
+    DescribeTableResponse describeTableResponse = client.describeTable(randomTableName);
     assertTrue(describeTableResponse.getResponse().ok());
     assertTrue(describeTableResponse.getTableSchema().isPresent());
 
     String nonExistingTableName = generator.generate(10);
-    TableParam tableParam = new TableParam.Builder(nonExistingTableName).build();
-    describeTableResponse = client.describeTable(tableParam);
+    describeTableResponse = client.describeTable(nonExistingTableName);
     assertFalse(describeTableResponse.getResponse().ok());
     assertFalse(describeTableResponse.getTableSchema().isPresent());
   }
@@ -222,44 +233,27 @@ class MilvusGrpcClientTest {
     insert();
     TimeUnit.SECONDS.sleep(1);
 
-    GetTableRowCountResponse getTableRowCountResponse = client.getTableRowCount(tableParam);
+    GetTableRowCountResponse getTableRowCountResponse = client.getTableRowCount(randomTableName);
     assertTrue(getTableRowCountResponse.getResponse().ok());
     assertEquals(size, getTableRowCountResponse.getTableRowCount());
   }
 
-  @org.junit.jupiter.api.Test
-  void deleteByRange() {
-    Date today = new Date();
-    Calendar c = Calendar.getInstance();
-    c.setTime(today);
-    c.add(Calendar.DAY_OF_MONTH, -1);
-    Date yesterday = c.getTime();
-    c.setTime(today);
-    c.add(Calendar.DAY_OF_MONTH, 1);
-    Date tomorrow = c.getTime();
-
-    DeleteByRangeParam deleteByRangeParam =
-        new DeleteByRangeParam.Builder(new DateRange(yesterday, tomorrow), randomTableName).build();
-    Response deleteByRangeResponse = client.deleteByRange(deleteByRangeParam);
-    assertTrue(deleteByRangeResponse.ok());
-  }
-
   @org.junit.jupiter.api.Test
   void preloadTable() {
-    Response preloadTableResponse = client.preloadTable(tableParam);
+    Response preloadTableResponse = client.preloadTable(randomTableName);
     assertTrue(preloadTableResponse.ok());
   }
 
   @org.junit.jupiter.api.Test
   void describeIndex() {
-    DescribeIndexResponse describeIndexResponse = client.describeIndex(tableParam);
+    DescribeIndexResponse describeIndexResponse = client.describeIndex(randomTableName);
     assertTrue(describeIndexResponse.getResponse().ok());
     assertTrue(describeIndexResponse.getIndex().isPresent());
   }
 
   @org.junit.jupiter.api.Test
   void dropIndex() {
-    Response dropIndexResponse = client.dropIndex(tableParam);
+    Response dropIndexResponse = client.dropIndex(randomTableName);
     assertTrue(dropIndexResponse.ok());
   }
 }