Package io.milvus.param.collection
Class CreateCollectionParam.Builder
- java.lang.Object
-
- io.milvus.param.collection.CreateCollectionParam.Builder
-
- Enclosing class:
- CreateCollectionParam
public static final class CreateCollectionParam.Builder extends java.lang.Object
Builder forCreateCollectionParam
class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateCollectionParam.Builder
addFieldType(@NonNull FieldType fieldType)
Adds a field schema.CreateCollectionParam
build()
Verifies parameters and creates a newCreateCollectionParam
instance.CreateCollectionParam.Builder
withCollectionName(@NonNull java.lang.String collectionName)
Sets the collection name.CreateCollectionParam.Builder
withDescription(@NonNull java.lang.String description)
Sets the collection description.CreateCollectionParam.Builder
withFieldTypes(@NonNull java.util.List<FieldType> fieldTypes)
Sets the schema of the collection.CreateCollectionParam.Builder
withShardsNum(int shardsNum)
Sets the shards number.
-
-
-
Method Detail
-
withCollectionName
public CreateCollectionParam.Builder withCollectionName(@NonNull @NonNull java.lang.String collectionName)
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName
- collection name- Returns:
Builder
-
withShardsNum
public CreateCollectionParam.Builder withShardsNum(int shardsNum)
Sets the shards number. The number must be greater than zero. The default value is 2.- Parameters:
shardsNum
- shards number to distribute insert data into multiple data nodes and query nodes.- Returns:
Builder
-
withDescription
public CreateCollectionParam.Builder withDescription(@NonNull @NonNull java.lang.String description)
Sets the collection description. The description can be empty. The default is "".- Parameters:
description
- description of the collection- Returns:
Builder
-
withFieldTypes
public CreateCollectionParam.Builder withFieldTypes(@NonNull @NonNull java.util.List<FieldType> fieldTypes)
Sets the schema of the collection. The schema cannot be empty or null.
-
addFieldType
public CreateCollectionParam.Builder addFieldType(@NonNull @NonNull FieldType fieldType)
Adds a field schema.
-
build
public CreateCollectionParam build() throws ParamException
Verifies parameters and creates a newCreateCollectionParam
instance.- Returns:
CreateCollectionParam
- Throws:
ParamException
-
-