Package io.milvus.param.partition
Class LoadPartitionsParam.Builder
java.lang.Object
io.milvus.param.partition.LoadPartitionsParam.Builder
- Enclosing class:
LoadPartitionsParam
Builder for
LoadPartitionsParam class.-
Method Summary
Modifier and TypeMethodDescriptionaddPartitionName(@NonNull String partitionName) Adds a partition by name.build()Verifies parameters and creates a newLoadPartitionsParaminstance.withCollectionName(@NonNull String collectionName) Sets the collection name.withDatabaseName(String databaseName) Sets the database name.withPartitionNames(@NonNull List<String> partitionNames) Sets the partition names list.withRefresh(@NonNull Boolean refresh) Whether to enable refresh mode.withReplicaNumber(@NonNull Integer replicaNumber) Specify replica number to loadwithResourceGroups(@NonNull List<String> resourceGroups) Specify the target resource groups to load the replicas.withSyncLoad(@NonNull Boolean syncLoad) Enables sync mode for load action.withSyncLoadWaitingInterval(@NonNull Long milliseconds) Sets the waiting interval for sync mode.withSyncLoadWaitingTimeout(@NonNull Long seconds) Sets the timeout value for sync mode.
-
Method Details
-
withDatabaseName
Sets the database name. database name can be nil.- Parameters:
databaseName- database name- Returns:
Builder
-
withCollectionName
Sets the collection name. Collection name cannot be empty or null.- Parameters:
collectionName- collection name- Returns:
Builder
-
withPartitionNames
public LoadPartitionsParam.Builder withPartitionNames(@NonNull @NonNull List<String> partitionNames) Sets the partition names list. Partition names list cannot be null or empty.- Parameters:
partitionNames- partition names list- Returns:
Builder
-
addPartitionName
Adds a partition by name. Partition name cannot be empty or null.- Parameters:
partitionName- partition name- Returns:
Builder
-
withSyncLoad
Enables sync mode for load action. With sync mode enabled, the client keeps waiting until all segments of the partition are successfully loaded.Without sync mode disabled, client returns at once after the loadPartitions() is called.
- Parameters:
syncLoad-Boolean.TRUEis sync mode, Boolean.FALSE is not- Returns:
Builder
-
withSyncLoadWaitingInterval
Sets the waiting interval for sync mode. In sync mode, the client constantly checks partition load state by interval. Interval must be greater than zero, and cannot be greater than Constant.MAX_WAITING_LOADING_INTERVAL.- Parameters:
milliseconds- interval- Returns:
Builder- See Also:
-
withSyncLoadWaitingTimeout
Sets the timeout value for sync mode. Timeout value must be greater than zero, and cannot be greater than Constant.MAX_WAITING_LOADING_TIMEOUT.- Parameters:
seconds- time out value for sync mode- Returns:
Builder- See Also:
-
withReplicaNumber
Specify replica number to load- Parameters:
replicaNumber- replica number- Returns:
Builder
-
withRefresh
Whether to enable refresh mode. Refresh mode renews the segment list of this collection before loading. This flag must be set to FALSE when first time call the loadPartitions(). After loading a collection, call loadPartitions() again with refresh=TRUE, the server will look for new segments that are not loaded yet and tries to load them up.- Parameters:
refresh-Boolean.TRUEis refresh mode,Boolean.FALSEis not- Returns:
Builder
-
withResourceGroups
public LoadPartitionsParam.Builder withResourceGroups(@NonNull @NonNull List<String> resourceGroups) Specify the target resource groups to load the replicas. If not specified, the replicas will be loaded into the default resource group.- Parameters:
resourceGroups- aListofString- Returns:
Builder
-
build
Verifies parameters and creates a newLoadPartitionsParaminstance.- Returns:
LoadPartitionsParam- Throws:
ParamException
-