|
@@ -20,6 +20,7 @@
|
|
package io.milvus.param.dml;
|
|
package io.milvus.param.dml;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
+import io.milvus.common.clientenum.ConsistencyLevelEnum;
|
|
import io.milvus.exception.ParamException;
|
|
import io.milvus.exception.ParamException;
|
|
import io.milvus.param.Constant;
|
|
import io.milvus.param.Constant;
|
|
import io.milvus.param.ParamUtils;
|
|
import io.milvus.param.ParamUtils;
|
|
@@ -40,6 +41,8 @@ public class QueryParam {
|
|
private final String expr;
|
|
private final String expr;
|
|
private final long travelTimestamp;
|
|
private final long travelTimestamp;
|
|
private final long guaranteeTimestamp;
|
|
private final long guaranteeTimestamp;
|
|
|
|
+ private final Long gracefulTime;
|
|
|
|
+ private final ConsistencyLevelEnum consistencyLevel;
|
|
|
|
|
|
private QueryParam(@NonNull Builder builder) {
|
|
private QueryParam(@NonNull Builder builder) {
|
|
this.collectionName = builder.collectionName;
|
|
this.collectionName = builder.collectionName;
|
|
@@ -48,6 +51,8 @@ public class QueryParam {
|
|
this.expr = builder.expr;
|
|
this.expr = builder.expr;
|
|
this.travelTimestamp = builder.travelTimestamp;
|
|
this.travelTimestamp = builder.travelTimestamp;
|
|
this.guaranteeTimestamp = builder.guaranteeTimestamp;
|
|
this.guaranteeTimestamp = builder.guaranteeTimestamp;
|
|
|
|
+ this.consistencyLevel = builder.consistencyLevel;
|
|
|
|
+ this.gracefulTime = builder.gracefulTime;
|
|
}
|
|
}
|
|
|
|
|
|
public static Builder newBuilder() {
|
|
public static Builder newBuilder() {
|
|
@@ -63,7 +68,9 @@ public class QueryParam {
|
|
private final List<String> outFields = new ArrayList<>();
|
|
private final List<String> outFields = new ArrayList<>();
|
|
private String expr = "";
|
|
private String expr = "";
|
|
private Long travelTimestamp = 0L;
|
|
private Long travelTimestamp = 0L;
|
|
|
|
+ private Long gracefulTime = 5000L;
|
|
private Long guaranteeTimestamp = Constant.GUARANTEE_EVENTUALLY_TS;
|
|
private Long guaranteeTimestamp = Constant.GUARANTEE_EVENTUALLY_TS;
|
|
|
|
+ private ConsistencyLevelEnum consistencyLevel;
|
|
|
|
|
|
private Builder() {
|
|
private Builder() {
|
|
}
|
|
}
|
|
@@ -79,6 +86,17 @@ public class QueryParam {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * ConsistencyLevel of consistency level.
|
|
|
|
+ *
|
|
|
|
+ * @param consistencyLevel consistency level
|
|
|
|
+ * @return <code>Builder</code>
|
|
|
|
+ */
|
|
|
|
+ public Builder withConsistencyLevel(ConsistencyLevelEnum consistencyLevel) {
|
|
|
|
+ this.consistencyLevel = consistencyLevel;
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Sets partition names list to specify query scope (Optional).
|
|
* Sets partition names list to specify query scope (Optional).
|
|
*
|
|
*
|
|
@@ -90,6 +108,17 @@ public class QueryParam {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Graceful time for BOUNDED Consistency Level
|
|
|
|
+ *
|
|
|
|
+ * @param gracefulTime graceful time
|
|
|
|
+ * @return <code>Builder</code>
|
|
|
|
+ */
|
|
|
|
+ public Builder withGracefulTime(Long gracefulTime) {
|
|
|
|
+ this.gracefulTime = gracefulTime;
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Adds a partition to specify query scope (Optional).
|
|
* Adds a partition to specify query scope (Optional).
|
|
*
|
|
*
|
|
@@ -202,6 +231,7 @@ public class QueryParam {
|
|
"collectionName='" + collectionName + '\'' +
|
|
"collectionName='" + collectionName + '\'' +
|
|
", partitionNames='" + partitionNames.toString() + '\'' +
|
|
", partitionNames='" + partitionNames.toString() + '\'' +
|
|
", expr='" + expr + '\'' +
|
|
", expr='" + expr + '\'' +
|
|
|
|
+ ", consistencyLevel='" + consistencyLevel + '\'' +
|
|
'}';
|
|
'}';
|
|
}
|
|
}
|
|
}
|
|
}
|