Prechádzať zdrojové kódy

Merge pull request #92 from sunyaofei/0.7.0

ignore *.iml generated by IntelliJ IDEA and pass args to example main
Xiaohai Xu 5 rokov pred
rodič
commit
b91b3dc17a

+ 1 - 0
.gitignore

@@ -24,4 +24,5 @@ hs_err_pid*
 
 .idea/
 target/
+*.iml
 

+ 0 - 2
examples/milvus-sdk-java-examples.iml

@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4" />

+ 6 - 2
examples/src/main/java/MilvusClientExample.java

@@ -61,8 +61,12 @@ public class MilvusClientExample {
   public static void main(String[] args) throws InterruptedException, ConnectFailedException {
 
     // You may need to change the following to the host and port of your Milvus server
-    final String host = "localhost";
-    final int port = 19530;
+    String host = "localhost";
+    int port = 19530;
+    if (args.length >= 2) {
+      host = args[0];
+      port = Integer.parseInt(args[1]);
+    }
 
     // Create Milvus client
     // You can specify the log level. Currently we have three levels of logs: INFO, WARNING and