Browse Source

fix test case and update readme/changelog

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

+ 9 - 2
CHANGELOG.md

@@ -1,8 +1,15 @@
 # Changelog     
 
+## milvus-sdk-java 0.8.0 (2020-05-15)
+
+### Feature
+---
+- \#93 - Update Java SDK APIs for getVectorByID, collectionInfo and hasPartition
+- \#2295 - Rename sdk interfaces
+
 ## milvus-sdk-java 0.7.0 (2020-04-15)
 
-## Feature
+### Feature
 ---
 - \#261 - Integrate ANNOY into Milvus
 - \#1828 - Add searchAsync / createIndexAsync / insertAsync / flushAsync / compactAsync API
@@ -14,7 +21,7 @@
 - \#1641 - Fix incorrect error logging message
 - \#1642 - Fix compilation error of ByteBuffer
 
-## Feature
+### Feature
 ---
 - \#1603 - Add binary metrics: Substructure & Superstructure
 

+ 22 - 0
README.md

@@ -23,6 +23,7 @@ The following table shows compatibilities between Milvus and Java SDK.
    |     0.7.0      |    0.5.0    |
    |     0.7.1      |    0.6.0    |
    |     0.8.0      |    0.7.0    |
+   |     0.9.0      |    0.8.0    |
 
 ### Install Java SDK
 
@@ -55,3 +56,24 @@ Please refer to [examples](https://github.com/milvus-io/milvus-sdk-java/tree/mas
 ### Additional information
 
 - The Java source code is formatted using [google-java-format](https://github.com/google/google-java-format).
+- If you receive the following error when running your application:
+    ```
+    Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
+    ```
+  This is because SLF4J jar file needs to be added into your application's classpath. To fix this issue, you can use **Apache Maven** or **Gradle**/**Grails** to download the SDK.
+                                                                                                         
+    - Apache Maven
+ 
+        ```xml
+         <dependency>
+             <groupId>org.slf4j</groupId>
+             <artifactId>slf4j-api</artifactId>
+             <version>1.7.30</version>
+         </dependency>
+        ```
+ 
+    - Gradle/Grails
+ 
+         ```gradle
+         compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
+         ```

+ 6 - 1
examples/pom.xml

@@ -25,7 +25,7 @@
 
     <groupId>io.milvus</groupId>
     <artifactId>milvus-sdk-java-examples</artifactId>
-    <version>0.5.0</version>
+    <version>0.8.0</version>
     <build>
         <plugins>
             <plugin>
@@ -70,6 +70,11 @@
             <artifactId>gson</artifactId>
             <version>2.8.6</version>
         </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.7.30</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 1 - 4
examples/src/main/java/MilvusClientExample.java

@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.SplittableRandom;
 import java.util.concurrent.ExecutionException;
-import java.util.logging.Level;
 import java.util.stream.Collectors;
 import java.util.stream.DoubleStream;
 
@@ -69,9 +68,7 @@ public class MilvusClientExample {
     }
 
     // Create Milvus client
-    // You can specify the log level. Currently we have three levels of logs: INFO, WARNING and
-    // SEVERE
-    MilvusClient client = new MilvusGrpcClient(Level.ALL);
+    MilvusClient client = new MilvusGrpcClient();
 
     // Connect to Milvus server
     ConnectParam connectParam = new ConnectParam.Builder().withHost(host).withPort(port).build();

+ 2 - 2
src/test/java/io/milvus/client/MilvusGrpcClientTest.java

@@ -744,7 +744,7 @@ class MilvusClientTest {
 
     long previousSegmentSize = segmentInfo.getLong("data_size");
 
-    assertTrue(client.deleteByIds(randomCollectionName, vectorIds.subList(0, 100)).ok());
+    assertTrue(client.deleteByIds(randomCollectionName, vectorIds.subList(0, (int) size / 2)).ok());
     assertTrue(client.flush(randomCollectionName).ok());
     assertTrue(client.compact(randomCollectionName).ok());
 
@@ -786,7 +786,7 @@ class MilvusClientTest {
 
     long previousSegmentSize = segmentInfo.getLong("data_size");
 
-    assertTrue(client.deleteByIds(randomCollectionName, vectorIds.subList(0, 100)).ok());
+    assertTrue(client.deleteByIds(randomCollectionName, vectorIds.subList(0, (int) size / 2)).ok());
     assertTrue(client.flush(randomCollectionName).ok());
     assertTrue(client.compactAsync(randomCollectionName).get().ok());