|
@@ -26,6 +26,8 @@ import io.milvus.param.ParamUtils;
|
|
|
import lombok.Getter;
|
|
|
import lombok.NonNull;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
/**
|
|
|
* Parameters for <code>loadCollection</code> interface.
|
|
|
*/
|
|
@@ -90,7 +92,7 @@ public class LoadCollectionParam {
|
|
|
/**
|
|
|
* Enable sync mode for load action.
|
|
|
* With sync mode enabled, the client keeps waiting until all segments of the collection successfully loaded.
|
|
|
- *
|
|
|
+ * <p>
|
|
|
* If sync mode disabled, client returns at once after the loadCollection() is called.
|
|
|
*
|
|
|
* @param syncLoad <code>Boolean.TRUE</code> is sync mode, Boolean.FALSE is not
|
|
@@ -104,10 +106,10 @@ public class LoadCollectionParam {
|
|
|
/**
|
|
|
* Sets waiting interval in sync mode. With sync mode enabled, the client will constantly check collection load state by interval.
|
|
|
* Interval must be greater than zero, and cannot be larger than Constant.MAX_WAITING_LOADING_INTERVAL.
|
|
|
- * @see Constant
|
|
|
*
|
|
|
* @param milliseconds interval
|
|
|
* @return <code>Builder</code>
|
|
|
+ * @see Constant
|
|
|
*/
|
|
|
public Builder withSyncLoadWaitingInterval(@NonNull Long milliseconds) {
|
|
|
this.syncLoadWaitingInterval = milliseconds;
|
|
@@ -117,10 +119,10 @@ public class LoadCollectionParam {
|
|
|
/**
|
|
|
* Sets timeout value for the sync mode.
|
|
|
* Timeout value must be greater than zero, and cannot be greater than Constant.MAX_WAITING_LOADING_TIMEOUT.
|
|
|
- * @see Constant
|
|
|
*
|
|
|
* @param seconds time out value for sync mode
|
|
|
* @return <code>Builder</code>
|
|
|
+ * @see Constant
|
|
|
*/
|
|
|
public Builder withSyncLoadWaitingTimeout(@NonNull Long seconds) {
|
|
|
this.syncLoadWaitingTimeout = seconds;
|
|
@@ -146,7 +148,7 @@ public class LoadCollectionParam {
|
|
|
public LoadCollectionParam build() throws ParamException {
|
|
|
ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
|
|
|
|
|
|
- if (syncLoad == Boolean.TRUE) {
|
|
|
+ if (Objects.equals(syncLoad, Boolean.TRUE)) {
|
|
|
if (syncLoadWaitingInterval <= 0) {
|
|
|
throw new ParamException("Sync load waiting interval must be larger than zero");
|
|
|
} else if (syncLoadWaitingInterval > Constant.MAX_WAITING_LOADING_INTERVAL) {
|