Package io.milvus.param
Class ParamUtils
java.lang.Object
io.milvus.param.ParamUtils
Utility functions for param classes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<KeyValuePair> AssembleKvPair(Map<String, String> sourceMap) static voidcheckFieldData(FieldType fieldSchema, InsertParam.Field fieldData) static voidcheckFieldData(FieldType fieldSchema, List<?> values, boolean verifyElementType) static ObjectcheckFieldValue(FieldType fieldSchema, com.google.gson.JsonElement value) static voidCheckNullEmptyString(String target, String name) Checks if a string is empty or null.static voidCheckNullString(String target, String name) Checks if a string is null.static SearchRequestconvertAnnSearchParam(@NonNull AnnSearchParam annSearchParam, ConsistencyLevelEnum consistencyLevel) static FieldTypeConvertField(@NonNull FieldSchema field) Convert a grpc field schema to client field schemastatic FieldSchemaConvertField(@NonNull FieldType field) Convert a client field schema to grpc field schemastatic HybridSearchRequestconvertHybridSearchParam(@NonNull HybridSearchParam requestParam) convertJsonArray(com.google.gson.JsonArray jsonArray, DataType elementType, String fieldName) static com.google.protobuf.ByteStringconvertPlaceholder(List<?> vectors, PlaceholderType placeType) static QueryRequestconvertQueryParam(@NonNull QueryParam requestParam) static SearchRequestconvertSearchParam(@NonNull SearchParam requestParam) static ByteBufferencodeSparseFloatVector(SortedMap<Long, Float> sparse) static FieldDatagenFieldData(FieldType fieldType, List<?> objects) static FieldDatagenFieldData(FieldType fieldType, List<?> objects, boolean isDynamic) static booleanisVectorDataType(DataType dataType)
-
Constructor Details
-
ParamUtils
public ParamUtils()
-
-
Method Details
-
checkFieldData
-
checkFieldData
-
checkFieldValue
-
convertJsonArray
-
CheckNullEmptyString
Checks if a string is empty or null. ThrowsParamExceptionif the string is empty of null.- Parameters:
target- target stringname- a name to describe this string- Throws:
ParamException
-
CheckNullString
Checks if a string is null. ThrowsParamExceptionif the string is null.- Parameters:
target- target stringname- a name to describe this string- Throws:
ParamException
-
convertPlaceholder
public static com.google.protobuf.ByteString convertPlaceholder(List<?> vectors, PlaceholderType placeType) throws ParamException - Throws:
ParamException
-
convertSearchParam
public static SearchRequest convertSearchParam(@NonNull @NonNull SearchParam requestParam) throws ParamException - Throws:
ParamException
-
convertAnnSearchParam
public static SearchRequest convertAnnSearchParam(@NonNull @NonNull AnnSearchParam annSearchParam, ConsistencyLevelEnum consistencyLevel) -
convertHybridSearchParam
public static HybridSearchRequest convertHybridSearchParam(@NonNull @NonNull HybridSearchParam requestParam) throws ParamException - Throws:
ParamException
-
convertQueryParam
-
isVectorDataType
-
genFieldData
-
genFieldData
-
encodeSparseFloatVector
-
decodeSparseFloatVector
-
ConvertField
Convert a grpc field schema to client field schema- Parameters:
field- FieldSchema object- Returns:
FieldTypeschema of the field
-
ConvertField
Convert a client field schema to grpc field schema- Parameters:
field-FieldTypeobject- Returns:
FieldSchemaschema of the field
-
AssembleKvPair
-