io.milvus.param.partition

## Class LoadPartitionsParam.Builder

- java.lang.Object
- - io.milvus.param.partition.LoadPartitionsParam.Builder

Enclosing class:
  LoadPartitionsParam

    public static final class LoadPartitionsParam.Builder
    extends java.lang.Object

Builder for `LoadPartitionsParam` class.

### Method Summary

All Methods Instance Methods Concrete Methods
`LoadPartitionsParam.Builder` `addPartitionName(@NonNull java.lang.String partitionName)` Adds a partition by name.
`LoadPartitionsParam` `build()` Verifies parameters and creates a new `LoadPartitionsParam` instance.
`LoadPartitionsParam.Builder` `withCollectionName(@NonNull java.lang.String collectionName)` Sets the collection name.
`LoadPartitionsParam.Builder` `withDatabaseName(java.lang.String databaseName)` Sets the database name.
`LoadPartitionsParam.Builder` `withPartitionNames(@NonNull java.util.List<java.lang.String> partitionNames)` Sets the partition names list.
`LoadPartitionsParam.Builder` `withRefresh(@NonNull java.lang.Boolean refresh)` Whether to enable refresh mode.
`LoadPartitionsParam.Builder` `withReplicaNumber(@NonNull java.lang.Integer replicaNumber)` Specify replica number to load
`LoadPartitionsParam.Builder` `withResourceGroups(@NonNull java.util.List<java.lang.String> resourceGroups)` Specify the target resource groups to load the replicas.
`LoadPartitionsParam.Builder` `withSyncLoad(@NonNull java.lang.Boolean syncLoad)` Enables sync mode for load action.
`LoadPartitionsParam.Builder` `withSyncLoadWaitingInterval(@NonNull java.lang.Long milliseconds)` Sets the waiting interval for sync mode.
`LoadPartitionsParam.Builder` `withSyncLoadWaitingTimeout(@NonNull java.lang.Long seconds)` Sets the timeout value for sync mode.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### withDatabaseName

    public LoadPartitionsParam.Builder withDatabaseName(java.lang.String databaseName)

Sets the database name. database name can be nil.

Parameters:
  `databaseName` - database name
Returns:
  `Builder`

#### withCollectionName

    public LoadPartitionsParam.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`

#### withPartitionNames

    public LoadPartitionsParam.Builder withPartitionNames(@NonNull
                                                          @NonNull java.util.List<java.lang.String> partitionNames)

Sets the partition names list. Partition names list cannot be null or empty.

Parameters:
  `partitionNames` - partition names list
Returns:
  `Builder`

#### addPartitionName

    public LoadPartitionsParam.Builder addPartitionName(@NonNull
                                                        @NonNull java.lang.String partitionName)

Adds a partition by name. Partition name cannot be empty or null.

Parameters:
  `partitionName` - partition name
Returns:
  `Builder`

#### withSyncLoad

    public LoadPartitionsParam.Builder withSyncLoad(@NonNull
                                                    @NonNull java.lang.Boolean syncLoad)

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.TRUE` is sync mode, Boolean.FALSE is not
Returns:
  `Builder`

#### withSyncLoadWaitingInterval

    public LoadPartitionsParam.Builder withSyncLoadWaitingInterval(@NonNull
                                                                   @NonNull java.lang.Long milliseconds)

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:
  `Constant`

#### withSyncLoadWaitingTimeout

    public LoadPartitionsParam.Builder withSyncLoadWaitingTimeout(@NonNull
                                                                  @NonNull java.lang.Long seconds)

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:
  `Constant`

#### withReplicaNumber

    public LoadPartitionsParam.Builder withReplicaNumber(@NonNull
                                                         @NonNull java.lang.Integer replicaNumber)

Specify replica number to load

Parameters:
  `replicaNumber` - replica number
Returns:
  `Builder`

#### withRefresh

    public LoadPartitionsParam.Builder withRefresh(@NonNull
                                                   @NonNull java.lang.Boolean refresh)

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.TRUE` is refresh mode, `Boolean.FALSE` is not
Returns:
  `Builder`

#### withResourceGroups

    public LoadPartitionsParam.Builder withResourceGroups(@NonNull
                                                          @NonNull java.util.List<java.lang.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` - a `List` of `String`
Returns:
  `Builder`

#### build

    public LoadPartitionsParam build()
                              throws ParamException

Verifies parameters and creates a new `LoadPartitionsParam` instance.

Returns:
  `LoadPartitionsParam`
Throws:
  `ParamException`