milvus-logo
LFAI
< Docs
  • Java

getLoadingProgress()

A MilvusClient interface. This method gets loading collection progress.

R<GetLoadingProgressResponse> getLoadingProgress(GetLoadingProgressParam requestParam);

LoadCollectionParam

Use the GetLoadingProgressParam.Builder to construct a GetLoadingProgressParam object.

import io.milvus.param.GetLoadingProgressParam;
GetLoadingProgressParam.Builder builder = GetLoadingProgressParam.newBuilder();

Methods of GetLoadingProgressParam.Builder:

Method

Description

Parameters

withCollectionName(String collectionName)

Sets the collection name. Collection name cannot be empty or null.

collectionName: The name of the collection to load.

withDatabaseName(String databaseName)

Sets the database name. database name can be null for default database.

databaseName: The database name.

withPartitionNames(List<String> partitionNames)

Sets partition names list to specify query scope (Optional).

partitionNames:
The name list of partitions to be loaded.

build()

Constructs a LoadCollectionParam object.

N/A

withSyncLoadWaitingInterval(Long milliseconds)

Sets the waiting interval for sync mode. In sync mode, the client checks the collection load status at intervals. The value must be greater than zero, and cannot be greater than Constant.MAX_WAITING_LOADING_INTERVAL. The default value is 500 milliseconds

milliseconds: The time interval in milliseconds for checking the data load status.

withSyncLoadWaitingTimeout(Long seconds)

Sets the timeout period for sync mode. The value must be greater than zero and cannot be greater than Constant.MAX_WAITING_LOADING_TIMEOUT. The default value is 60 seconds.

seconds: A during of time in seconds to wait till timeout.

withReplicaNumber(Integer replicaNumber)

Specifies the number of replicas to load. The default value is 1.

replicaNumber: The number of the replicas to load when loading a collection.

build()

Constructs a LoadCollectionParam object

N/A

The GetLoadingProgressParam.Builder.build() can throw the following exceptions:

  • ParamException: error if the parameter is invalid.

Returns

This method catches all the exceptions and returns an R<GetLoadingProgressResponse> object.

  • If the API fails on the server side, it returns the error code and message from the server.

  • If the API fails by RPC exception, it returns R.Status.Unknown and the error message of the exception.

  • If the API succeeds, it returns R.Status.Success.

Example

import io.milvus.param.*;

GetLoadingProgressParam param = GetLoadingProgressParam.newBuilder()
        .withCollectionName(COLLECTION_NAME)
        .build();
R<GetLoadingProgressResponse> response = client.getLoadingProgress(param);
if (response.getStatus() != R.Status.Success.getCode()) {
    System.out.println(response.getMessage());
}
System.out.println(response.getProgress());
Feedback

Was this page helpful?