milvus-logo
LFAI
< Docs
  • Java

getLoadState()

A MilvusClient interface. This method gets the state of loading collection progress.

R<GetLoadStateResponse> getLoadState(GetLoadStateParam requestParam);

GetLoadStateParam

Use the GetLoadStateParam.Builder to construct a GetLoadStateParam object.

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

Methods of GetLoadStateParam.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 get state.

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:
A name list of partition to get state.

addPartitionName(String partitionName)

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

partitionName: A partition name.

build()

Constructs a GetLoadStateParam object.

N/A

The GetLoadStateParam.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<GetLoadStateResponse> 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.*;

GetLoadStateParam param = GetLoadStateParam.newBuilder()
        .withCollectionName(COLLECTION_NAME)
        .build();
R<GetLoadStateResponse> response = client.getLoadState(param);
if (response.getStatus() != R.Status.Success.getCode()) {
    System.out.println(response.getMessage());
}
System.out.println(response.getState());

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?