Skip to main content

GetLoadState()

This method displays the load status of a specific collection or its partitions.

func (c *GrpcClient) GetLoadState(ctx context.Context, collName string, partitionNames []string) (entity.LoadState, error)

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

collName

Name of a collection

string

partitionNames

List of partition names.

If left empty, all partitions are involved in this operation. Otherwise, only the specified partitions are involved.

[]string

Return

An entity.LoadState or an error.

entity.LoadState

This int32 type offers the numeric representation of all possible load states.

const (
LoadStateNotExist LoadState = 0
LoadStateNotLoad LoadState = 1
LoadStateLoading LoadState = 2
LoadStateLoaded LoadState = 3
)

Errors

Any error in the execution of the request. Possible errors are as follows:

  • ErrClientNotReady: The client is not connected to Milvus.

  • ErrCollectionNotExists: The collection with the specified name does not exist.

  • The call to this API fails.

Example

errLoad := mc.LoadCollection(context.Background(), collectionName, true)
if errLoad != nil {
log.Fatal("failed to load collection:", errLoad.Error())
}
// get load state
stateLoad, errState := mc.GetLoadState(context.Background(), collectionName, []string{})
if errState != nil {
log.Fatal("failed to get load state:", errState.Error())
}
log.Println(stateLoad)