Package io.milvus.param.collection

## Class LoadCollectionParam.Builder

- java.lang.Object
- - io.milvus.param.collection.LoadCollectionParam.Builder

- Enclosing class:
    LoadCollectionParam

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

  Builder for `LoadCollectionParam` class.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `LoadCollectionParam` | `build()` | Verifies parameters and creates a new `LoadCollectionParam` instance.
    `LoadCollectionParam.Builder` | `withCollectionName​(@NonNull java.lang.String collectionName)` | Sets the collection name.
    `LoadCollectionParam.Builder` | `withDatabaseName​(java.lang.String databaseName)` | Sets the database name.
    `LoadCollectionParam.Builder` | `withRefresh​(@NonNull java.lang.Boolean refresh)` | Whether to enable refresh mode.
    `LoadCollectionParam.Builder` | `withReplicaNumber​(@NonNull java.lang.Integer replicaNumber)` | Specify replica number to load, replica number must be greater than 0, default value is 1
    `LoadCollectionParam.Builder` | `withResourceGroups​(@NonNull java.util.List<java.lang.String> resourceGroups)` | Specify the target resource groups to load the replicas.
    `LoadCollectionParam.Builder` | `withSyncLoad​(@NonNull java.lang.Boolean syncLoad)` | Enable sync mode for load action.
    `LoadCollectionParam.Builder` | `withSyncLoadWaitingInterval​(@NonNull java.lang.Long milliseconds)` | Sets waiting interval in sync mode.
    `LoadCollectionParam.Builder` | `withSyncLoadWaitingTimeout​(@NonNull java.lang.Long seconds)` | Sets timeout value for the sync mode.

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

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

- - ### Method Detail

    - #### withDatabaseName

          public LoadCollectionParam.Builder withDatabaseName​(java.lang.String databaseName)

      Sets the database name. database name can be nil.
      Parameters:
        `databaseName` - database name
      Returns:
        `Builder`

    - #### withCollectionName

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

    - #### withSyncLoad

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

      Enable sync mode for load action. With sync mode enabled, the client keeps waiting until all segments of the collection successfully loaded.

      If sync mode disabled, client returns at once after the loadCollection() is called.

      Parameters:
        `syncLoad` - `Boolean.TRUE` is sync mode, Boolean.FALSE is not
      Returns:
        `Builder`

    - #### withSyncLoadWaitingInterval

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

      Sets waiting interval in sync mode. With sync mode enabled, the client will constantly check collection load state by interval. Interval must be greater than zero, and cannot be larger than Constant.MAX_WAITING_LOADING_INTERVAL.
      Parameters:
        `milliseconds` - interval
      Returns:
        `Builder`
      See Also:
        `Constant`

    - #### withSyncLoadWaitingTimeout

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

      Sets timeout value for the 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 LoadCollectionParam.Builder withReplicaNumber​(@NonNull
                                                               @NonNull java.lang.Integer replicaNumber)

      Specify replica number to load, replica number must be greater than 0, default value is 1
      Parameters:
        `replicaNumber` - replica number
      Returns:
        `Builder`

    - #### withRefresh

          public LoadCollectionParam.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 loadCollection(). After loading a collection, call loadCollection() 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 LoadCollectionParam.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 LoadCollectionParam build()
                                    throws ParamException

      Verifies parameters and creates a new `LoadCollectionParam` instance.
      Returns:
        `LoadCollectionParam`
      Throws:
        `ParamException`