public class Validator extends Object
| 构造器和说明 |
|---|
Validator() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
verifyBachSize(List<Doc> docs)
Verify bach size
|
static void |
verifyCollectionName(@NonNull String name)
Verify DashVectorCollection Name
|
static void |
verifyDimension(int dimension)
Verify DashVectorCollection dimension
|
static void |
verifyDocId(@NonNull String id)
Verify Doc id
|
static void |
verifyDocIdList(List<String> docIds)
Verify DocId List
|
static void |
verifyDocList(List<Doc> docs)
Verify Doc List
|
static void |
verifyDocParam(@NonNull WriteDocRequest<? extends com.google.protobuf.Message> writeDocRequest,
@NonNull CollectionMeta collectionMeta)
Verify Model DocParam
|
static boolean |
verifyEndpoint(@NonNull String endpoint) |
static void |
verifyFields(Map<String,?> fieldsSchema)
Verify DashVectorCollection filedsSchema
|
static void |
verifyFilter(String filter)
Verify Filter
|
static void |
verifyOutputFields(List<String> outputFields)
Verify outputFields
|
static void |
verifyPartitionName(@NonNull String name)
Verify Partition Name
|
static void |
verifyQueryParma(@NonNull QueryDocRequest queryDocRequest,
@NonNull CollectionMeta collectionMeta)
Verify Model QueryDocRequest
|
static void |
verifyRequestSize(@NonNull com.google.protobuf.Message message)
Verify request size
|
static void |
verifyTopK(int topk)
Verify topk
|
static void |
verifyVectorType(List<? extends Number> vector)
Verify Doc Vector Type
|
public static void verifyRequestSize(@NonNull
@NonNull com.google.protobuf.Message message)
throws DashVectorException
message - MessageDashVectorException - When message size greater then 2MiBpublic static void verifyDocId(@NonNull
@NonNull String id)
throws DashVectorException
id - the id of DocDashVectorException - When id violates naming constraintspublic static void verifyOutputFields(List<String> outputFields) throws DashVectorException
outputFields - the list of output fieldDashVectorException - When field of outputFields violates naming constraintspublic static void verifyTopK(int topk)
throws DashVectorException
topk - the topk of QueryDocRequestDashVectorException - When topk not in [1,1024]public static void verifyBachSize(List<Doc> docs) throws DashVectorException
docs - the list of DocDashVectorException - When bach size not in [1,1024]public static void verifyVectorType(List<? extends Number> vector) throws DashVectorException
vector - VectorDashVectorException - When vector is null or vector type not in [float, int]public static void verifyCollectionName(@NonNull
@NonNull String name)
throws DashVectorException
name - the collection nameDashVectorException - When the collection name violates naming constraintspublic static void verifyPartitionName(@NonNull
@NonNull String name)
throws DashVectorException
name - the partition nameDashVectorException - When the partition name violates naming constraintspublic static void verifyDimension(int dimension)
throws DashVectorException
dimension - the dimensionDashVectorException - When the dimension not in [1,1024]public static void verifyFields(Map<String,?> fieldsSchema) throws DashVectorException
fieldsSchema - the filedsSchema of CollectionDashVectorException - When filedsSchema is null or its size not in [1,1024]public static void verifyFilter(String filter) throws DashVectorException
filter - the filter of QueryDashVectorException - When filter violates naming constraintspublic static void verifyDocIdList(List<String> docIds) throws DashVectorException
docIds - the list of id which from DocDashVectorException - When docids size not in [1,1024]public static void verifyDocList(List<Doc> docs) throws DashVectorException
docs - the list of DocDashVectorException - When docs is null or doc field is abnormalpublic static void verifyDocParam(@NonNull
@NonNull WriteDocRequest<? extends com.google.protobuf.Message> writeDocRequest,
@NonNull
@NonNull CollectionMeta collectionMeta)
throws DashVectorException
writeDocRequest - WriteDocRequestcollectionMeta - CollectionMetaDashVectorException - When dimension mismatch, metric mismatch or invalid sparse vectorpublic static void verifyQueryParma(@NonNull
@NonNull QueryDocRequest queryDocRequest,
@NonNull
@NonNull CollectionMeta collectionMeta)
throws DashVectorException
queryDocRequest - QueryDocRequestcollectionMeta - CollectionMetaDashVectorException - When dimension mismatch, metric mismatch or invalid sparse vectorpublic static boolean verifyEndpoint(@NonNull
@NonNull String endpoint)
Copyright © 2023. All rights reserved.