Package io.milvus.param.collection
Class CreateCollectionParam.Builder
java.lang.Object
io.milvus.param.collection.CreateCollectionParam.Builder
- Enclosing class:
CreateCollectionParam
Builder for
CreateCollectionParam class.-
Method Summary
Modifier and TypeMethodDescriptionaddFieldType(@NonNull FieldType fieldType) Deprecated.build()Verifies parameters and creates a newCreateCollectionParaminstance.withCollectionName(@NonNull String collectionName) Sets the collection name.withConsistencyLevel(@NonNull ConsistencyLevelEnum consistencyLevel) Sets the consistency level.withDatabaseName(String databaseName) Sets the database name.withDescription(@NonNull String description) Sets the collection description.withEnableDynamicField(boolean enableDynamicField) Deprecated.UsewithSchema(CollectionSchemaParam)repacewithFieldTypes(@NonNull List<FieldType> fieldTypes) Deprecated.UsewithSchema(CollectionSchemaParam)repacewithPartitionsNum(int partitionsNum) Sets the partitions number if there is partition key field.withProperty(@NonNull String key, @NonNull String value) Basic method to set a key-value property.withReplicaNumber(int replicaNumber) Sets the replica number in collection level, then if load collection doesn't have replica number, it will use this replica number.withResourceGroups(@NonNull List<String> resourceGroups) Sets the resource groups in collection level, then if load collection doesn't have resource groups, it will use this resource groups.withSchema(@NonNull CollectionSchemaParam schema) Sets the schema of collection.withShardsNum(int shardsNum) Sets the shards number.
-
Method Details
-
withCollectionName
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withDatabaseName
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withShardsNum
Sets the shards number. The number must be greater or equal to zero. The default value is 0, which means letting the server decide the value. The server set this value to 1 if user didn't specify it.- Parameters:
shardsNum- shards number to distribute insert data into multiple data nodes and query nodes.- Returns:
Builder
-
withEnableDynamicField
Deprecated.UsewithSchema(CollectionSchemaParam)repaceSets the collection if enableDynamicField.- Parameters:
enableDynamicField- enableDynamicField of the collection- Returns:
Builder
-
withDescription
Sets the collection description. The description can be empty. The default is "".- Parameters:
description- description of the collection- Returns:
Builder
-
withFieldTypes
@Deprecated public CreateCollectionParam.Builder withFieldTypes(@NonNull @NonNull List<FieldType> fieldTypes) Deprecated.UsewithSchema(CollectionSchemaParam)repaceSets the schema of the collection. The schema cannot be empty or null.- Parameters:
fieldTypes- aListofFieldType- Returns:
Builder- See Also:
-
addFieldType
@Deprecated public CreateCollectionParam.Builder addFieldType(@NonNull @NonNull FieldType fieldType) Deprecated.UsewithSchema(CollectionSchemaParam)repaceAdds a field schema.- Parameters:
fieldType- aFieldTypeobject- Returns:
Builder- See Also:
-
withConsistencyLevel
public CreateCollectionParam.Builder withConsistencyLevel(@NonNull @NonNull ConsistencyLevelEnum consistencyLevel) Sets the consistency level. The default value isConsistencyLevelEnum.BOUNDED.- Parameters:
consistencyLevel- consistency level- Returns:
Builder- See Also:
-
withPartitionsNum
Sets the partitions number if there is partition key field. The number must be greater than zero. The default value is 64(defined in server side). The upper limit is 4096(defined in server side). Not allow to set this value if none of field is partition key. Only one partition key field is allowed in a collection.- Parameters:
partitionsNum- partitions number- Returns:
Builder
-
withSchema
Sets the schema of collection.- Parameters:
schema- the schema of collection- Returns:
Builder
-
withReplicaNumber
Sets the replica number in collection level, then if load collection doesn't have replica number, it will use this replica number.- Parameters:
replicaNumber- replica number- Returns:
Builder
-
withResourceGroups
public CreateCollectionParam.Builder withResourceGroups(@NonNull @NonNull List<String> resourceGroups) Sets the resource groups in collection level, then if load collection doesn't have resource groups, it will use this resource groups.- Parameters:
resourceGroups- resource group names- Returns:
Builder
-
withProperty
public CreateCollectionParam.Builder withProperty(@NonNull @NonNull String key, @NonNull @NonNull String value) Basic method to set a key-value property.- Parameters:
key- the keyvalue- the value- Returns:
Builder
-
build
Verifies parameters and creates a newCreateCollectionParaminstance.- Returns:
CreateCollectionParam- Throws:
ParamException
-
withSchema(CollectionSchemaParam)repace