query/search
interface.
- */
-public class FieldDataWrapper {
- private final FieldData fieldData;
-
- public FieldDataWrapper(@NonNull FieldData fieldData) {
- this.fieldData = fieldData;
- }
-
- public boolean isVectorField() {
- return fieldData.getType() == DataType.FloatVector || fieldData.getType() == DataType.BinaryVector;
- }
-
- /**
- * Get dimension of a vector field.
- * Throw {@link IllegalResponseException} if the field is not a vector filed.
- *
- * @return int
dimension of the vector field
- */
- public int getDim() throws IllegalResponseException {
- if (!isVectorField()) {
- throw new IllegalResponseException("Not a vector field");
- }
- return (int) fieldData.getVectors().getDim();
- }
-
- /**
- * Get row count of a field.
- * * Throws {@link IllegalResponseException} if the field type is illegal.
- *
- * @return long
row count of the field
- */
- public long getRowCount() throws IllegalResponseException {
- DataType dt = fieldData.getType();
- switch (dt) {
- case FloatVector: {
- int dim = getDim();
- System.out.println(fieldData.getVectors().getFloatVector().getDataCount());
- ListList>?>
- */
- public List> getFieldData() throws IllegalResponseException {
- DataType dt = fieldData.getType();
- switch (dt) {
- case FloatVector: {
- int dim = getDim();
- System.out.println(fieldData.getVectors().getFloatVector().getDataCount());
- ListgetCollectionStatistics
interface.
- */
-public class GetCollStatResponseWrapper {
- private final GetCollectionStatisticsResponse stat;
-
- public GetCollStatResponseWrapper(@NonNull GetCollectionStatisticsResponse stat) {
- this.stat = stat;
- }
-
- /**
- * Get row count of this field.
- * Throw {@link NumberFormatException} if the row count is not a number.
- *
- * @return int
dimension of the vector field
- */
- public long GetRowCount() throws NumberFormatException {
- Listinsert
interface.
- */
-public class InsertResultWrapper {
- private final MutationResult result;
-
- public InsertResultWrapper(@NonNull MutationResult result) {
- this.result = result;
- }
-
- /**
- * Get inserted count.
- *
- * @return int
inserted count
- */
- public long getInsertCount() {
- return result.getInsertCnt();
- }
-
- /**
- * Get long id array returned by insert interface.
- * Throw {@link ParamException} if the primary key type is not int64 type.
- *
- * @return List
id array returned by insert interface
- */
- public ListList
id array returned by insert interface
- */
- public Listquery
interface.
- */
-public class QueryResultsWrapper {
- private final QueryResults results;
-
- public QueryResultsWrapper(@NonNull QueryResults results) {
- this.results = results;
- }
-
- /**
- * Get {@link FieldDataWrapper} for a field.
- * Throws {@link ParamException} if the field doesn't exist.
- *
- * @return FieldDataWrapper
- */
- public FieldDataWrapper getFieldWrapper(@NonNull String fieldName) throws ParamException {
- Listsearch
interface.
- */
-public class SearchResultsWrapper {
- private final SearchResultData results;
-
- public SearchResultsWrapper(@NonNull SearchResultData results) {
- this.results = results;
- }
-
- /**
- * Get {@link FieldDataWrapper} for a field.
- * Throws {@link ParamException} if the field doesn't exist.
- *
- * @return FieldDataWrapper
- */
- public FieldDataWrapper GetFieldData(@NonNull String fieldName) {
- for (int i = 0; i < results.getFieldsDataCount(); ++i) {
- FieldData data = results.getFieldsData(i);
- if (fieldName.compareTo(data.getFieldName()) == 0) {
- return new FieldDataWrapper(data);
- }
- }
-
- return null;
- }
-
- /**
- * Get id-score pairs returned by search interface.
- * Throw {@link ParamException} if the indexOfTarget is illegal.
- * Throw {@link IllegalResponseException} if the returned results is illegal.
- *
- * @return List
id-score pairs returned by search interface
- */
- public Listsearch
interface.
- */
- @Getter
- public static final class IDScore {
- private final String strID;
- private final long longID;
- private final float score;
-
- public IDScore(String strID, long longID, float score) {
- this.strID = strID;
- this.longID = longID;
- this.score = score;
- }
-
- @Override
- public String toString() {
- if (strID.isEmpty()) {
- return "(ID: " + longID + " Score: " + score + ")";
- } else {
- return "(ID: '" + strID + "' Score: " + score + ")";
- }
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java b/milvus-java-sdk/src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java
deleted file mode 100644
index 23d8f0c..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/client/AbstractMilvusGrpcClient.java
+++ /dev/null
@@ -1,1831 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.client;
-
-import com.google.protobuf.ByteString;
-import io.grpc.StatusRuntimeException;
-import io.milvus.exception.ClientNotConnectedException;
-import io.milvus.exception.IllegalResponseException;
-import io.milvus.exception.ParamException;
-import io.milvus.grpc.*;
-import io.milvus.param.Constant;
-import io.milvus.param.R;
-import io.milvus.param.RpcStatus;
-import io.milvus.param.alias.AlterAliasParam;
-import io.milvus.param.alias.CreateAliasParam;
-import io.milvus.param.alias.DropAliasParam;
-import io.milvus.param.collection.*;
-import io.milvus.param.control.*;
-import io.milvus.param.dml.*;
-import io.milvus.param.index.*;
-import io.milvus.param.partition.*;
-import lombok.NonNull;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.MapUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-public abstract class AbstractMilvusGrpcClient implements MilvusClient {
-
- private static final Logger logger = LoggerFactory.getLogger(AbstractMilvusGrpcClient.class);
-
- protected abstract MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub();
-
- protected abstract MilvusServiceGrpc.MilvusServiceFutureStub futureStub();
-
- protected abstract boolean clientIsReady();
-
- ///////////////////// Internal Functions//////////////////////
- private Listsearch
/search
/loadCollection
can throw this exception
- * when server return illegal response, this may indicate a bug of server.
- */
-public class IllegalResponseException extends MilvusException {
- public IllegalResponseException(String msg) {
- super(msg, R.Status.IllegalResponse.getCode());
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/exception/MilvusException.java b/milvus-java-sdk/src/main/java/io/milvus/exception/MilvusException.java
deleted file mode 100644
index 9e12c65..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/exception/MilvusException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.exception;
-
-/**
- * Base class of Milvus exceptions.
- */
-public abstract class MilvusException extends RuntimeException {
- protected Integer status;
-
- public MilvusException(String msg, Integer status) {
- super(msg);
- this.status = status;
- }
-
- public Integer getStatus() {
- return status;
- }
-
- public void setStatus(Integer status) {
- this.status = status;
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/exception/ParamException.java b/milvus-java-sdk/src/main/java/io/milvus/exception/ParamException.java
deleted file mode 100644
index fb6fb12..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/exception/ParamException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.exception;
-
-import io.milvus.param.R;
-
-/**
- * Exception for caller input illegal parameters.
- */
-public class ParamException extends MilvusException {
- public ParamException(String msg) {
- super(msg, R.Status.ParamError.getCode());
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/ConnectParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/ConnectParam.java
deleted file mode 100644
index 188e962..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/ConnectParam.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param;
-
-import io.milvus.exception.ParamException;
-
-import lombok.NonNull;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Parameters for client connection.
- */
-public class ConnectParam {
- private final String host;
- private final int port;
- private final long connectTimeoutMs;
- private final long keepAliveTimeMs;
- private final long keepAliveTimeoutMs;
- private final boolean keepAliveWithoutCalls;
- private final long idleTimeoutMs;
-
- private ConnectParam(@NonNull Builder builder) {
- this.host = builder.host;
- this.port = builder.port;
- this.connectTimeoutMs = builder.connectTimeoutMs;
- this.keepAliveTimeMs = builder.keepAliveTimeMs;
- this.keepAliveTimeoutMs = builder.keepAliveTimeoutMs;
- this.keepAliveWithoutCalls = builder.keepAliveWithoutCalls;
- this.idleTimeoutMs = builder.idleTimeoutMs;
- }
-
- public String getHost() {
- return host;
- }
-
- public int getPort() {
- return port;
- }
-
- public long getConnectTimeoutMs() {
- return connectTimeoutMs;
- }
-
- public long getKeepAliveTimeMs() {
- return keepAliveTimeMs;
- }
-
- public long getKeepAliveTimeoutMs() {
- return keepAliveTimeoutMs;
- }
-
- public boolean isKeepAliveWithoutCalls() {
- return keepAliveWithoutCalls;
- }
-
- public long getIdleTimeoutMs() {
- return idleTimeoutMs;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for ConnectParam
- */
- public static class Builder {
- private String host = "localhost";
- private int port = 19530;
- private long connectTimeoutMs = 10000;
- private long keepAliveTimeMs = Long.MAX_VALUE; // Disabling keep alive
- private long keepAliveTimeoutMs = 20000;
- private boolean keepAliveWithoutCalls = false;
- private long idleTimeoutMs = TimeUnit.MILLISECONDS.convert(24, TimeUnit.HOURS);
-
- private Builder() {
- }
-
- /**
- * Set host name/address.
- *
- * @param host host name/address
- * @return Builder
- */
- public Builder withHost(@NonNull String host) {
- this.host = host;
- return this;
- }
-
- /**
- * Set connection port. Port value must be larger than zero and less than 65536.
- *
- * @param port port value
- * @return Builder
- */
- public Builder withPort(int port) {
- this.port = port;
- return this;
- }
-
- /**
- * Set connect time out value of client channel. The time out value must be larger than zero.
- *
- * @param connectTimeout time out value
- * @param timeUnit time out unit
- * @return Builder
- */
- public Builder withConnectTimeout(long connectTimeout, @NonNull TimeUnit timeUnit) {
- this.connectTimeoutMs = timeUnit.toMillis(connectTimeout);
- return this;
- }
-
- /**
- * Set keep alive time value of client channel. The time out value must be larger than zero.
- *
- * @param keepAliveTime time out value
- * @param timeUnit time out unit
- * @return Builder
- */
- public Builder withKeepAliveTime(long keepAliveTime, @NonNull TimeUnit timeUnit) {
- this.keepAliveTimeMs = timeUnit.toMillis(keepAliveTime);
- return this;
- }
-
- /**
- * Set keep alive time out value of client channel. The time out value must be larger than zero.
- *
- * @param keepAliveTimeout time out value
- * @param timeUnit time out unit
- * @return Builder
- */
- public Builder withKeepAliveTimeout(long keepAliveTimeout, @NonNull TimeUnit timeUnit) {
- this.keepAliveTimeoutMs = timeUnit.toNanos(keepAliveTimeout);
- return this;
- }
-
- /**
- * Set client channel keep alive.
- *
- * @param enable true keep alive
- * @return Builder
- */
- public Builder keepAliveWithoutCalls(boolean enable) {
- keepAliveWithoutCalls = enable;
- return this;
- }
-
- /**
- * Set idle time out value of client channel. The time out value must be larger than zero.
- *
- * @param idleTimeout time out value
- * @param timeUnit time out unit
- * @return Builder
- */
- public Builder withIdleTimeout(long idleTimeout, @NonNull TimeUnit timeUnit) {
- this.idleTimeoutMs = timeUnit.toMillis(idleTimeout);
- return this;
- }
-
- /**
- * Verify parameters and create a new ConnectParam
instance.
- *
- * @return ShowCollectionsParam
- */
- public ConnectParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(host, "Host name");
-
- if (port < 0 || port > 0xFFFF) {
- throw new ParamException("Port is out of range!");
- }
-
- if (keepAliveTimeMs <= 0L) {
- throw new ParamException("Keep alive time must be positive!");
- }
-
- if (connectTimeoutMs <= 0L) {
- throw new ParamException("Connect timeout must be positive!");
- }
-
- if (keepAliveTimeoutMs <= 0L) {
- throw new ParamException("Keep alive timeout must be positive!");
- }
-
- if (idleTimeoutMs <= 0L) {
- throw new ParamException("Idle timeout must be positive!");
- }
-
- return new ConnectParam(this);
- }
- }
-
- /**
- * Construct a String
by ConnectParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "ConnectParam{" +
- "host='" + host + '\'' +
- ", port='" + port +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/Constant.java b/milvus-java-sdk/src/main/java/io/milvus/param/Constant.java
deleted file mode 100644
index a2ed55e..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/Constant.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param;
-
-/**
- * Constant/static values for internal usage.
- */
-public class Constant {
- // default value for search key
- public static final String VECTOR_TAG = "$0";
- public static final String VECTOR_FIELD = "anns_field";
- public static final String VECTOR_DIM = "dim";
- public static final String TOP_K = "topk";
- public static final String INDEX_TYPE = "index_type";
- public static final String METRIC_TYPE = "metric_type";
- public static final String ROUND_DECIMAL = "round_decimal";
- public static final String PARAMS = "params";
-
- // max value for waiting loading collection/partition interval, unit: millisecond
- public static final Long MAX_WAITING_LOADING_INTERVAL = 2000L;
-
- // max value for waiting loading collection/partition timeout, unit: second
- public static final Long MAX_WAITING_LOADING_TIMEOUT = 300L;
-
- // max value for waiting flushing collection/partition interval, unit: millisecond
- public static final Long MAX_WAITING_FLUSHING_INTERVAL = 2000L;
-
- // max value for waiting flushing collection/partition timeout, unit: second
- public static final Long MAX_WAITING_FLUSHING_TIMEOUT = 300L;
-
- // max value for waiting create index interval, unit: millisecond
- public static final Long MAX_WAITING_INDEX_INTERVAL = 2000L;
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/IndexType.java b/milvus-java-sdk/src/main/java/io/milvus/param/IndexType.java
deleted file mode 100644
index e2f2a0c..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/IndexType.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param;
-
-/**
- * Represents available index types.
- * For more information: @see Index Types
- */
-public enum IndexType {
- INVALID,
- IVF_FLAT,
- IVF_PQ,
- IVF_SQ8,
- HNSW,
- RHNSW_FLAT,
- RHNSW_PQ,
- RHNSW_SQ,
- ANNOY,
- //Only supported for binary vectors
- BIN_IVF_FLAT,
- ;
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/MetricType.java b/milvus-java-sdk/src/main/java/io/milvus/param/MetricType.java
deleted file mode 100644
index 092e47d..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/MetricType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param;
-
-/**
- * Represents available metric types.
- * For more information: @see Similarity Metrics
- */
-public enum MetricType {
- INVALID,
- L2,
- IP,
- // Only supported for binary vectors
- HAMMING,
- JACCARD,
- TANIMOTO,
- SUBSTRUCTURE,
- SUPERSTRUCTURE,
- ;
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/ParamUtils.java b/milvus-java-sdk/src/main/java/io/milvus/param/ParamUtils.java
deleted file mode 100644
index c8bfead..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/ParamUtils.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package io.milvus.param;
-
-import io.milvus.exception.ParamException;
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * Util functions for param classes
- */
-public class ParamUtils {
- /**
- * Check a string is empty or null.
- * Throws {@link ParamException} if the string is empty of null.
- *
- * @param target target string
- * @param name a name to describe this string
- */
- public static void CheckNullEmptyString(String target, String name) throws ParamException {
- if (target == null || StringUtils.isBlank(target)) {
- throw new ParamException(name + " cannot be null or empty");
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/R.java b/milvus-java-sdk/src/main/java/io/milvus/param/R.java
deleted file mode 100644
index dd8cccf..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/R.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param;
-
-import io.milvus.exception.MilvusException;
-import io.milvus.grpc.ErrorCode;
-import org.apache.commons.lang3.exception.ExceptionUtils;
-
-import java.util.Arrays;
-import java.util.Optional;
-
-/**
- * Util class to wrap gpc response and exceptions.
- */
-public class RR
- */
- public static R
- */
- public static R
- */
- public static R
- */
- public static R
- */
- public static String
by R
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- if (exception != null) {
- return "R{" +
- "exception=" + ExceptionUtils.getMessage(exception) +
- ", status=" + status +
- ", data=" + data +
- '}';
- } else {
- return "R{" +
- "status=" + status +
- ", data=" + data +
- '}';
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/RpcStatus.java b/milvus-java-sdk/src/main/java/io/milvus/param/RpcStatus.java
deleted file mode 100644
index 19fe25f..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/RpcStatus.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param;
-
-/**
- * Util class to wrap a message.
- */
-public class RpcStatus {
- public static final String SUCCESS_MSG = "Success";
-
- private final String msg;
-
- public String getMsg() {
- return msg;
- }
-
- public RpcStatus(String msg) {
- this.msg = msg;
- }
-
- /**
- * Construct a String
by RpcStatus
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "RpcStatus{" +
- "msg='" + getMsg() + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/alias/AlterAliasParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/alias/AlterAliasParam.java
deleted file mode 100644
index 0edbed5..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/alias/AlterAliasParam.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package io.milvus.param.alias;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for alterAlias
interface.
- */
-@Getter
-public class AlterAliasParam {
- private final String collectionName;
- private final String alias;
-
- private AlterAliasParam(@NonNull AlterAliasParam.Builder builder) {
- this.collectionName = builder.collectionName;
- this.alias = builder.alias;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for AlterAliasParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String alias;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set alias, alias cannot be empty or null.
- *
- * @param alias alias of the collection
- * @return Builder
- */
- public Builder withAlias(@NonNull String alias) {
- this.alias = alias;
- return this;
- }
-
- /**
- * Verify parameters and create a new AlterAliasParam
instance.
- *
- * @return AlterAliasParam
- */
- public AlterAliasParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(alias, "Alias");
-
- return new AlterAliasParam(this);
- }
- }
-
- /**
- * Construct a String
by AlterAliasParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "AlterAliasParam{" +
- "collectionName='" + collectionName + '\'' +
- ", alias='" + alias + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/alias/CreateAliasParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/alias/CreateAliasParam.java
deleted file mode 100644
index ca40bec..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/alias/CreateAliasParam.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package io.milvus.param.alias;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for createAlias
interface.
- */
-@Getter
-public class CreateAliasParam {
- private final String collectionName;
- private final String alias;
-
- private CreateAliasParam(@NonNull CreateAliasParam.Builder builder) {
- this.collectionName = builder.collectionName;
- this.alias = builder.alias;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for CreateAliasParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String alias;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set alias, alias cannot be empty or null.
- *
- * @param alias alias of the collection
- * @return Builder
- */
- public Builder withAlias(@NonNull String alias) {
- this.alias = alias;
- return this;
- }
-
- /**
- * Verify parameters and create a new CreateAliasParam
instance.
- *
- * @return CreateAliasParam
- */
- public CreateAliasParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(alias, "Alias");
-
- return new CreateAliasParam(this);
- }
- }
-
- /**
- * Construct a String
by CreateAliasParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "CreateAliasParam{" +
- "collectionName='" + collectionName + '\'' +
- ", alias='" + alias + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/alias/DropAliasParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/alias/DropAliasParam.java
deleted file mode 100644
index 6382d7f..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/alias/DropAliasParam.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package io.milvus.param.alias;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for dropAlias
interface.
- */
-@Getter
-public class DropAliasParam {
- private final String alias;
-
- private DropAliasParam(@NonNull Builder builder) {
- this.alias = builder.alias;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DropAliasParam
class.
- */
- public static final class Builder {
- private String alias;
-
- private Builder() {
- }
-
- /**
- * Set alias, alias cannot be empty or null.
- *
- * @param alias alias of the collection
- * @return Builder
- */
- public Builder withAlias(@NonNull String alias) {
- this.alias = alias;
- return this;
- }
-
- /**
- * Verify parameters and create a new DropAliasParam
instance.
- *
- * @return DropAliasParam
- */
- public DropAliasParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(alias, "Alias");
-
- return new DropAliasParam(this);
- }
- }
-
- /**
- * Construct a String
by DropAliasParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DropAliasParam{" +
- ", alias='" + alias + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/CreateCollectionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/CreateCollectionParam.java
deleted file mode 100644
index ba2728c..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/CreateCollectionParam.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for createCollection
interface.
- */
-@Getter
-public class CreateCollectionParam {
- private final String collectionName;
- private final int shardsNum;
- private final String description;
- private final ListCreateCollectionParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private int shardsNum = 2;
- private String description = "";
- private final ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set shards number, the number must be larger than zero, default value is 2.
- *
- * @param shardsNum shards number to distribute insert data into multiple data nodes and query nodes.
- * @return Builder
- */
- public Builder withShardsNum(int shardsNum) {
- this.shardsNum = shardsNum;
- return this;
- }
-
- /**
- * Set collection description, description can be empty, default is "".
- *
- * @param description description of the collection
- * @return Builder
- */
- public Builder withDescription(@NonNull String description) {
- this.description = description;
- return this;
- }
-
- /**
- * Set schema of the collection, schema cannot be empty or null.
- * @see FieldType
- *
- * @param fieldTypes a List
of FieldType
- * @return Builder
- */
- public Builder withFieldTypes(@NonNull ListFieldType
object
- * @return Builder
- */
- public Builder addFieldType(@NonNull FieldType fieldType) {
- this.fieldTypes.add(fieldType);
- return this;
- }
-
- /**
- * Verify parameters and create a new CreateCollectionParam
instance.
- *
- * @return CreateCollectionParam
- */
- public CreateCollectionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- if (shardsNum <= 0) {
- throw new ParamException("ShardNum must be larger than 0");
- }
-
- if (fieldTypes == null || fieldTypes.isEmpty()) {
- throw new ParamException("Field numbers must be larger than 0");
- }
-
- for (FieldType fieldType : fieldTypes) {
- if (fieldType == null) {
- throw new ParamException("Collection field cannot be null");
- }
- }
-
- return new CreateCollectionParam(this);
- }
- }
-
- /**
- * Construct a String
by CreateCollectionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "CreateCollectionParam{" +
- "collectionName='" + collectionName + '\'' +
- ", shardsNum=" + shardsNum +
- ", description='" + description + '\'' +
- ", field count=" + fieldTypes.size() +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/DescribeCollectionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/DescribeCollectionParam.java
deleted file mode 100644
index d327c4e..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/DescribeCollectionParam.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for describeCollection
interface.
- */
-@Getter
-public class DescribeCollectionParam {
- private final String collectionName;
-
- private DescribeCollectionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DescribeCollectionParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new DescribeCollectionParam
instance.
- *
- * @return DescribeCollectionParam
- */
- public DescribeCollectionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new DescribeCollectionParam(this);
- }
- }
-
- /**
- * Construct a String
by DescribeCollectionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DescribeCollectionParam{" +
- "collectionName='" + collectionName + '\'' + '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/DropCollectionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/DropCollectionParam.java
deleted file mode 100644
index a2265c8..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/DropCollectionParam.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for dropCollection
interface.
- */
-@Getter
-public class DropCollectionParam {
- private final String collectionName;
-
- private DropCollectionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DropCollectionParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new DropCollectionParam
instance.
- *
- * @return DropCollectionParam
- */
- public DropCollectionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new DropCollectionParam(this);
- }
- }
-
- /**
- * Construct a String
by DropCollectionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DropCollectionParam{" +
- "collectionName='" + collectionName + '\'' + '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/FieldType.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/FieldType.java
deleted file mode 100644
index adcca59..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/FieldType.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.grpc.DataType;
-import io.milvus.param.Constant;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Parameters for a collection field.
- * @see CreateCollectionParam
- */
-@Getter
-public class FieldType {
- private final String name;
- private final boolean primaryKey;
- private final String description;
- private final DataType dataType;
- private final MapFieldType
class.
- */
- public static final class Builder {
- private String name;
- private boolean primaryKey = false;
- private String description = "";
- private DataType dataType;
- private final MapLong
data type as primary key.
- *
- * @param primaryKey true is primary key, false is not
- * @return Builder
- */
- public Builder withPrimaryKey(boolean primaryKey) {
- this.primaryKey = primaryKey;
- return this;
- }
-
- /**
- * Set field description, description can be empty, default is "".
- *
- * @param description description of the field
- * @return Builder
- */
- public Builder withDescription(@NonNull String description) {
- this.description = description;
- return this;
- }
-
- /**
- * Set data type for field.
- *
- * @param dataType data type of the field
- * @return Builder
- */
- public Builder withDataType(@NonNull DataType dataType) {
- this.dataType = dataType;
- return this;
- }
-
- /**
- * Add a parameter pair for field.
- *
- * @param key parameter key
- * @param value parameter value
- * @return Builder
- */
- public Builder addTypeParam(@NonNull String key, @NonNull String value) {
- this.typeParams.put(key, value);
- return this;
- }
-
- /**
- * Set more parameters for field.
- *
- * @param typeParams parameters of the field
- * @return Builder
- */
- public Builder withTypeParams(@NonNull MapBuilder
- */
- public Builder withDimension(@NonNull Integer dimension) {
- this.typeParams.put(Constant.VECTOR_DIM, dimension.toString());
- return this;
- }
-
- /**
- * Set the field to be auto-id. Note that only primary key field can be set as auto-id.
- * If auto-id is enabled, Milvus will automatically generated unique id for each entities,
- * user no need to provide values for this field during insert action.
- *
- * If auto-id is disabled, user need to provide values for this field during insert action.
- *
- * @param autoID true enable auto-id, false disable auto-id
- * @return Builder
- */
- public Builder withAutoID(boolean autoID) {
- this.autoID = autoID;
- return this;
- }
-
- /**
- * Verify parameters and create a new FieldType
instance.
- *
- * @return FieldType
- */
- public FieldType build() throws ParamException {
- ParamUtils.CheckNullEmptyString(name, "Field name");
-
- if (dataType == null || dataType == DataType.None) {
- throw new ParamException("Field data type is illegal");
- }
-
- if (dataType == DataType.FloatVector || dataType == DataType.BinaryVector) {
- if (!typeParams.containsKey(Constant.VECTOR_DIM)) {
- throw new ParamException("Vector field dimension must be specified");
- }
-
- try {
- int dim = Integer.parseInt(typeParams.get(Constant.VECTOR_DIM));
- if (dim <= 0) {
- throw new ParamException("Vector field dimension must be larger than zero");
- }
- } catch (NumberFormatException e) {
- throw new ParamException("Vector field dimension must be an integer number");
- }
- }
-
- return new FieldType(this);
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/FlushParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/FlushParam.java
deleted file mode 100644
index d9728a4..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/FlushParam.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.Constant;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for flush
interface.
- * Note that the flush interface is not exposed currently.
- */
-@Getter
-public class FlushParam {
- private final ListFlushParam
class.
- */
- public static final class Builder {
- private final ListBuilder
- */
- public Builder withCollectionNames(@NonNull ListBuilder
- */
- public Builder addCollectionName(@NonNull String collectionName) {
- this.collectionNames.add(collectionName);
- return this;
- }
-
- /**
- * Set flush action to sync mode.
- * With sync mode, the client side will keep waiting until all segments of the collection successfully flushed.
- *
- * If not sync mode, client will return at once after the flush() is called.
- *
- * @param syncFlush Boolean.TRUE
is sync mode, Bollean.FALSE is not
- * @return Builder
- */
- public Builder withSyncFlush(@NonNull Boolean syncFlush) {
- this.syncFlush = syncFlush;
- return this;
- }
-
- /**
- * Set waiting interval in sync mode. In sync mode, the client will constantly check segments state by interval.
- * Interval must be larger than zero, and cannot be larger than Constant.MAX_WAITING_FLUSHING_INTERVAL.
- * @see Constant
- *
- * @param milliseconds interval
- * @return Builder
- */
- public Builder withSyncFlushWaitingInterval(@NonNull Long milliseconds) {
- this.syncFlushWaitingInterval = milliseconds;
- return this;
- }
-
- /**
- * Set time out value for sync mode.
- * Time out value must be larger than zero, and cannot be larger than Constant.MAX_WAITING_FLUSHING_TIMEOUT.
- * @see Constant
- *
- * @param seconds time out value for sync mode
- * @return Builder
- */
- public Builder withSyncFlushWaitingTimeout(@NonNull Long seconds) {
- this.syncFlushWaitingTimeout = seconds;
- return this;
- }
-
- /**
- * Verify parameters and create a new FlushParam
instance.
- *
- * @return FlushParam
- */
- public FlushParam build() throws ParamException {
- if (collectionNames.isEmpty()) {
- throw new ParamException("CollectionNames can not be empty");
- }
-
- for (String name : collectionNames) {
- ParamUtils.CheckNullEmptyString(name, "Collection name");
- }
-
- if (syncFlush == Boolean.TRUE) {
- if (syncFlushWaitingInterval <= 0) {
- throw new ParamException("Sync flush waiting interval must be larger than zero");
- } else if (syncFlushWaitingInterval > Constant.MAX_WAITING_FLUSHING_INTERVAL) {
- throw new ParamException("Sync flush waiting interval cannot be larger than "
- + Constant.MAX_WAITING_FLUSHING_INTERVAL.toString() + " milliseconds");
- }
-
- if (syncFlushWaitingTimeout <= 0) {
- throw new ParamException("Sync flush waiting timeout must be larger than zero");
- } else if (syncFlushWaitingTimeout > Constant.MAX_WAITING_FLUSHING_TIMEOUT) {
- throw new ParamException("Sync flush waiting timeout cannot be larger than "
- + Constant.MAX_WAITING_FLUSHING_TIMEOUT.toString() + " seconds");
- }
- }
-
- return new FlushParam(this);
- }
- }
-
- /**
- * Construct a String
by FlushParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "FlushParam{" +
- "collectionNames='" + collectionNames + '\'' +
- ", syncFlush=" + syncFlush.toString() +
- ", syncFlushWaitingInterval=" + syncFlushWaitingInterval +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/GetCollectionStatisticsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/GetCollectionStatisticsParam.java
deleted file mode 100644
index 7282284..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/GetCollectionStatisticsParam.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getCollectionStatistics
interface.
- */
-@Getter
-public class GetCollectionStatisticsParam {
- private final String collectionName;
- private final boolean flushCollection;
-
- private GetCollectionStatisticsParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.flushCollection = builder.flushCollection;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetCollectionStatisticsParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- // if flushCollection is true, getCollectionStatistics() firstly call flush() and wait flush() finish
- // Note: use default interval and timeout to wait flush()
- private Boolean flushCollection = Boolean.TRUE;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Require a flush action before retrieving collection statistics.
- *
- * @param flush Boolean.TRUE
require a flush action
- * @return Builder
- */
- public Builder withFlush(@NonNull Boolean flush) {
- this.flushCollection = flush;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetCollectionStatisticsParam
instance.
- *
- * @return GetCollectionStatisticsParam
- */
- public GetCollectionStatisticsParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new GetCollectionStatisticsParam(this);
- }
- }
-
- /**
- * Construct a String
by GetCollectionStatisticsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetCollectionStatisticsParam{" +
- "collectionName='" + collectionName + '\'' +
- " flush=" + flushCollection +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/HasCollectionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/HasCollectionParam.java
deleted file mode 100644
index 19a8632..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/HasCollectionParam.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for hasCollection
interface.
- */
-@Getter
-public class HasCollectionParam {
- private final String collectionName;
-
- private HasCollectionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for HasCollectionParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new HasCollectionParam
instance.
- *
- * @return HasCollectionParam
- */
- public HasCollectionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new HasCollectionParam(this);
- }
- }
-
- /**
- * Construct a String
by HasCollectionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "HasCollectionParam{" +
- "collectionName='" + collectionName + '\'' + '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/LoadCollectionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/LoadCollectionParam.java
deleted file mode 100644
index 8106cb6..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/LoadCollectionParam.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.Constant;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for loadCollection
interface.
- */
-@Getter
-public class LoadCollectionParam {
- private final String collectionName;
- private final boolean syncLoad;
- private final long syncLoadWaitingInterval;
- private final long syncLoadWaitingTimeout;
-
- public LoadCollectionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.syncLoad = builder.syncLoad;
- this.syncLoadWaitingInterval = builder.syncLoadWaitingInterval;
- this.syncLoadWaitingTimeout = builder.syncLoadWaitingTimeout;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for LoadCollectionParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- // syncLoad:
- // Default behavior is sync loading, loadCollection() return after collection finish loading.
- private Boolean syncLoad = Boolean.TRUE;
-
- // syncLoadWaitingDuration:
- // When syncLoad is ture, loadCollection() will wait until collection finish loading,
- // this value control the waiting interval. Unit: millisecond. Default value: 500 milliseconds.
- private Long syncLoadWaitingInterval = 500L;
-
- // syncLoadWaitingTimeout:
- // When syncLoad is ture, loadCollection() will wait until collection finish loading,
- // this value control the waiting timeout. Unit: second. Default value: 60 seconds.
- private Long syncLoadWaitingTimeout = 60L;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set load action to sync mode.
- * With sync mode, the client side will keep waiting until all segments of the collection successfully loaded.
- *
- * If not sync mode, client will return at once after the loadCollection() is called.
- *
- * @param syncLoad Boolean.TRUE
is sync mode, Boolean.FALSE is not
- * @return Builder
- */
- public Builder withSyncLoad(@NonNull Boolean syncLoad) {
- this.syncLoad = syncLoad;
- return this;
- }
-
- /**
- * Set waiting interval in sync mode. In sync mode, the client will constantly check collection load state by interval.
- * Interval must be larger than zero, and cannot be larger than Constant.MAX_WAITING_LOADING_INTERVAL.
- * @see Constant
- *
- * @param milliseconds interval
- * @return Builder
- */
- public Builder withSyncLoadWaitingInterval(@NonNull Long milliseconds) {
- this.syncLoadWaitingInterval = milliseconds;
- return this;
- }
-
- /**
- * Set time out value for sync mode.
- * Time out value must be larger than zero, and cannot be larger than Constant.MAX_WAITING_LOADING_TIMEOUT.
- * @see Constant
- *
- * @param seconds time out value for sync mode
- * @return Builder
- */
- public Builder withSyncLoadWaitingTimeout(@NonNull Long seconds) {
- this.syncLoadWaitingTimeout = seconds;
- return this;
- }
-
- /**
- * Verify parameters and create a new LoadCollectionParam
instance.
- *
- * @return LoadCollectionParam
- */
- public LoadCollectionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- if (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) {
- throw new ParamException("Sync load waiting interval cannot be larger than "
- + Constant.MAX_WAITING_LOADING_INTERVAL.toString() + " milliseconds");
- }
-
- if (syncLoadWaitingTimeout <= 0) {
- throw new ParamException("Sync load waiting timeout must be larger than zero");
- } else if (syncLoadWaitingTimeout > Constant.MAX_WAITING_LOADING_TIMEOUT) {
- throw new ParamException("Sync load waiting timeout cannot be larger than "
- + Constant.MAX_WAITING_LOADING_TIMEOUT.toString() + " seconds");
- }
- }
-
- return new LoadCollectionParam(this);
- }
- }
-
- /**
- * Construct a String
by LoadCollectionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "LoadCollectionParam{" +
- "collectionName='" + collectionName + '\'' +
- ", syncLoad=" + syncLoad +
- ", syncLoadWaitingInterval=" + syncLoadWaitingInterval +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/ReleaseCollectionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/ReleaseCollectionParam.java
deleted file mode 100644
index 572c01f..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/ReleaseCollectionParam.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for releaseCollection
interface.
- */
-@Getter
-public class ReleaseCollectionParam {
- private final String collectionName;
-
- private ReleaseCollectionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for ReleaseCollectionParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new ReleaseCollectionParam
instance.
- *
- * @return ReleaseCollectionParam
- */
- public ReleaseCollectionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new ReleaseCollectionParam(this);
- }
- }
-
- /**
- * Construct a String
by ReleaseCollectionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "ReleaseCollectionParam{" +
- "collectionName='" + collectionName + '\'' + '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/collection/ShowCollectionsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/collection/ShowCollectionsParam.java
deleted file mode 100644
index b980393..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/collection/ShowCollectionsParam.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.collection;
-
-import io.milvus.exception.ParamException;
-import io.milvus.grpc.ShowType;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for showCollections
interface.
- */
-@Getter
-public class ShowCollectionsParam {
- private final ListShowCollectionsParam
class.
- */
- public static final class Builder {
- private final ListBuilder
- */
- public Builder withCollectionNames(@NonNull ListBuilder
- */
- public Builder addCollectionName(@NonNull String collectionName) {
- if (!this.collectionNames.contains(collectionName)) {
- this.collectionNames.add(collectionName);
- }
- return this;
- }
-
- /**
- * Verify parameters and create a new ShowCollectionsParam
instance.
- *
- * @return ShowCollectionsParam
- */
- public ShowCollectionsParam build() throws ParamException {
- if (!collectionNames.isEmpty()) {
- for (String collectionName : collectionNames) {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- }
- this.showType = ShowType.InMemory;
- }
-
- return new ShowCollectionsParam(this);
- }
- }
-
- /**
- * Construct a String
by ShowCollectionsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "ShowCollectionsParam{" +
- "collectionNames='" + collectionNames.toString() + '\'' +
- ", showType=" + showType.toString() +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetCompactionPlansParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/GetCompactionPlansParam.java
deleted file mode 100644
index 15e871c..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetCompactionPlansParam.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getCompactionStateWithPlans
interface.
- *
- * @see Metric function design
- */
-@Getter
-public class GetCompactionPlansParam {
- private final Long compactionID;
-
- private GetCompactionPlansParam(@NonNull Builder builder) {
- this.compactionID = builder.compactionID;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Construct a String
by GetCompactionPlansParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetCompactionPlansParam{" +
- "compactionID='" + compactionID + '\'' +
- '}';
- }
-
- /**
- * Builder for GetCompactionPlansParam
class.
- */
- public static final class Builder {
- private Long compactionID;
-
- private Builder() {
- }
-
- /**
- * Set compaction action id to get plans.
- *
- * @param compactionID compaction action id
- * @return Builder
- */
- public Builder withCompactionID(@NonNull Long compactionID) {
- this.compactionID = compactionID;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetCompactionPlansParam
instance.
- *
- * @return GetCompactionPlansParam
- */
- public GetCompactionPlansParam build() throws ParamException {
- return new GetCompactionPlansParam(this);
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetCompactionStateParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/GetCompactionStateParam.java
deleted file mode 100644
index 77ed5b8..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetCompactionStateParam.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import lombok.Getter;
-import lombok.NonNull;
-
-
-/**
- * Parameters for getCompactionState
interface.
- *
- * @see Metric function design
- */
-@Getter
-public class GetCompactionStateParam {
- private final Long compactionID;
-
- private GetCompactionStateParam(@NonNull Builder builder) {
- this.compactionID = builder.compactionID;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Construct a String
by GetCompactionStateParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetCompactionStateParam{" +
- "compactionID='" + compactionID + '\'' +
- '}';
- }
-
- /**
- * Builder for GetCompactionStateParam
class.
- */
- public static final class Builder {
- private Long compactionID;
-
- private Builder() {
- }
-
- /**
- * Set compaction action id to get state.
- *
- * @param compactionID compaction action id
- * @return Builder
- */
- public Builder withCompactionID(@NonNull Long compactionID) {
- this.compactionID = compactionID;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetCompactionStateParam
instance.
- *
- * @return GetCompactionStateParam
- */
- public GetCompactionStateParam build() throws ParamException {
- return new GetCompactionStateParam(this);
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetMetricsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/GetMetricsParam.java
deleted file mode 100644
index c6ec5a5..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetMetricsParam.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getMetric
interface.
- */
-@Getter
-public class GetMetricsParam {
- private final String request;
-
- private GetMetricsParam(@NonNull Builder builder) {
- this.request = builder.request;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetMetricsParam
class.
- */
- public static final class Builder {
- private String request;
-
- private Builder() {
- }
-
- /**
- * Set request in json format to retrieve metric information from server.
- * @see Metric function design
- *
- * @param request request string in json format
- * @return Builder
- */
- public Builder withRequest(@NonNull String request) {
- this.request = request;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetMetricsParam
instance.
- *
- * @return GetMetricsParam
- */
- public GetMetricsParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(request, "Request string");
-
- // TODO: check the request string is json format
-
- return new GetMetricsParam(this);
- }
- }
-
- /**
- * Construct a String
by GetMetricsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetMetricsParam{" +
- "request='" + request + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetPersistentSegmentInfoParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/GetPersistentSegmentInfoParam.java
deleted file mode 100644
index a633854..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetPersistentSegmentInfoParam.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getPersistentSegmentInfo
interface.
- */
-@Getter
-public class GetPersistentSegmentInfoParam {
- private final String collectionName;
-
- private GetPersistentSegmentInfoParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetPersistentSegmentInfoParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetPersistentSegmentInfoParam
instance.
- *
- * @return GetPersistentSegmentInfoParam
- */
- public GetPersistentSegmentInfoParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new GetPersistentSegmentInfoParam(this);
- }
- }
-
- /**
- * Construct a String
by GetPersistentSegmentInfoParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetPersistentSegmentInfoParam{" +
- "collectionName='" + collectionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetQuerySegmentInfoParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/GetQuerySegmentInfoParam.java
deleted file mode 100644
index 2dd4d80..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/GetQuerySegmentInfoParam.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getQuerySegmentInfo
interface.
- */
-@Getter
-public class GetQuerySegmentInfoParam {
- private final String collectionName;
-
- private GetQuerySegmentInfoParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetPersistentSegmentInfoParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetQuerySegmentInfoParam
instance.
- *
- * @return GetQuerySegmentInfoParam
- */
- public GetQuerySegmentInfoParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new GetQuerySegmentInfoParam(this);
- }
- }
-
- /**
- * Construct a String
by GetQuerySegmentInfoParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetQuerySegmentInfoParam{" +
- "collectionName='" + collectionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/LoadBalanceParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/LoadBalanceParam.java
deleted file mode 100644
index bc69a5e..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/LoadBalanceParam.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import lombok.Getter;
-import lombok.NonNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for loadBalance
interface.
- *
- * @see Handoff and load balance
- */
-@Getter
-public class LoadBalanceParam {
- private final Long srcNodeID;
- private final ListString
by LoadBalanceParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "LoadBalanceParam{" +
- "srcNodeID='" + srcNodeID + '\'' +
- "destNodeIDs='" + destNodeIDs.toString() + '\'' +
- "segmentIDs='" + segmentIDs.toString() + '\'' +
- '}';
- }
-
- /**
- * Builder for LoadBalanceParam
class.
- */
- public static final class Builder {
- private final ListBuilder
- */
- public Builder withSourceNodeID(@NonNull Long srcNodeID) {
- this.srcNodeID = srcNodeID;
- return this;
- }
-
- /**
- * Add destination query node id to which the sealed segments will be balance.
- *
- * @param destNodeID destination query node id
- * @return Builder
- */
- public Builder addDestinationNodeID(@NonNull Long destNodeID) {
- if (!destNodeIDs.contains(destNodeID)) {
- destNodeIDs.add(destNodeID);
- }
-
- return this;
- }
-
- /**
- * Set destination query node id array to which the sealed segments will be balance.
- *
- * @param destNodeIDs destination query node id array
- * @return Builder
- */
- public Builder withDestinationNodeID(@NonNull ListBuilder
- */
- public Builder addSegmentID(@NonNull Long segmentID) {
- if (!segmentIDs.contains(segmentID)) {
- segmentIDs.add(segmentID);
- }
-
- return this;
- }
-
- /**
- * Set sealed segments id array to be balanced.
- *
- * @param segmentIDs sealed segments id array
- * @return Builder
- */
- public Builder withSegmentIDs(@NonNull ListLoadBalanceParam
instance.
- *
- * @return LoadBalanceParam
- */
- public LoadBalanceParam build() throws ParamException {
- if (segmentIDs.isEmpty()) {
- throw new ParamException("Sealed segment id array cannot be empty");
- }
-
- if (destNodeIDs.isEmpty()) {
- throw new ParamException("Destination query node id array cannot be empty");
- }
-
- return new LoadBalanceParam(this);
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/control/ManualCompactionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/control/ManualCompactionParam.java
deleted file mode 100644
index d7a9867..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/control/ManualCompactionParam.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package io.milvus.param.control;
-
-import io.milvus.exception.ParamException;
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for manualCompaction
interface.
- *
- * @see Metric function design
- */
-@Getter
-public class ManualCompactionParam {
- private final Long collectionID;
-
- private ManualCompactionParam(@NonNull Builder builder) {
- this.collectionID = builder.collectionID;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Construct a String
by ManualCompactionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "ManualCompactionParam{" +
- "collectionID='" + collectionID + '\'' +
- '}';
- }
-
- /**
- * Builder for ManualCompactionParam
class.
- */
- public static final class Builder {
- private Long collectionID;
-
- private Builder() {
- }
-
- /**
- * Ask server to compact a collection.
- *
- * @param collectionID target collection id
- * @return Builder
- */
- public Builder withCollectionID(@NonNull Long collectionID) {
- this.collectionID = collectionID;
- return this;
- }
-
- /**
- * Verify parameters and create a new ManualCompactionParam
instance.
- *
- * @return ManualCompactionParam
- */
- public ManualCompactionParam build() throws ParamException {
- return new ManualCompactionParam(this);
- }
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/dml/CalcDistanceParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/dml/CalcDistanceParam.java
deleted file mode 100644
index 56c109d..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/dml/CalcDistanceParam.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.dml;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.MetricType;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.List;
-
-/**
- * Parameters for calcDistance
interface.
- * Note that currently only support float vectors calculation.
- */
-@Getter
-public class CalcDistanceParam {
- private final ListCalcDistanceParam
class.
- */
- public static class Builder {
- private ListBuilder
- */
- public Builder withVectorsLeft(@NonNull ListBuilder
- */
- public Builder withVectorsRight(@NonNull ListBuilder
- */
- public Builder withMetricType(MetricType metricType) {
- this.metricType = metricType;
- return this;
- }
-
- /**
- * Verify parameters and create a new CalcDistanceParam
instance.
- *
- * @return CalcDistanceParam
- */
- public CalcDistanceParam build() throws ParamException {
- if (metricType == MetricType.INVALID) {
- throw new ParamException("Metric type is illegal");
- }
-
- if (metricType != MetricType.L2 && metricType != MetricType.IP) {
- throw new ParamException("Only support L2 or IP metric type now!");
- }
-
- if (vectorsLeft == null || vectorsLeft.isEmpty()) {
- throw new ParamException("Left vectors can not be empty");
- }
-
- int count = vectorsLeft.get(0).size();
- for (ListString
by CalcDistanceParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "CalcDistanceParam{ left vector count:" + vectorsLeft.size() +
- " right vector count:" + vectorsRight.size() +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/dml/DeleteParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/dml/DeleteParam.java
deleted file mode 100644
index fdb41b1..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/dml/DeleteParam.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.dml;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for delete
interface.
- */
-@Getter
-public class DeleteParam {
- private final String collectionName;
- private final String partitionName;
- private final String expr;
-
- private DeleteParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.partitionName = builder.partitionName;
- this.expr = builder.expr;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DeleteParam
class.
- */
- public static class Builder {
- private String collectionName;
- private String partitionName = "";
- private String expr;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Optional. Set partition name.
- *
- * @param partitionName partition name
- * @return Builder
- */
- public Builder withPartitionName(@NonNull String partitionName) {
- this.partitionName = partitionName;
- return this;
- }
-
- /**
- * Set expr to filter out entities to be deleted.
- * @see Boolean Expression Rules
- *
- * @param expr filtering expression
- * @return Builder
- */
- public Builder withExpr(@NonNull String expr) {
- this.expr = expr;
- return this;
- }
-
- /**
- * Verify parameters and create a new DeleteParam
instance.
- *
- * @return DeleteParam
- */
- public DeleteParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(expr, "Expression");
-
- return new DeleteParam(this);
- }
- }
-
- /**
- * Construct a String
by DeleteParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DeleteParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionName + '\'' +
- ", expr='" + expr + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/dml/InsertParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/dml/InsertParam.java
deleted file mode 100644
index ef8123c..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/dml/InsertParam.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.dml;
-
-import io.milvus.exception.ParamException;
-import io.milvus.grpc.DataType;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.nio.ByteBuffer;
-import java.util.List;
-
-/**
- * Parameters for insert
interface.
- */
-@Getter
-public class InsertParam {
- private final ListInsertParam
class.
- */
- public static class Builder {
- private String collectionName;
- private String partitionName = "_default";
- private ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Optional. Set partition name.
- *
- * @param partitionName partition name
- * @return Builder
- */
- public Builder withPartitionName(@NonNull String partitionName) {
- this.partitionName = partitionName;
- return this;
- }
-
- /**
- * Set insert data. The fields list cannot be empty.
- * @see Field
- *
- * @param fields insert data
- * @return Builder
- */
- public Builder withFields(@NonNull ListInsertParam
instance.
- *
- * @return InsertParam
- */
- @SuppressWarnings("unchecked")
- public InsertParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- if (fields.isEmpty()) {
- throw new ParamException("Fields cannot be empty");
- }
-
- for (Field field : fields) {
- if (field == null) {
- throw new ParamException("Field cannot be null." +
- " If the field is auto-id, just ignore it from withFields()");
- }
-
- ParamUtils.CheckNullEmptyString(field.getName(), "Field name");
-
- if (field.getValues() == null || field.getValues().isEmpty()) {
- throw new ParamException("Field value cannot be empty." +
- " If the field is auto-id, just ignore it from withFields()");
- }
- }
-
- // check row count
- int count = fields.get(0).getValues().size();
- for (Field field : fields) {
- if (field.getValues().size() != count) {
- throw new ParamException("Row count of fields must be equal");
- }
- }
- this.rowCount = count;
-
- if (count == 0) {
- throw new ParamException("Row count is zero");
- }
-
- // check value type and vector dimension
- for (Field field : fields) {
- List> values = field.getValues();
- if (field.getType() == DataType.FloatVector) {
- for (Object obj : values) {
- if (!(obj instanceof List)) {
- throw new ParamException("Float vector field's value must be LstString
by InsertParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "InsertParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionName + '\'' +
- ", row_count=" + rowCount +
- '}';
- }
-
- /**
- * Internal class for insert data.
- * if dataType is scalar(bool/int/float/double): values is Listquery
interface.
- */
-@Getter
-public class QueryParam {
- private final String collectionName;
- private final ListQueryParam
class.
- */
- public static class Builder {
- private String collectionName;
- private ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Optional. Set partition names list to specify query scope.
- *
- * @param partitionNames partition names list
- * @return Builder
- */
- public Builder withPartitionNames(@NonNull ListBuilder
- */
- public Builder withOutFields(@NonNull ListBuilder
- */
- public Builder withExpr(@NonNull String expr) {
- this.expr = expr;
- return this;
- }
-
- /**
- * Verify parameters and create a new QueryParam
instance.
- *
- * @return QueryParam
- */
- public QueryParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(expr, "Expression");
-
- return new QueryParam(this);
- }
- }
-
- /**
- * Construct a String
by QueryParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "QueryParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionNames='" + partitionNames.toString() + '\'' +
- ", expr='" + expr + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/dml/SearchParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/dml/SearchParam.java
deleted file mode 100644
index f608506..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/dml/SearchParam.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.dml;
-
-import com.google.common.collect.Lists;
-import io.milvus.exception.ParamException;
-import io.milvus.param.MetricType;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for search
interface.
- */
-@Getter
-public class SearchParam {
- private final String collectionName;
- private final ListSearchParam
class.
- */
- public static class Builder {
- private String collectionName;
- private ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Optional. Set partition names list to specify search scope.
- *
- * @param partitionNames partition names list
- * @return Builder
- */
- public Builder withPartitionNames(@NonNull ListBuilder
- */
- public Builder withMetricType(@NonNull MetricType metricType) {
- this.metricType = metricType;
- return this;
- }
-
- /**
- * Set target vector field name. Field name cannot be empty or null.
- *
- * @param vectorFieldName vector field name
- * @return Builder
- */
- public Builder withVectorFieldName(@NonNull String vectorFieldName) {
- this.vectorFieldName = vectorFieldName;
- return this;
- }
-
- /**
- * Set topK value of ANN search.
- *
- * @param topK topK value
- * @return Builder
- */
- public Builder withTopK(@NonNull Integer topK) {
- this.topK = topK;
- return this;
- }
-
- /**
- * Optional. Set expression to filter out entities before searching.
- * @see Boolean Expression Rules
- *
- * @param expr filtering expression
- * @return Builder
- */
- public Builder withExpr(@NonNull String expr) {
- this.expr = expr;
- return this;
- }
-
- /**
- * Optional. Specify output fields.
- *
- * @param outFields output fields
- * @return Builder
- */
- public Builder withOutFields(@NonNull ListBuilder
- */
- public Builder withVectors(@NonNull List> vectors) {
- this.vectors = vectors;
- return this;
- }
-
- /**
- * Specify how many digits after the decimal point for returned results.
- *
- * @param decimal how many digits after the decimal point
- * @return Builder
- */
- public Builder withRoundDecimal(@NonNull Integer decimal) {
- this.roundDecimal = decimal;
- return this;
- }
-
- /**
- * Set extra search parameters according to index type.
- *
- * For example: IVF index, the extra parameters can be "{\"nprobe\":10}"
- * For more information: @see Index Selection
- *
- * @param params extra parameters in json format
- * @return Builder
- */
- public Builder withParams(@NonNull String params) {
- this.params = params;
- return this;
- }
-
- /**
- * Verify parameters and create a new SearchParam
instance.
- *
- * @return SearchParam
- */
- public SearchParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(vectorFieldName, "Target field name");
-
- if (metricType == MetricType.INVALID) {
- throw new ParamException("Metric type is illegal");
- }
-
- if (vectors == null || vectors.isEmpty()) {
- throw new ParamException("Target vectors can not be empty");
- }
-
- if (vectors.get(0) instanceof List) {
- // float vectors
- List> first = (List>) vectors.get(0);
- if (!(first.get(0) instanceof Float)) {
- throw new ParamException("Float vector field's value must be LstString
by SearchParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "SearchParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionNames='" + partitionNames.toString() + '\'' +
- ", metricType=" + metricType +
- ", target vectors count=" + vectors.size() +
- ", vectorFieldName='" + vectorFieldName + '\'' +
- ", topK=" + topK +
- ", expr='" + expr + '\'' +
- ", params='" + params + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/index/CreateIndexParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/index/CreateIndexParam.java
deleted file mode 100644
index c1c578c..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/index/CreateIndexParam.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.index;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.Constant;
-import io.milvus.param.IndexType;
-import io.milvus.param.MetricType;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Parameters for createIndex
interface.
- */
-@Getter
-public class CreateIndexParam {
- private final String collectionName;
- private final String fieldName;
- private final MapCreateIndexParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String fieldName;
- private IndexType indexType;
- private MetricType metricType;
- private String extraParam;
-
- // syncMode:
- // Default behavior is sync mode, createIndex() return after the index successfully created.
- private Boolean syncMode = Boolean.TRUE;
-
- // syncWaitingDuration:
- // When syncMode is ture, createIndex() return after the index successfully created.
- // this value control the waiting interval. Unit: millisecond. Default value: 500 milliseconds.
- private Long syncWaitingInterval = 500L;
-
- // syncWaitingTimeout:
- // When syncMode is ture, createIndex() return after the index successfully created.
- // this value control the waiting timeout. Unit: second. Default value: 600 seconds.
- private Long syncWaitingTimeout = 600L;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set target field name. Field name cannot be empty or null.
- *
- * @param fieldName field name
- * @return Builder
- */
- public Builder withFieldName(@NonNull String fieldName) {
- this.fieldName = fieldName;
- return this;
- }
-
- /**
- * Set index type of the index.
- *
- * @param indexType index type
- * @return Builder
- */
- public Builder withIndexType(@NonNull IndexType indexType) {
- this.indexType = indexType;
- return this;
- }
-
- /**
- * Set metric type of the index.
- *
- * @param metricType metric type
- * @return Builder
- */
- public Builder withMetricType(@NonNull MetricType metricType) {
- this.metricType = metricType;
- return this;
- }
-
- /**
- * Set extra index parameters according to index type.
- *
- * For example: IVF index, the extra parameters can be "{\"nlist\":1024}"
- * For more information: @see Index Selection
- *
- * @param extraParam extra parameters in json format
- * @return Builder
- */
- public Builder withExtraParam(@NonNull String extraParam) {
- this.extraParam = extraParam;
- return this;
- }
-
- /**
- * Set to sync mode.
- * With sync mode, the client side will keep waiting until all segments of the collection successfully indexed.
- *
- * If not sync mode, client will return at once after the createIndex() is called.
- *
- * @param syncMode Boolean.TRUE
is sync mode, Boolean.FALSE is not
- * @return Builder
- */
- public Builder withSyncMode(@NonNull Boolean syncMode) {
- this.syncMode = syncMode;
- return this;
- }
-
- /**
- * Set waiting interval in sync mode. In sync mode, the client will constantly check index state by interval.
- * Interval must be larger than zero, and cannot be larger than Constant.MAX_WAITING_INDEX_INTERVAL.
- * @see Constant
- *
- * @param milliseconds interval
- * @return Builder
- */
- public Builder withSyncWaitingInterval(@NonNull Long milliseconds) {
- this.syncWaitingInterval = milliseconds;
- return this;
- }
-
- /**
- * Set time out value for sync mode.
- * Time out value must be larger than zero. No upper limit. Default value is 600 seconds.
- * @see Constant
- *
- * @param seconds time out value for sync mode
- * @return Builder
- */
- public Builder withSyncWaitingTimeout(@NonNull Long seconds) {
- this.syncWaitingTimeout = seconds;
- return this;
- }
-
- /**
- * Verify parameters and create a new CreateIndexParam
instance.
- *
- * @return CreateIndexParam
- */
- public CreateIndexParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(fieldName, "Field name");
-
- if (indexType == IndexType.INVALID) {
- throw new ParamException("Index type is required");
- }
-
- if (metricType == MetricType.INVALID) {
- throw new ParamException("Metric type is required");
- }
-
- if (syncMode == Boolean.TRUE) {
- if (syncWaitingInterval <= 0) {
- throw new ParamException("Sync index waiting interval must be larger than zero");
- } else if (syncWaitingInterval > Constant.MAX_WAITING_LOADING_INTERVAL) {
- throw new ParamException("Sync index waiting interval cannot be larger than "
- + Constant.MAX_WAITING_LOADING_INTERVAL.toString() + " milliseconds");
- }
-
- if (syncWaitingTimeout <= 0) {
- throw new ParamException("Sync index waiting timeout must be larger than zero");
- }
- }
-
- ParamUtils.CheckNullEmptyString(extraParam, "Index extra param");
-
- return new CreateIndexParam(this);
- }
- }
-
- /**
- * Construct a String
by CreateIndexParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "CreateIndexParam{" +
- "collectionName='" + collectionName + '\'' +
- ", fieldName='" + fieldName + '\'' +
- ", params='" + extraParam.toString() + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/index/DescribeIndexParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/index/DescribeIndexParam.java
deleted file mode 100644
index 37e2f10..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/index/DescribeIndexParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.index;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for describeIndex
interface.
- */
-@Getter
-public class DescribeIndexParam {
- private final String collectionName;
- private final String fieldName;
-
- private DescribeIndexParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.fieldName = builder.fieldName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DescribeIndexParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String fieldName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set target field name. Field name cannot be empty or null.
- *
- * @param fieldName field name
- * @return Builder
- */
- public Builder withFieldName(@NonNull String fieldName) {
- this.fieldName = fieldName;
- return this;
- }
-
- /**
- * Verify parameters and create a new DescribeIndexParam
instance.
- *
- * @return DescribeIndexParam
- */
- public DescribeIndexParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(fieldName, "Field name");
-
- return new DescribeIndexParam(this);
- }
- }
-
- /**
- * Construct a String
by DescribeIndexParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DescribeIndexParam{" +
- "collectionName='" + collectionName + '\'' +
- ", fieldName='" + fieldName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/index/DropIndexParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/index/DropIndexParam.java
deleted file mode 100644
index aa70452..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/index/DropIndexParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.index;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for dropIndex
interface.
- */
-@Getter
-public class DropIndexParam {
- private final String collectionName;
- private final String fieldName;
-
- private DropIndexParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.fieldName = builder.fieldName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DropIndexParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String fieldName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set target field name. Field name cannot be empty or null.
- *
- * @param fieldName field name
- * @return Builder
- */
- public Builder withFieldName(@NonNull String fieldName) {
- this.fieldName = fieldName;
- return this;
- }
-
- /**
- * Verify parameters and create a new DropIndexParam
instance.
- *
- * @return DropIndexParam
- */
- public DropIndexParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(fieldName, "Field name");
-
- return new DropIndexParam(this);
- }
- }
-
- /**
- * Construct a String
by DropIndexParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DropIndexParam{" +
- "collectionName='" + collectionName + '\'' +
- ", fieldName='" + fieldName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/index/GetIndexBuildProgressParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/index/GetIndexBuildProgressParam.java
deleted file mode 100644
index 8cce87f..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/index/GetIndexBuildProgressParam.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.index;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getIndexBuildProgress
interface.
- */
-@Getter
-public class GetIndexBuildProgressParam {
- private final String collectionName;
-
- private GetIndexBuildProgressParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetIndexBuildProgressParam
class.
- */
- public static final class Builder {
- private String collectionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetIndexBuildProgressParam
instance.
- *
- * @return GetIndexBuildProgressParam
- */
- public GetIndexBuildProgressParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- return new GetIndexBuildProgressParam(this);
- }
- }
-
- /**
- * Construct a String
by GetIndexBuildProgressParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetIndexBuildProgressParam{" +
- "collectionName='" + collectionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/index/GetIndexStateParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/index/GetIndexStateParam.java
deleted file mode 100644
index df22954..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/index/GetIndexStateParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.index;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getIndexState
interface.
- */
-@Getter
-public class GetIndexStateParam {
- private final String collectionName;
- private final String fieldName;
-
- private GetIndexStateParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.fieldName = builder.fieldName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetIndexStateParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String fieldName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set target field name. Field name cannot be empty or null.
- *
- * @param fieldName field name
- * @return Builder
- */
- public Builder withFieldName(@NonNull String fieldName) {
- this.fieldName = fieldName;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetIndexStateParam
instance.
- *
- * @return GetIndexStateParam
- */
- public GetIndexStateParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(fieldName, "Field name");
-
- return new GetIndexStateParam(this);
- }
- }
-
- /**
- * Construct a String
by GetIndexStateParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetIndexStateParam{" +
- "collectionName='" + collectionName + '\'' +
- ", fieldName='" + fieldName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/CreatePartitionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/CreatePartitionParam.java
deleted file mode 100644
index b795558..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/CreatePartitionParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for createPartition
interface.
- */
-@Getter
-public class CreatePartitionParam {
- private final String collectionName;
- private final String partitionName;
-
- private CreatePartitionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.partitionName = builder.partitionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for CreatePartitionParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String partitionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition name. Partition name cannot be empty or null.
- *
- * @param partitionName partition name
- * @return Builder
- */
- public Builder withPartitionName(@NonNull String partitionName) {
- this.partitionName = partitionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new CreatePartitionParam
instance.
- *
- * @return CreatePartitionParam
- */
- public CreatePartitionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(partitionName, "Partition name");
-
- return new CreatePartitionParam(this);
- }
- }
-
- /**
- * Construct a String
by CreatePartitionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "CreatePartitionParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/DropPartitionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/DropPartitionParam.java
deleted file mode 100644
index 93ae0a5..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/DropPartitionParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for dropPartition
interface.
- */
-@Getter
-public class DropPartitionParam {
- private final String collectionName;
- private final String partitionName;
-
- private DropPartitionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.partitionName = builder.partitionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DropPartitionParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String partitionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition name. Partition name cannot be empty or null.
- *
- * @param partitionName partition name
- * @return Builder
- */
- public Builder withPartitionName(@NonNull String partitionName) {
- this.partitionName = partitionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new DropPartitionParam
instance.
- *
- * @return DropPartitionParam
- */
- public DropPartitionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(partitionName, "Partition name");
-
- return new DropPartitionParam(this);
- }
- }
-
- /**
- * Construct a String
by DropPartitionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "DropPartitionParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/GetPartitionStatisticsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/GetPartitionStatisticsParam.java
deleted file mode 100644
index 74e183a..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/GetPartitionStatisticsParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for getPartitionStatistics
interface.
- */
-@Getter
-public class GetPartitionStatisticsParam {
- private final String collectionName;
- private final String partitionName;
-
- private GetPartitionStatisticsParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.partitionName = builder.partitionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetPartitionStatisticsParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String partitionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition name. Partition name cannot be empty or null.
- *
- * @param partitionName partition name
- * @return Builder
- */
- public Builder withPartitionName(@NonNull String partitionName) {
- this.partitionName = partitionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new GetPartitionStatisticsParam
instance.
- *
- * @return GetPartitionStatisticsParam
- */
- public GetPartitionStatisticsParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(partitionName, "Partition name");
-
- return new GetPartitionStatisticsParam(this);
- }
- }
-
- /**
- * Construct a String
by GetPartitionStatisticsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "GetPartitionStatisticsParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/HasPartitionParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/HasPartitionParam.java
deleted file mode 100644
index b16ef10..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/HasPartitionParam.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-/**
- * Parameters for hasPartition
interface.
- */
-@Getter
-public class HasPartitionParam {
- private final String collectionName;
- private final String partitionName;
-
- private HasPartitionParam(@NonNull Builder builder) {
- this.collectionName = builder.collectionName;
- this.partitionName = builder.partitionName;
- }
-
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for HasPartitionParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private String partitionName;
-
- private Builder() {
- }
-
- /**
- * Set collection name. Collection name cannot be empty or null.
- *
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition name. Partition name cannot be empty or null.
- *
- * @param partitionName partition name
- * @return Builder
- */
- public Builder withPartitionName(@NonNull String partitionName) {
- this.partitionName = partitionName;
- return this;
- }
-
- /**
- * Verify parameters and create a new HasPartitionParam
instance.
- *
- * @return HasPartitionParam
- */
- public HasPartitionParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
- ParamUtils.CheckNullEmptyString(partitionName, "Partition name");
-
- return new HasPartitionParam(this);
- }
- }
-
- /**
- * Construct a String
by HasPartitionParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "HasPartitionParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionName + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/LoadPartitionsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/LoadPartitionsParam.java
deleted file mode 100644
index b940f57..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/LoadPartitionsParam.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.Constant;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for loadPartition
interface.
- */
-@Getter
-public class LoadPartitionsParam {
- private final String collectionName;
- private final ListLoadPartitionsParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private final ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition names list. Partition names list cannot be null or empty.
- *
- * @param partitionNames partition names list
- * @return Builder
- */
- public Builder withPartitionNames(@NonNull ListBuilder
- */
- public Builder addPartitionName(@NonNull String partitionName) {
- if (!this.partitionNames.contains(partitionName)) {
- this.partitionNames.add(partitionName);
- }
- return this;
- }
-
- /**
- * Set load action to sync mode.
- * With sync mode, the client side will keep waiting until all segments of the partition successfully loaded.
- *
- * If not sync mode, client will return at once after the loadPartitions() is called.
- *
- * @param syncLoad Boolean.TRUE
is sync mode, Boolean.FALSE is not
- * @return Builder
- */
- public Builder withSyncLoad(@NonNull Boolean syncLoad) {
- this.syncLoad = syncLoad;
- return this;
- }
-
- /**
- * Set waiting interval in sync mode. In sync mode, the client will constantly check partition load state by interval.
- * Interval must be larger than zero, and cannot be larger than Constant.MAX_WAITING_LOADING_INTERVAL.
- * @see Constant
- *
- * @param milliseconds interval
- * @return Builder
- */
- public Builder withSyncLoadWaitingInterval(@NonNull Long milliseconds) {
- this.syncLoadWaitingInterval = milliseconds;
- return this;
- }
-
- /**
- * Set time out value for sync mode.
- * Time out value must be larger than zero, and cannot be larger than Constant.MAX_WAITING_LOADING_TIMEOUT.
- * @see Constant
- *
- * @param seconds time out value for sync mode
- * @return Builder
- */
- public Builder withSyncLoadWaitingTimeout(@NonNull Long seconds) {
- this.syncLoadWaitingTimeout = seconds;
- return this;
- }
-
- /**
- * Verify parameters and create a new LoadPartitionsParam
instance.
- *
- * @return LoadPartitionsParam
- */
- public LoadPartitionsParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- if (partitionNames.isEmpty()) {
- throw new ParamException("Partition names cannot be empty");
- }
-
- for (String name : partitionNames) {
- ParamUtils.CheckNullEmptyString(name, "Partition name");
- }
-
- if (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) {
- throw new ParamException("Sync load waiting interval cannot be larger than "
- + Constant.MAX_WAITING_LOADING_INTERVAL.toString() + " milliseconds");
- }
-
- if (syncLoadWaitingTimeout <= 0) {
- throw new ParamException("Sync load waiting interval must be larger than zero");
- } else if (syncLoadWaitingTimeout > Constant.MAX_WAITING_LOADING_TIMEOUT) {
- throw new ParamException("Sync load waiting interval cannot be larger than "
- + Constant.MAX_WAITING_LOADING_TIMEOUT.toString() + " seconds");
- }
- }
-
- return new LoadPartitionsParam(this);
- }
- }
-
- /**
- * Construct a String
by LoadPartitionsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "LoadPartitionsParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionName='" + partitionNames.toString() + '\'' +
- ", syncLoad=" + syncLoad +
- ", syncLoadWaitingInterval=" + syncLoadWaitingInterval +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/ReleasePartitionsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/ReleasePartitionsParam.java
deleted file mode 100644
index 07ca361..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/ReleasePartitionsParam.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for releasePartition
interface.
- */
-@Getter
-public class ReleasePartitionsParam {
- private final String collectionName;
- private final ListReleasePartitionsParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private final ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition names list. Partition names list cannot be null or empty.
- *
- * @param partitionNames partition names list
- * @return Builder
- */
- public Builder withPartitionNames(@NonNull ListBuilder
- */
- public Builder addPartitionName(@NonNull String partitionName) {
- if (!this.partitionNames.contains(partitionName)) {
- this.partitionNames.add(partitionName);
- }
- return this;
- }
-
- /**
- * Verify parameters and create a new ReleasePartitionsParam
instance.
- *
- * @return ReleasePartitionsParam
- */
- public ReleasePartitionsParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- if (partitionNames.isEmpty()) {
- throw new ParamException("Partition names cannot be empty");
- }
-
- for (String name : partitionNames) {
- ParamUtils.CheckNullEmptyString(name, "Partition name");
- }
-
- return new ReleasePartitionsParam(this);
- }
- }
-
- /**
- * Construct a String
by ReleasePartitionsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "ReleasePartitionsParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionNames='" + partitionNames.toString() + '\'' +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/java/io/milvus/param/partition/ShowPartitionsParam.java b/milvus-java-sdk/src/main/java/io/milvus/param/partition/ShowPartitionsParam.java
deleted file mode 100644
index c49c24a..0000000
--- a/milvus-java-sdk/src/main/java/io/milvus/param/partition/ShowPartitionsParam.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package io.milvus.param.partition;
-
-import io.milvus.exception.ParamException;
-import io.milvus.grpc.ShowType;
-import io.milvus.param.ParamUtils;
-
-import lombok.Getter;
-import lombok.NonNull;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Parameters for showPartition
interface.
- */
-@Getter
-public class ShowPartitionsParam {
- private final String collectionName;
- private final ListShowPartitionsParam
class.
- */
- public static final class Builder {
- private String collectionName;
- private ListBuilder
- */
- public Builder withCollectionName(@NonNull String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set partition names list. Partition names list cannot be null or empty.
- *
- * @param partitionNames partition names list
- * @return Builder
- */
- public Builder withPartitionNames(@NonNull ListBuilder
- */
- public Builder addPartitionName(@NonNull String partitionName) {
- if (!this.partitionNames.contains(partitionName)) {
- this.partitionNames.add(partitionName);
- }
- return this;
- }
-
- /**
- * Verify parameters and create a new ShowPartitionsParam
instance.
- *
- * @return ShowPartitionsParam
- */
- public ShowPartitionsParam build() throws ParamException {
- ParamUtils.CheckNullEmptyString(collectionName, "Collection name");
-
- if (partitionNames != null && !partitionNames.isEmpty()) {
- for (String partitionName : partitionNames) {
- ParamUtils.CheckNullEmptyString(partitionName, "Partition name");
- }
- this.showType = ShowType.InMemory;
- }
-
- return new ShowPartitionsParam(this);
- }
- }
-
- /**
- * Construct a String
by ShowPartitionsParam
instance.
- *
- * @return String
- */
- @Override
- public String toString() {
- return "ShowPartitionsParam{" +
- "collectionName='" + collectionName + '\'' +
- ", partitionNames='" + partitionNames.toString() + '\'' +
- ", showType=" + showType.toString() +
- '}';
- }
-}
diff --git a/milvus-java-sdk/src/main/proto/common.proto b/milvus-java-sdk/src/main/proto/common.proto
deleted file mode 100644
index acd0aa2..0000000
--- a/milvus-java-sdk/src/main/proto/common.proto
+++ /dev/null
@@ -1,187 +0,0 @@
-syntax = "proto3";
-
-package common;
-option java_multiple_files = true;
-option java_package = "io.milvus.grpc";
-option java_outer_classname = "CommonProto";
-option java_generate_equals_and_hash = true;
-
-
-enum ErrorCode {
- Success = 0;
- UnexpectedError = 1;
- ConnectFailed = 2;
- PermissionDenied = 3;
- CollectionNotExists = 4;
- IllegalArgument = 5;
- IllegalDimension = 7;
- IllegalIndexType = 8;
- IllegalCollectionName = 9;
- IllegalTOPK = 10;
- IllegalRowRecord = 11;
- IllegalVectorID = 12;
- IllegalSearchResult = 13;
- FileNotFound = 14;
- MetaFailed = 15;
- CacheFailed = 16;
- CannotCreateFolder = 17;
- CannotCreateFile = 18;
- CannotDeleteFolder = 19;
- CannotDeleteFile = 20;
- BuildIndexError = 21;
- IllegalNLIST = 22;
- IllegalMetricType = 23;
- OutOfMemory = 24;
- IndexNotExist = 25;
- EmptyCollection = 26;
-
- // internal error code.
- DDRequestRace = 1000;
-}
-
-enum IndexState {
- IndexStateNone = 0;
- Unissued = 1;
- InProgress = 2;
- Finished = 3;
- Failed = 4;
-}
-
-enum SegmentState {
- SegmentStateNone = 0;
- NotExist = 1;
- Growing = 2;
- Sealed = 3;
- Flushed = 4;
- Flushing = 5;
- Dropped = 6;
-}
-
-message Status {
- ErrorCode error_code = 1;
- string reason = 2;
-}
-
-message KeyValuePair {
- string key = 1;
- string value = 2;
-}
-
-message KeyDataPair {
- string key = 1;
- bytes data = 2;
-}
-
-message Blob {
- bytes value = 1;
-}
-
-message Address {
- string ip = 1;
- int64 port = 2;
-}
-
-enum MsgType {
- Undefined = 0;
- /* DEFINITION REQUESTS: COLLECTION */
- CreateCollection = 100;
- DropCollection = 101;
- HasCollection = 102;
- DescribeCollection = 103;
- ShowCollections = 104;
- GetSystemConfigs = 105;
- LoadCollection = 106;
- ReleaseCollection = 107;
- CreateAlias = 108;
- DropAlias = 109;
- AlterAlias = 110;
-
-
- /* DEFINITION REQUESTS: PARTITION */
- CreatePartition = 200;
- DropPartition = 201;
- HasPartition = 202;
- DescribePartition = 203;
- ShowPartitions = 204;
- LoadPartitions = 205;
- ReleasePartitions = 206;
-
- /* DEFINE REQUESTS: SEGMENT */
- ShowSegments = 250;
- DescribeSegment = 251;
- LoadSegments = 252;
- ReleaseSegments = 253;
- HandoffSegments = 254;
- LoadBalanceSegments = 255;
-
- /* DEFINITION REQUESTS: INDEX */
- CreateIndex = 300;
- DescribeIndex = 301;
- DropIndex = 302;
-
- /* MANIPULATION REQUESTS */
- Insert = 400;
- Delete = 401;
- Flush = 402;
-
- /* QUERY */
- Search = 500;
- SearchResult = 501;
- GetIndexState = 502;
- GetIndexBuildProgress = 503;
- GetCollectionStatistics = 504;
- GetPartitionStatistics = 505;
- Retrieve = 506;
- RetrieveResult = 507;
- WatchDmChannels = 508;
- RemoveDmChannels = 509;
- WatchQueryChannels = 510;
- RemoveQueryChannels = 511;
- SealedSegmentsChangeInfo = 512;
- WatchDeltaChannels = 513;
-
- /* DATA SERVICE */
- SegmentInfo = 600;
- SystemInfo = 601;
-
- /* SYSTEM CONTROL */
- TimeTick = 1200;
- QueryNodeStats = 1201; // GOOSE TODO: Remove kQueryNodeStats
- LoadIndex = 1202;
- RequestID = 1203;
- RequestTSO = 1204;
- AllocateSegment = 1205;
- SegmentStatistics = 1206;
- SegmentFlushDone = 1207;
-
- DataNodeTt = 1208;
-}
-
-message MsgBase {
- MsgType msg_type = 1;
- int64 msgID = 2;
- uint64 timestamp = 3;
- int64 sourceID = 4;
-}
-
-enum DslType {
- Dsl = 0;
- BoolExprV1 = 1;
-}
-
-// Don't Modify This. @czs
-message MsgHeader {
- common.MsgBase base = 1;
-}
-
-// Don't Modify This. @czs
-message DMLMsgHeader {
- common.MsgBase base = 1;
- string shardName = 2;
-}
-
-enum CompactionState {
- UndefiedState = 0;
- Executing = 1;
- Completed = 2;
-}
diff --git a/milvus-java-sdk/src/main/proto/milvus.proto b/milvus-java-sdk/src/main/proto/milvus.proto
deleted file mode 100644
index 0ded8b9..0000000
--- a/milvus-java-sdk/src/main/proto/milvus.proto
+++ /dev/null
@@ -1,773 +0,0 @@
-syntax = "proto3";
-
-import "common.proto";
-import "schema.proto";
-
-option java_multiple_files = true;
-option java_package = "io.milvus.grpc";
-option java_outer_classname = "MilvusProto";
-option java_generate_equals_and_hash = true;
-
-package milvus.proto.milvus;
-
-service MilvusService {
- rpc CreateCollection(CreateCollectionRequest) returns (common.Status) {}
- rpc DropCollection(DropCollectionRequest) returns (common.Status) {}
- rpc HasCollection(HasCollectionRequest) returns (BoolResponse) {}
- rpc LoadCollection(LoadCollectionRequest) returns (common.Status) {}
- rpc ReleaseCollection(ReleaseCollectionRequest) returns (common.Status) {}
- rpc DescribeCollection(DescribeCollectionRequest) returns (DescribeCollectionResponse) {}
- rpc GetCollectionStatistics(GetCollectionStatisticsRequest) returns (GetCollectionStatisticsResponse) {}
- rpc ShowCollections(ShowCollectionsRequest) returns (ShowCollectionsResponse) {}
-
- rpc CreatePartition(CreatePartitionRequest) returns (common.Status) {}
- rpc DropPartition(DropPartitionRequest) returns (common.Status) {}
- rpc HasPartition(HasPartitionRequest) returns (BoolResponse) {}
- rpc LoadPartitions(LoadPartitionsRequest) returns (common.Status) {}
- rpc ReleasePartitions(ReleasePartitionsRequest) returns (common.Status) {}
- rpc GetPartitionStatistics(GetPartitionStatisticsRequest) returns (GetPartitionStatisticsResponse) {}
- rpc ShowPartitions(ShowPartitionsRequest) returns (ShowPartitionsResponse) {}
-
- rpc CreateAlias(CreateAliasRequest) returns (common.Status) {}
- rpc DropAlias(DropAliasRequest) returns (common.Status) {}
- rpc AlterAlias(AlterAliasRequest) returns (common.Status) {}
-
- rpc CreateIndex(CreateIndexRequest) returns (common.Status) {}
- rpc DescribeIndex(DescribeIndexRequest) returns (DescribeIndexResponse) {}
- rpc GetIndexState(GetIndexStateRequest) returns (GetIndexStateResponse) {}
- rpc GetIndexBuildProgress(GetIndexBuildProgressRequest) returns (GetIndexBuildProgressResponse) {}
- rpc DropIndex(DropIndexRequest) returns (common.Status) {}
-
- rpc Insert(InsertRequest) returns (MutationResult) {}
- rpc Delete(DeleteRequest) returns (MutationResult) {}
- rpc Search(SearchRequest) returns (SearchResults) {}
- rpc Flush(FlushRequest) returns (FlushResponse) {}
- rpc Query(QueryRequest) returns (QueryResults) {}
- rpc CalcDistance(CalcDistanceRequest) returns (CalcDistanceResults) {}
-
- rpc GetPersistentSegmentInfo(GetPersistentSegmentInfoRequest) returns (GetPersistentSegmentInfoResponse) {}
- rpc GetQuerySegmentInfo(GetQuerySegmentInfoRequest) returns (GetQuerySegmentInfoResponse) {}
-
- rpc Dummy(DummyRequest) returns (DummyResponse) {}
-
- // TODO: remove
- rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
-
- // https://wiki.lfaidata.foundation/display/MIL/MEP+8+--+Add+metrics+for+proxy
- rpc GetMetrics(GetMetricsRequest) returns (GetMetricsResponse) {}
- rpc LoadBalance(LoadBalanceRequest) returns (common.Status) {}
- rpc GetCompactionState(GetCompactionStateRequest) returns (GetCompactionStateResponse) {}
- rpc ManualCompaction(ManualCompactionRequest) returns (ManualCompactionResponse) {}
- rpc GetCompactionStateWithPlans(GetCompactionPlansRequest) returns (GetCompactionPlansResponse) {}
-}
-
-message CreateAliasRequest {
- common.MsgBase base = 1;
- string db_name = 2;
- string collection_name = 3;
- string alias = 4;
-}
-
-message DropAliasRequest {
- common.MsgBase base = 1;
- string db_name = 2;
- string alias = 3;
-}
-
-message AlterAliasRequest{
- common.MsgBase base = 1;
- string db_name = 2;
- string collection_name = 3;
- string alias = 4;
-}
-
-/**
-* Create collection in milvus
-*/
-message CreateCollectionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The unique collection name in milvus.(Required)
- string collection_name = 3;
- // The serialized `schema.CollectionSchema`(Required)
- bytes schema = 4;
- // Once set, no modification is allowed (Optional)
- // https://github.com/milvus-io/milvus/issues/6690
- int32 shards_num = 5;
-}
-
-/**
-* Drop collection in milvus, also will drop data in collection.
-*/
-message DropCollectionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The unique collection name in milvus.(Required)
- string collection_name = 3;
-}
-
-/**
-* Check collection exist in milvus or not.
-*/
-message HasCollectionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name you want to check.
- string collection_name = 3;
- // If time_stamp is not zero, will return true when time_stamp >= created collection timestamp, otherwise will return false.
- uint64 time_stamp = 4;
-}
-
-
-message BoolResponse {
- common.Status status = 1;
- bool value = 2;
-}
-
-message StringResponse {
- common.Status status = 1;
- string value = 2;
-}
-
-/**
-* Get collection meta datas like: schema, collectionID, shards number ...
-*/
-message DescribeCollectionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name you want to describe, you can pass collection_name or collectionID
- string collection_name = 3;
- // The collection ID you want to describe
- int64 collectionID = 4;
- // If time_stamp is not zero, will describe collection success when time_stamp >= created collection timestamp, otherwise will throw error.
- uint64 time_stamp = 5;
-}
-
-/**
-* DescribeCollection Response
-*/
-message DescribeCollectionResponse {
- // Contain error_code and reason
- common.Status status = 1;
- // The schema param when you created collection.
- schema.CollectionSchema schema = 2;
- // The collection id
- int64 collectionID = 3;
- // System design related, users should not perceive
- repeated string virtual_channel_names = 4;
- // System design related, users should not perceive
- repeated string physical_channel_names = 5;
- // Hybrid timestamp in milvus
- uint64 created_timestamp = 6;
- // The utc timestamp calculated by created_timestamp
- uint64 created_utc_timestamp = 7;
- // The shards number you set.
- int32 shards_num = 8;
- // The aliases of this collection
- repeated string aliases = 9;
- // The message ID/posititon when collection is created
- repeated common.KeyDataPair start_positions = 10;
-}
-
-/**
-* Load collection data into query nodes, then you can do vector search on this collection.
-*/
-message LoadCollectionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name you want to load
- string collection_name = 3;
-}
-
-/**
-* Release collection data from query nodes, then you can't do vector search on this collection.
-*/
-message ReleaseCollectionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name you want to release
- string collection_name = 3;
-}
-
-/**
-* Get collection statistics like row_count.
-*/
-message GetCollectionStatisticsRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name you want get statistics
- string collection_name = 3;
-}
-
-/**
-* Will return collection statistics in stats field like [{key:"row_count",value:"1"}]
-*/
-message GetCollectionStatisticsResponse {
- // Contain error_code and reason
- common.Status status = 1;
- // Collection statistics data
- repeated common.KeyValuePair stats = 2;
-}
-
-/*
-* This is for ShowCollectionsRequest type field.
-*/
-enum ShowType {
- // Will return all colloections
- All = 0;
- // Will return loaded collections with their inMemory_percentages
- InMemory = 1;
-}
-
-/*
-* List collections
-*/
-message ShowCollectionsRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // Not useful for now
- uint64 time_stamp = 3;
- // Decide return Loaded collections or All collections(Optional)
- ShowType type = 4;
- // When type is InMemory, will return these collection's inMemory_percentages.(Optional)
- repeated string collection_names = 5;
-}
-
-/*
-* Return basic collection infos.
-*/
-message ShowCollectionsResponse {
- // Contain error_code and reason
- common.Status status = 1;
- // Collection name array
- repeated string collection_names = 2;
- // Collection Id array
- repeated int64 collection_ids = 3;
- // Hybrid timestamps in milvus
- repeated uint64 created_timestamps = 4;
- // The utc timestamp calculated by created_timestamp
- repeated uint64 created_utc_timestamps = 5;
- // Load percentage on querynode when type is InMemory
- repeated int64 inMemory_percentages = 6;
-}
-
-/*
-* Create partition in created collection.
-*/
-message CreatePartitionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name in milvus
- string collection_name = 3;
- // The partition name you want to create.
- string partition_name = 4;
-}
-
-/*
-* Drop partition in created collection.
-*/
-message DropPartitionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name in milvus
- string collection_name = 3;
- // The partition name you want to drop
- string partition_name = 4;
-}
-
-/*
-* Check if partition exist in collection or not.
-*/
-message HasPartitionRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name in milvus
- string collection_name = 3;
- // The partition name you want to check
- string partition_name = 4;
-}
-
-/*
-* Load specific partitions data of one collection into query nodes
-* Then you can get these data as result when you do vector search on this collection.
-*/
-message LoadPartitionsRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name in milvus
- string collection_name = 3;
- // The partition names you want to load
- repeated string partition_names = 4;
-}
-
-/*
-* Release specific partitions data of one collection from query nodes.
-* Then you can not get these data as result when you do vector search on this collection.
-*/
-message ReleasePartitionsRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name in milvus
- string collection_name = 3;
- // The partition names you want to release
- repeated string partition_names = 4;
-}
-
-/*
-* Get partition statistics like row_count.
-*/
-message GetPartitionStatisticsRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name in milvus
- string collection_name = 3;
- // The partition name you want to collect statistics
- string partition_name = 4;
-}
-
-message GetPartitionStatisticsResponse {
- common.Status status = 1;
- repeated common.KeyValuePair stats = 2;
-}
-
-/*
-* List all partitions for particular collection
-*/
-message ShowPartitionsRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The collection name you want to describe, you can pass collection_name or collectionID
- string collection_name = 3;
- // The collection id in milvus
- int64 collectionID = 4;
- // When type is InMemory, will return these patitions's inMemory_percentages.(Optional)
- repeated string partition_names = 5;
- // Decide return Loaded partitions or All partitions(Optional)
- ShowType type = 6;
-}
-
-/*
-* List all partitions for particular collection response.
-* The returned datas are all rows, we can format to columns by therir index.
-*/
-message ShowPartitionsResponse {
- // Contain error_code and reason
- common.Status status = 1;
- // All partition names for this collection
- repeated string partition_names = 2;
- // All partition ids for this collection
- repeated int64 partitionIDs = 3;
- // All hybrid timestamps
- repeated uint64 created_timestamps = 4;
- // All utc timestamps calculated by created_timestamps
- repeated uint64 created_utc_timestamps = 5;
- // Load percentage on querynode
- repeated int64 inMemory_percentages = 6;
-}
-
-message DescribeSegmentRequest {
- common.MsgBase base = 1;
- int64 collectionID = 2;
- int64 segmentID = 3;
-}
-
-message DescribeSegmentResponse {
- common.Status status = 1;
- int64 indexID = 2;
- int64 buildID = 3;
- bool enable_index = 4;
-}
-
-message ShowSegmentsRequest {
- common.MsgBase base = 1;
- int64 collectionID = 2;
- int64 partitionID = 3;
-}
-
-message ShowSegmentsResponse {
- common.Status status = 1;
- repeated int64 segmentIDs = 2;
-}
-
-/*
-* Create index for vector datas
-*/
-message CreateIndexRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The particular collection name you want to create index.
- string collection_name = 3;
- // The vector field name in this particular collection
- string field_name = 4;
- // Support keys: index_type,metric_type, params. Different index_type may has different params.
- repeated common.KeyValuePair extra_params = 5;
-}
-
-/*
-* Get created index information.
-* Current release of Milvus only supports showing latest built index.
-*/
-message DescribeIndexRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2;
- // The particular collection name in Milvus
- string collection_name = 3;
- // The vector field name in this particular collection
- string field_name = 4;
- // No need to set up for now @2021.06.30
- string index_name = 5;
-}
-
-/*
-* Index informations
-*/
-message IndexDescription {
- // Index name
- string index_name = 1;
- // Index id
- int64 indexID = 2;
- // Will return index_type, metric_type, params(like nlist).
- repeated common.KeyValuePair params = 3;
- // The vector field name
- string field_name = 4;
-}
-
-/*
-* Describe index response
-*/
-message DescribeIndexResponse {
- // Response status
- common.Status status = 1;
- // All index informations, for now only return tha latest index you created for the collection.
- repeated IndexDescription index_descriptions = 2;
-}
-
-/*
-* Get index building progress
-*/
-message GetIndexBuildProgressRequest {
- // Not useful for now
- common.MsgBase base = 1;
- // Not useful for now
- string db_name = 2 ;
- // The collection name in milvus
- string collection_name = 3;
- // The vector field name in this collection
- string field_name = 4;
- // Not useful for now
- string index_name = 5;
-}
-
-message GetIndexBuildProgressResponse {
- common.Status status = 1;
- int64 indexed_rows = 2;
- int64 total_rows = 3;
-}
-
-message GetIndexStateRequest {
- common.MsgBase base = 1; // must
- string db_name = 2 ;
- string collection_name = 3; // must
- string field_name = 4;
- string index_name = 5; // No need to set up for now @2021.06.30
-}
-
-message GetIndexStateResponse {
- common.Status status = 1;
- common.IndexState state = 2;
- string fail_reason = 3;
-}
-
-message DropIndexRequest {
- common.MsgBase base = 1; // must
- string db_name = 2;
- string collection_name = 3; // must
- string field_name = 4;
- string index_name = 5; // No need to set up for now @2021.06.30
-}
-
-message InsertRequest {
- common.MsgBase base = 1;
- string db_name = 2;
- string collection_name = 3;
- string partition_name = 4;
- repeated schema.FieldData fields_data = 5;
- repeated uint32 hash_keys = 6;
- uint32 num_rows = 7;
-}
-
-message MutationResult {
- common.Status status = 1;
- schema.IDs IDs = 2; // required for insert, delete
- repeated uint32 succ_index = 3; // error indexes indicate
- repeated uint32 err_index = 4; // error indexes indicate
- bool acknowledged = 5;
- int64 insert_cnt = 6;
- int64 delete_cnt = 7;
- int64 upsert_cnt = 8;
- uint64 timestamp = 9;
-}
-
-message DeleteRequest {
- common.MsgBase base = 1;
- string db_name = 2;
- string collection_name = 3;
- string partition_name = 4;
- string expr = 5;
- repeated uint32 hash_keys = 6;
-}
-
-enum PlaceholderType {
- None = 0;
- BinaryVector = 100;
- FloatVector = 101;
-}
-
-message PlaceholderValue {
- string tag = 1;
- PlaceholderType type = 2;
- // values is a 2d-array, every array contains a vector
- repeated bytes values = 3;
-}
-
-message PlaceholderGroup {
- repeated PlaceholderValue placeholders = 1;
-}
-
-message SearchRequest {
- common.MsgBase base = 1; // must
- string db_name = 2;
- string collection_name = 3; // must
- repeated string partition_names = 4; // must
- string dsl = 5; // must
- // serialized `PlaceholderGroup`
- bytes placeholder_group = 6; // must
- common.DslType dsl_type = 7; // must
- repeated string output_fields = 8;
- repeated common.KeyValuePair search_params = 9; // must
- uint64 travel_timestamp = 10;
- uint64 guarantee_timestamp = 11; // guarantee_timestamp
-}
-
-message Hits {
- repeated int64 IDs = 1;
- repeated bytes row_data = 2;
- repeated float scores = 3;
-}
-
-message SearchResults {
- common.Status status = 1;
- schema.SearchResultData results = 2;
-}
-
-message FlushRequest {
- common.MsgBase base = 1;
- string db_name = 2;
- repeated string collection_names = 3;
-}
-
-message FlushResponse{
- common.Status status = 1;
- string db_name = 2;
- map
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief CollectionConfig contains params for collection
- */
-
-package com.alibaba.proxima.be.client;
-
-import java.util.*;
-
-/**
- * Contains config for collection
- */
-public class CollectionConfig {
- private final String collectionName;
- private final long maxDocsPerSegment;
- private final List
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief CollectionInfo contains information for collection
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Contains information for collection
- */
-public class CollectionInfo {
- private final CollectionConfig collectionConfig;
- private final CollectionStatus collectionStatus;
- private final String uuid;
- private final LsnContext latestLsnContext;
- private final long magicNumber;
-
- private CollectionInfo(Builder builder) {
- this.collectionConfig = builder.collectionConfig;
- this.collectionStatus = builder.collectionStatus;
- this.uuid = builder.uuid;
- this.latestLsnContext = builder.latestLsnContext;
- this.magicNumber = builder.magicNumber;
- }
-
- public CollectionConfig getCollectionConfig() {
- return collectionConfig;
- }
-
- public CollectionStatus getCollectionStatus() {
- return collectionStatus;
- }
-
- public String getUuid() {
- return uuid;
- }
-
- public LsnContext getLatestLsnContext() {
- return latestLsnContext;
- }
-
- public long getMagicNumber() {
- return magicNumber;
- }
-
- // New CollectionInfo builder
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for CollectionInfo
- */
- public static class Builder {
- // required parameters
- private CollectionConfig collectionConfig;
- private CollectionStatus collectionStatus;
- private String uuid;
-
- // optional parameters
- private LsnContext latestLsnContext = null;
- private long magicNumber = 0;
-
- /**
- * Constructor without parameters
- */
- public Builder() {
- }
-
- /**
- * Set collection config
- * @param collectionConfig collection config
- * @return Builder
- */
- public Builder withCollectionConfig(CollectionConfig collectionConfig) {
- this.collectionConfig = collectionConfig;
- return this;
- }
-
- /**
- * Sset collection status
- * @param collectionStatus collection status
- * @return Builder
- */
- public Builder withCollectionStatus(CollectionStatus collectionStatus) {
- this.collectionStatus = collectionStatus;
- return this;
- }
-
- /**
- * Set uuid
- * @param uuid unique user id
- * @return Builder
- */
- public Builder withUuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- /**
- * Set latest lsn context
- * @param latestLsnContext latest lsn context, only use with mysql repository
- * @return Builder
- */
- public Builder withLatestLsnContext(LsnContext latestLsnContext) {
- this.latestLsnContext = latestLsnContext;
- return this;
- }
-
- /**
- * Set magic number
- * @param magicNumber magic number from server
- * @return Builder
- */
- public Builder withMagicNumber(long magicNumber) {
- this.magicNumber = magicNumber;
- return this;
- }
-
- /**
- * Build CollectionInfo object
- * @return CollectionInfo
- */
- public CollectionInfo build() {
- return new CollectionInfo(this);
- }
- }
-
- /**
- * Collection running status
- */
- public enum CollectionStatus {
- /**
- * Collection initialized
- */
- INITIALIZED(0),
- /**
- * Collection serving
- */
- SERVING(1),
- /**
- * Collection dropped
- */
- DROPPED(2),
- /**
- * Unknown status
- */
- UNKNOWN(-1);
-
- private int value;
-
- CollectionStatus(int value) {
- this.value = value;
- }
-
- public int getValue() {
- return this.value;
- }
-
- public static CollectionStatus valueOf(int value) {
- switch (value) {
- case 0:
- return INITIALIZED;
- case 1:
- return SERVING;
- case 2:
- return DROPPED;
- default:
- return UNKNOWN;
- }
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/CollectionStats.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/CollectionStats.java
deleted file mode 100644
index 9910b90..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/CollectionStats.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief CollectionStats contains running statistic information for collection
- */
-
-package com.alibaba.proxima.be.client;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Contains statistic information for collection
- */
-public class CollectionStats {
- private final String collectionName;
- private final String collectionPath;
- private final long totalDocCount;
- private final long totalSegmentCount;
- private final long totalIndexFileCount;
- private final long totalIndexFileSize;
- private final List
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief ConnectParam contains the grpc connecting parameters
- */
-
-package com.alibaba.proxima.be.client;
-
-import java.util.concurrent.TimeUnit;
-
-/**
- * ConnectParam contains the grpc connecting param
- */
-public class ConnectParam {
- // required parameters
- private final String host;
- private final int port;
- // optional parameters
- private final long timeoutNanos;
- private final long idleTimeoutNanos;
- private final long keepAliveTimeNanos;
- private final long keepAliveTimeoutNanos;
-
- //
-
- /**
- * Constructor with builder
- * @param builder builder
- */
- private ConnectParam(Builder builder) {
- this.port = builder.port;
- this.host = builder.host;
- this.timeoutNanos = builder.timeoutNanos;
- this.idleTimeoutNanos = builder.idleTimeoutNanos;
- this.keepAliveTimeNanos = builder.keepAliveTimeNanos;
- this.keepAliveTimeoutNanos = builder.keepAliveTimeoutNanos;
- }
-
- /**
- * Get host
- * @return String
- */
- public String getHost() {
- return this.host;
- }
-
- /**
- * Get port
- * @return int
- */
- public int getPort() {
- return this.port;
- }
-
- /**
- * Get timeout with unit
- * @param timeUnit time unit
- * @return request timeout
- */
- public long getTimeout(TimeUnit timeUnit) {
- return timeUnit.convert(this.timeoutNanos, TimeUnit.NANOSECONDS);
- }
-
- /**
- * Get idle timeout with unit
- * @param timeUnit time unit
- * @return idle timeout by time unit
- */
- public long getIdleTimeout(TimeUnit timeUnit) {
- return timeUnit.convert(this.idleTimeoutNanos, TimeUnit.NANOSECONDS);
- }
-
- /**
- * Get keep alive time with unit
- * @param timeUnit time unit
- * @return keep alive time by time unit
- */
- public long getKeepAliveTime(TimeUnit timeUnit) {
- return timeUnit.convert(this.keepAliveTimeNanos, TimeUnit.NANOSECONDS);
- }
-
- /**
- * Get keep alive timeout with unit
- * @param timeUnit time unit
- * @return keep alive timeout by time unit
- */
- public long getKeepAliveTimeout(TimeUnit timeUnit) {
- return timeUnit.convert(this.keepAliveTimeoutNanos, TimeUnit.NANOSECONDS);
- }
-
- /**
- * New ConnectParam builder
- * @return Builder
- */
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for ConnectParam
- */
- public static class Builder {
- private String host = "localhost";
- private int port = 16000;
- private long timeoutNanos = TimeUnit.NANOSECONDS.convert(1, TimeUnit.SECONDS);
- private long idleTimeoutNanos = TimeUnit.NANOSECONDS.convert(12, TimeUnit.HOURS);
- private long keepAliveTimeNanos = Long.MAX_VALUE;
- private long keepAliveTimeoutNanos = TimeUnit.NANOSECONDS.convert(30, TimeUnit.SECONDS);
-
- /**
- * Build ConnectParam object
- * @return ConnectParam
- */
- public ConnectParam build() {
- return new ConnectParam(this);
- }
-
- /**
- * Set host
- * @param host grpc server host
- * @return Builder
- */
- public Builder withHost(String host) {
- this.host = host;
- return this;
- }
-
- /**
- * Set grpc port
- * @param port grpc server port
- * @return Builder
- */
- public Builder withPort(int port) {
- this.port = port;
- return this;
- }
-
- /**
- * Set request timeout
- * @param timeout request timeout value
- * @param timeUnit time unit
- * @return Builder
- */
- public Builder withTimeout(long timeout, TimeUnit timeUnit) {
- this.timeoutNanos = timeUnit.toNanos(timeout);
- return this;
- }
-
- /**
- * Set idle timeout
- * @param idleTimeout idle timeout by time unit
- * @param timeUnit time unit
- * @return Builder
- */
- public Builder withIdleTimeout(long idleTimeout, TimeUnit timeUnit) {
- this.idleTimeoutNanos = timeUnit.toNanos(idleTimeout);
- return this;
- }
-
- /**
- * Set keep alive time
- * @param keepAliveTime keep alive time by time unit
- * @param timeUnit time unit
- * @return Builder
- */
- public Builder withKeepAliveTimeNanos(long keepAliveTime, TimeUnit timeUnit) {
- this.keepAliveTimeNanos = timeUnit.toNanos(keepAliveTime);
- return this;
- }
-
- /**
- * Set keep alive timeout
- * @param keepAliveTimeout keep alive timeout by time unit
- * @param timeUnit time unit
- * @return Builder
- */
- public Builder withKeepAliveTimeoutNanos(long keepAliveTimeout, TimeUnit timeUnit) {
- this.keepAliveTimeoutNanos = timeUnit.toNanos(keepAliveTimeout);
- return this;
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DataType.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DataType.java
deleted file mode 100644
index 00f22a2..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DataType.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief DataType contains all data types for proxima search engine
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * DataType contains all supported data types
- */
-public enum DataType {
- /**
- * Undefined data type
- */
- UNDEFINED(0),
- /**
- * Binary data type
- */
- BINARY(1),
- /**
- * String data type
- */
- STRING(2),
- /**
- * Bool data type
- */
- BOOL(3),
- /**
- * Int32 data type
- */
- INT32(4),
- /**
- * Int64 data type
- */
- INT64(5),
- /**
- * Uint32 data type
- */
- UINT32(6),
- /**
- * Uint64 data type
- */
- UINT64(7),
- /**
- * Float data type
- */
- FLOAT(8),
- /**
- * Double data type
- */
- DOUBLE(9),
-
- /**
- * Vector binary32 data type
- */
- VECTOR_BINARY32(20),
- /**
- * Vector binary64 data type
- */
- VECTOR_BINARY64(21),
- /**
- * Vector fp16 data type
- */
- VECTOR_FP16(22),
- /**
- * Vector fp32 data type
- */
- VECTOR_FP32(23),
- /**
- * Vector double data type
- */
- VECTOR_FP64(24),
- /**
- * Vector int4 data type
- */
- VECTOR_INT4(25),
- /**
- * Vector int8 data type
- */
- VECTOR_INT8(26),
- /**
- * Vector int16 data type
- */
- VECTOR_INT16(27);
-
- private int value;
-
- DataType(int value) {
- this.value = value;
- }
-
- public int getValue() {
- return this.value;
- }
-
- public static DataType valueOf(int value) {
- switch (value) {
- case 0:
- return UNDEFINED;
- case 1:
- return BINARY;
- case 2:
- return STRING;
- case 3:
- return BOOL;
- case 4:
- return INT32;
- case 5:
- return INT64;
- case 6:
- return UINT32;
- case 7:
- return UINT64;
- case 8:
- return FLOAT;
- case 9:
- return DOUBLE;
- case 20:
- return VECTOR_BINARY32;
- case 21:
- return VECTOR_BINARY64;
- case 22:
- return VECTOR_FP16;
- case 23:
- return VECTOR_FP32;
- case 24:
- return VECTOR_FP64;
- case 25:
- return VECTOR_INT4;
- case 26:
- return VECTOR_INT8;
- case 27:
- return VECTOR_INT16;
- default:
- return UNDEFINED;
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DatabaseRepository.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DatabaseRepository.java
deleted file mode 100644
index 8f1f148..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DatabaseRepository.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief DatabaseRepository contains the database config
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Contains the database config
- */
-public class DatabaseRepository {
- private final String repositoryName;
- private final String connectionUri;
- private final String tableName;
- private final String user;
- private final String password;
-
- private DatabaseRepository(Builder builder) {
- this.repositoryName = builder.repositoryName;
- this.connectionUri = builder.connectionUri;
- this.tableName = builder.tableName;
- this.user = builder.user;
- this.password = builder.password;
- }
-
- public String getRepositoryName() {
- return repositoryName;
- }
-
- public String getConnectionUri() {
- return connectionUri;
- }
-
- public String getTableName() {
- return tableName;
- }
-
- public String getUser() {
- return user;
- }
-
- public String getPassword() {
- return password;
- }
-
- /**
- * New DatabaseRepository builde
- * @return Builder
- */
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for DatabaseRepository
- */
- public static class Builder {
- // required parameters
- private String repositoryName;
- private String connectionUri;
- private String tableName;
- private String user;
- private String password;
-
- /**
- * Empty constructor
- */
- public Builder() {
- }
-
- /**
- * Set repository name
- * @param repositoryName repository name
- * @return Builder
- */
- public Builder withRepositoryName(String repositoryName) {
- this.repositoryName = repositoryName;
- return this;
- }
-
- /**
- * Set connection uri
- * @param connectionUri connection uri
- * @return Builder
- */
- public Builder withConnectionUri(String connectionUri) {
- this.connectionUri = connectionUri;
- return this;
- }
-
- /**
- * Set table name
- * @param tableName mysql table name
- * @return Builder
- */
- public Builder withTableName(String tableName) {
- this.tableName = tableName;
- return this;
- }
-
- /**
- * Set database username
- * @param user user name
- * @return Builder
- */
- public Builder withUser(String user) {
- this.user = user;
- return this;
- }
-
- /**
- * Set database password
- * @param password myssql password
- * @return Builder
- */
- public Builder withPassword(String password) {
- this.password = password;
- return this;
- }
-
- /**
- * Build the DatabaseRepository object
- * @return DatabaseRepository
- */
- public DatabaseRepository build() {
- return new DatabaseRepository(this);
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DescribeCollectionResponse.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DescribeCollectionResponse.java
deleted file mode 100644
index 073af74..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/DescribeCollectionResponse.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Contains the specified collection info
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Contains the specified collection information
- */
-public class DescribeCollectionResponse {
- private Status status;
- private CollectionInfo collectionInfo;
-
- /**
- * Constructor with status and collection info
- * @param status request success or failed
- * @param collectionInfo collection info
- */
- public DescribeCollectionResponse(Status status, CollectionInfo collectionInfo) {
- this.status = status;
- this.collectionInfo = collectionInfo;
- }
-
- /**
- * Constructor with ErrorCode
- * @param code error code
- */
- public DescribeCollectionResponse(Status.ErrorCode code) {
- this.status = new Status(code);
- this.collectionInfo = null;
- }
-
- /**
- * Constructor with error code and reason
- * @param code error code
- * @param reason error reason
- */
- public DescribeCollectionResponse(Status.ErrorCode code, String reason) {
- this.status = new Status(code, reason);
- this.collectionInfo = null;
- }
-
- public Status getStatus() {
- return status;
- }
-
- public CollectionInfo getCollectionInfo() {
- return collectionInfo;
- }
-
- /**
- * Is response success
- * @return true means success.
- */
- public boolean ok() {
- return this.status.ok();
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/Document.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/Document.java
deleted file mode 100644
index 81d7a0b..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/Document.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Document contains the pk, score, and forward values
- */
-
-package com.alibaba.proxima.be.client;
-
-import com.alibaba.proxima.be.grpc.GenericValue;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Document information
- */
-public class Document {
- private final long primaryKey;
- private final float score;
- private final Map
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Get single document by primary key
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Get document request
- */
-public class GetDocumentRequest {
- private final String collectionName;
- private final long primaryKey;
- private boolean debugMode;
-
- private GetDocumentRequest(Builder builder) {
- this.collectionName = builder.collectionName;
- this.primaryKey = builder.primaryKey;
- this.debugMode = builder.debugMode;
- }
-
- public String getCollectionName() {
- return collectionName;
- }
-
- public long getPrimaryKey() {
- return primaryKey;
- }
-
- public boolean isDebugMode() {
- return debugMode;
- }
-
- /**
- * New GetDocumentRequest builder
- * @return Builder
- */
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for GetDocumentRequest
- */
- public static class Builder {
- // required parameters
- private String collectionName;
- private long primaryKey;
-
- // optional parameters
- private boolean debugMode = false;
-
- /**
- * Empty constructor
- */
- public Builder() {
- }
-
- /**
- * Constructor with collection name and primary key
- * @param collectionName collection name
- * @param primaryKey primary key
- */
- public Builder(String collectionName, long primaryKey) {
- this.collectionName = collectionName;
- this.primaryKey = primaryKey;
- }
-
- /**
- * Set collection name
- * @param collectionName collection name
- * @return Builder
- */
- public Builder withCollectionName(String collectionName) {
- this.collectionName = collectionName;
- return this;
- }
-
- /**
- * Set primary key
- * @param primaryKey primary key to query
- * @return Builder
- */
- public Builder withPrimaryKey(long primaryKey) {
- this.primaryKey = primaryKey;
- return this;
- }
-
- /**
- * Set debug mode
- * @param debugMode is debug mode, true means debug
- * @return Builder
- */
- public Builder withDebugMode(boolean debugMode) {
- this.debugMode = debugMode;
- return this;
- }
-
- /**
- * Build get document request object
- * @return GetDocumentRequest
- */
- public GetDocumentRequest build() {
- return new GetDocumentRequest(this);
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/GetDocumentResponse.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/GetDocumentResponse.java
deleted file mode 100644
index afa245d..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/GetDocumentResponse.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Contains document information
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * GetDocumentResponse contains document information
- */
-public class GetDocumentResponse {
- private Status status;
- private String debugInfo;
- private Document document;
-
- public GetDocumentResponse(Status.ErrorCode code) {
- this.status = new Status(code);
- this.debugInfo = null;
- this.document = null;
- }
-
- public GetDocumentResponse(Status.ErrorCode code, String reason) {
- this.status = new Status(code, reason);
- this.debugInfo = "";
- this.document = null;
- }
-
- public GetDocumentResponse(Status status, String debugInfo, Document document) {
- this.status = status;
- this.debugInfo = debugInfo;
- this.document = document;
- }
-
- public Status getStatus() {
- return status;
- }
-
- public String getDebugInfo() {
- return debugInfo;
- }
-
- public Document getDocument() {
- return document;
- }
-
- /**
- * Is response success, true means success, false means failed
- * @return boolean
- */
- public boolean ok() {
- return this.status.getCode() == 0;
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/GetVersionResponse.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/GetVersionResponse.java
deleted file mode 100644
index ea81559..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/GetVersionResponse.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Proxima Search Engine version
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Contains the server version
- */
-public class GetVersionResponse {
- Status status;
- String version;
-
- public GetVersionResponse(Status.ErrorCode errorCode) {
- this.status = new Status(errorCode);
- this.version = "";
- }
-
- public GetVersionResponse(Status.ErrorCode errorCode, String errorMsg) {
- this.status = new Status(errorCode, errorMsg);
- this.version = "";
- }
-
- public GetVersionResponse(Status status, String version) {
- this.status = status;
- this.version = version;
- }
-
- public Status getStatus() {
- return status;
- }
-
- public String getVersion() {
- return version;
- }
-
- /**
- * Is the response success
- * @return boolean
- */
- public boolean ok() {
- return this.status.ok();
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/IndexColumnParam.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/IndexColumnParam.java
deleted file mode 100644
index 364cbe1..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/IndexColumnParam.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief IndexColumnParam contains parameters for index column
- */
-
-package com.alibaba.proxima.be.client;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Contains parameters for index column
- */
-public class IndexColumnParam {
- private final String columnName;
- private final IndexType indexType;
- private final DataType dataType;
- private final int dimension;
- private final Map
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief IndexType contains all supported index types
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Contains all index types
- */
-public enum IndexType {
- /**
- * Undefined index type
- */
- UNDEFINED(0),
- /**
- * Poxima graph index type
- */
- PROXIMA_GRAPH_INDEX(1);
-
- private int value;
-
- IndexType(int value) {
- this.value = value;
- }
-
- public int getValue() {
- return value;
- }
-
- public static IndexType valueOf(int value) {
- switch (value) {
- case 0:
- return UNDEFINED;
- case 1:
- return PROXIMA_GRAPH_INDEX;
- default:
- return UNDEFINED;
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/ListCollectionsResponse.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/ListCollectionsResponse.java
deleted file mode 100644
index 3eecea8..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/ListCollectionsResponse.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief ListCollectionsResponse contains collections info and status
- */
-
-package com.alibaba.proxima.be.client;
-
-import java.util.List;
-
-/**
- * Contains collections information
- */
-public class ListCollectionsResponse {
- private Status status;
- private List
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Represents the list condition.
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * List collections condition
- */
-public class ListCondition {
- private final String repositoryName;
-
- private ListCondition(Builder builder) {
- this.repositoryName = builder.repositoryName;
- }
-
- public String getRepositoryName() {
- return repositoryName;
- }
-
- /**
- * New ListCondition builder
- * @return Builder
- */
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for ListCondition
- */
- public static class Builder {
- private String repositoryName;
-
- /**
- * Empty constructor
- */
- public Builder() {
- }
-
- /**
- * Set repository name
- * @param repositoryName repository name
- * @return Builder
- */
- public Builder withRepositoryName(String repositoryName) {
- this.repositoryName = repositoryName;
- return this;
- }
-
- /**
- * Build list condition object
- * @return ListCondition
- */
- public ListCondition build() {
- return new ListCondition(this);
- }
- }
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/LsnContext.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/LsnContext.java
deleted file mode 100644
index 0d7d42e..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/LsnContext.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Contains lsn and context infor
- */
-
-package com.alibaba.proxima.be.client;
-
-/**
- * Lsn context information
- */
-public class LsnContext {
- private long lsn;
- private String context;
-
- private LsnContext(Builder builder) {
- this.lsn = builder.lsn;
- this.context = builder.context;
- }
-
- public long getLsn() {
- return lsn;
- }
-
- public String getContext() {
- return context;
- }
-
- // New LsnContext builder
- public static Builder newBuilder() {
- return new Builder();
- }
-
- /**
- * Builder for LsnContext
- */
- public static class Builder {
- // required parameters
- private long lsn;
- private String context;
-
- public Builder() {
- }
-
- public Builder(long lsn, String context) {
- this.lsn = lsn;
- this.context = context;
- }
-
- /**
- * Set lsn number
- * @param lsn log sequence number
- * @return Builder
- */
- public Builder withLsn(long lsn) {
- this.lsn = lsn;
- return this;
- }
-
- /**
- * Set context information
- * @param context lsn context
- * @return Builder
- */
- public Builder withContext(String context) {
- this.context = context;
- return this;
- }
-
- /**
- * Build LsnContext object
- * @return LsnContext
- */
- public LsnContext build() {
- return new LsnContext(this);
- }
- }
-
-}
diff --git a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/ProtoConverter.java b/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/ProtoConverter.java
deleted file mode 100644
index b462499..0000000
--- a/proxima-be-java-sdk/src/main/java/com/alibaba/proxima/be/client/ProtoConverter.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/**
- * Copyright 2021 Alibaba, Inc. and its affiliates. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-
- *
- * \author Hongqing.hu
- * \date Mar 2021
- * \brief Convert between proto and inner struct
- */
-
-package com.alibaba.proxima.be.client;
-
-
-import com.google.protobuf.ByteString;
-import com.alibaba.proxima.be.grpc.KeyValuePair;
-import com.alibaba.proxima.be.grpc.CollectionName;
-import com.alibaba.proxima.be.grpc.OperationType;
-import com.alibaba.proxima.be.grpc.GenericKeyValue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Convert between proto object and inner object
- */
-public class ProtoConverter {
- public static com.alibaba.proxima.be.grpc.DataType toPb(DataType dataType) {
- return com.alibaba.proxima.be.grpc.DataType.forNumber(dataType.getValue());
- }
-
- public static com.alibaba.proxima.be.grpc.IndexType toPb(IndexType indexType) {
- return com.alibaba.proxima.be.grpc.IndexType.forNumber(indexType.getValue());
- }
-
- public static com.alibaba.proxima.be.grpc.CollectionConfig toPb(CollectionConfig config) {
- List