public class Validator extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
MAX_VECTORS_COUNT |
static String |
RESERVE_DENSE_VECTOR |
static String |
RESERVE_DENSE_VECTOR_MSG |
static String |
RESERVE_SPARSE_VECTOR |
static String |
RESERVE_SPARSE_VECTOR_MSG |
| 构造器和说明 |
|---|
Validator() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
verifyArrayFieldsValue(String fieldName,
FieldType fieldType,
Object fieldValue,
Class<?> cls) |
static void |
verifyBatchSize(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(String id) |
static void |
verifyDocIdList(List<String> docIds)
Verify DocId List
|
static void |
verifyDocIdRequireNonEmpty(@NonNull String id)
Verify Doc id
|
static boolean |
verifyEndpoint(@NonNull String endpoint)
endpoint域名检查
|
static void |
verifyFields(Map<String,?> fieldsMap)
Verify DashVectorCollection field schema/data_map
|
static void |
verifyFieldsValue(Map<String,?> fieldsMap,
Map<String,FieldType> fieldsScheme) |
static void |
verifyFilter(String filter)
Verify Filter
|
static void |
verifyGroupByField(String groupByField)
Verify groupByField
|
static void |
verifyGroupCount(int groupCount,
boolean includeVector)
Verify groupCount
|
static void |
verifyGroupTopK(int groupTopK,
boolean includeVector)
Verify groupTopk
|
static void |
verifyIndex(Map<String,Index> indexes,
Map<String,FieldType> filedsSchema) |
static void |
verifyOrderByFields(List<OrderByField> orderByFields)
Verify orderByFields
|
static void |
verifyOutputFields(List<String> outputFields)
Verify outputFields
|
static void |
verifyPartitionName(@NonNull String name)
Verify Partition Name
|
static void |
verifyRequestSize(@NonNull com.google.protobuf.Message message)
Verify request size
|
static void |
verifyScalarFieldsValue(String fieldName,
FieldType fieldType,
Object fieldValue,
Class<?> cls) |
static void |
verifySparseVector(Map<Long,Float> sparseVector,
@NonNull CollectionMeta collectionMeta) |
static void |
verifySparseVector(String sparseVectorName,
Map<Long,Float> sparseVector,
@NonNull CollectionMeta collectionMeta) |
static void |
verifyTopK(int topk,
boolean includeVector)
Verify topk
|
static void |
verifyVector(Vector vector,
DocOpResult.DocOp docOp,
int dimension) |
static void |
verifyVectorCount(int size) |
static void |
verifyVectorNameAndCount(Map<String,?> vectors) |
static void |
verifyVectorParam(VectorParam param) |
public static final String RESERVE_DENSE_VECTOR_MSG
public static final String RESERVE_SPARSE_VECTOR_MSG
public static final int MAX_VECTORS_COUNT
public static void verifyRequestSize(@NonNull
@NonNull com.google.protobuf.Message message)
throws DashVectorException
message - MessageDashVectorException - When message size greater then 2MiBpublic static void verifyDocIdRequireNonEmpty(@NonNull
@NonNull String id)
throws DashVectorException
id - the id of DocDashVectorException - When id violates naming constraintspublic static void verifyDocId(String id) throws DashVectorException
public 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,
boolean includeVector)
throws DashVectorException
topk - the topk of QueryDocRequestDashVectorException - When topk not in [1,1024]public static void verifyGroupTopK(int groupTopK,
boolean includeVector)
throws DashVectorException
groupTopK - the groupCount of QueryDocGroupByRequestDashVectorException - When groupCount not in [1,1024]public static void verifyGroupCount(int groupCount,
boolean includeVector)
throws DashVectorException
groupCount - the groupCount of QueryDocGroupByRequestDashVectorException - When groupCount not in [1,64]public static void verifyGroupByField(String groupByField) throws DashVectorException
groupByField - the groupByField of QueryDocGroupByRequestDashVectorException - When groupByField is emptypublic static void verifyBatchSize(List<Doc> docs) throws DashVectorException
docs - the list of DocDashVectorException - When bach size not in [1,1024]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,?> fieldsMap) throws DashVectorException
fieldsMap - the field schema/data_map of CollectionDashVectorException - When fieldsMap is null or its size not in [1,1024]public static void verifyScalarFieldsValue(String fieldName, FieldType fieldType, Object fieldValue, Class<?> cls) throws DashVectorException
public static void verifyArrayFieldsValue(String fieldName, FieldType fieldType, Object fieldValue, Class<?> cls) throws DashVectorException
public static void verifyFieldsValue(Map<String,?> fieldsMap, Map<String,FieldType> fieldsScheme) throws DashVectorException
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 verifyVector(Vector vector, DocOpResult.DocOp docOp, int dimension)
public static void verifySparseVector(Map<Long,Float> sparseVector, @NonNull @NonNull CollectionMeta collectionMeta)
public static void verifySparseVector(String sparseVectorName, Map<Long,Float> sparseVector, @NonNull @NonNull CollectionMeta collectionMeta)
public static boolean verifyEndpoint(@NonNull
@NonNull String endpoint)
endpoint - dashvector service endpointpublic static void verifyVectorParam(VectorParam param)
public static void verifyVectorCount(int size)
public static void verifyIndex(Map<String,Index> indexes, Map<String,FieldType> filedsSchema)
public static void verifyOrderByFields(List<OrderByField> orderByFields) throws DashVectorException
orderByFields - the list of output fieldDashVectorExceptionCopyright © 2026. All rights reserved.