Browse Source

SDK 0.8.1

Signed-off-by: sahuang <xiaohai.xu@zilliz.com>
sahuang 5 years ago
parent
commit
f5cfbf3b8f

+ 1 - 0
README.md

@@ -15,6 +15,7 @@ The following table shows compatibilities between Milvus and Java SDK.
 
 | Milvus version | Java SDK version |
 | :------------: | :--------------: |
+|     0.9.1      |    0.8.1         |
 |     0.9.0      |    0.8.0         |
 |     0.8.0      |    0.7.0         |
 |     0.7.1      |    0.6.0         |

+ 2 - 2
examples/pom.xml

@@ -25,7 +25,7 @@
 
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java-examples</artifactId>
-    <version>0.8.0</version>
+    <version>0.8.1</version>
     <build>
         <plugins>
             <plugin>
@@ -63,7 +63,7 @@
         <dependency>
             <groupId>io.milvus</groupId>
             <artifactId>milvus-sdk-java</artifactId>
-            <version>0.9.0-SNAPSHOT</version>
+            <version>0.8.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>com.google.code.gson</groupId>

+ 1 - 1
pom.xml

@@ -25,7 +25,7 @@
 
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java</artifactId>
-    <version>0.9.0-SNAPSHOT</version>
+    <version>0.8.1-SNAPSHOT</version>
     <packaging>jar</packaging>
 
     <name>io.milvus:milvus-sdk-java</name>

+ 2 - 2
src/main/java/io/milvus/client/MilvusClient.java

@@ -26,9 +26,9 @@ import java.util.List;
 /** The Milvus Client Interface */
 public interface MilvusClient {
 
-  String clientVersion = "0.9.0";
+  String clientVersion = "0.8.1";
 
-  /** @return current Milvus client version: 0.9.0 */
+  /** @return current Milvus client version: 0.8.1 */
   default String getClientVersion() {
     return clientVersion;
   }

+ 7 - 0
src/main/java/io/milvus/client/MilvusGrpcClient.java

@@ -93,6 +93,13 @@ public class MilvusGrpcClient implements MilvusClient {
       blockingStub = MilvusServiceGrpc.newBlockingStub(channel);
       futureStub = MilvusServiceGrpc.newFutureStub(channel);
 
+      // check server version
+      String serverVersion = getServerVersion().getMessage();
+      if (!serverVersion.contains("0.9.")) {
+        logError("Connect failed! Server version {} does not match SDK version 0.8.1", serverVersion);
+        throw new ConnectFailedException("Failed to connect to Milvus server.");
+      }
+
     } catch (Exception e) {
       if (!(e instanceof ConnectFailedException)) {
         logError("Connect failed! {}", e.toString());

+ 2 - 1
src/main/java/io/milvus/client/Response.java

@@ -93,7 +93,8 @@ public class Response {
     // Client side error
     RPC_ERROR(-1),
     CLIENT_NOT_CONNECTED(-2),
-    UNKNOWN(-3);
+    UNKNOWN(-3),
+    VERSION_MISMATCH(-4);
 
     private final int code;