Browse Source

enhance: Remove the logic to set replica_number=1 by default (#963)

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
wei liu 1 year ago
parent
commit
dab67363fa

+ 4 - 4
src/main/java/io/milvus/param/collection/LoadCollectionParam.java

@@ -83,8 +83,8 @@ public class LoadCollectionParam {
         private Long syncLoadWaitingTimeout = 60L;
         private Long syncLoadWaitingTimeout = 60L;
 
 
         // replicaNumber:
         // replicaNumber:
-        //   The replica number to load, default by 1
-        private Integer replicaNumber = 1;
+        //   The replica number to load
+        private Integer replicaNumber = 0;
 
 
         // refresh:
         // refresh:
         //   This flag must be set to FALSE when first time call the loadCollection().
         //   This flag must be set to FALSE when first time call the loadCollection().
@@ -224,8 +224,8 @@ public class LoadCollectionParam {
                 }
                 }
             }
             }
 
 
-            if (replicaNumber <= 0) {
-                throw new ParamException("Replica number must be greater than zero");
+            if (replicaNumber < 0) {
+                throw new ParamException("Replica number can't be negative");
             }
             }
 
 
             return new LoadCollectionParam(this);
             return new LoadCollectionParam(this);

+ 2 - 2
src/main/java/io/milvus/param/partition/LoadPartitionsParam.java

@@ -86,8 +86,8 @@ public class LoadPartitionsParam {
         private Long syncLoadWaitingTimeout = 60L;
         private Long syncLoadWaitingTimeout = 60L;
 
 
         // replicaNumber:
         // replicaNumber:
-        //   The replica number to load, default by 1
-        private Integer replicaNumber = 1;
+        //   The replica number to load
+        private Integer replicaNumber = 0;
 
 
         // refresh:
         // refresh:
         //   This flag must be set to FALSE when first time call the loadPartitions().
         //   This flag must be set to FALSE when first time call the loadPartitions().