Skip to main content

GetLoadState()

This method retrieves the load status of a specified collection or partitions.

func (c *Client) GetLoadState(ctx context.Context, option GetLoadStateOption, callOptions ...grpc.CallOption) (entity.LoadState, error)

Request Parameters

Parameter

Description

Type

ctx

Context for the current call to work.

context.Context

option

Optional parameters of the methods.

GetLoadStateOption

callOptions

Optional parameters for calling the methods.

grpc.CallOption

GetLoadStateOption

This is an interface type. The getLoadStateOption struct type implements this interface type.

You can use the NewGetLoadStateOption() function to get the concrete implementation.

NewGetLoadStateOption()

The signature of this method is as follows:

func NewGetLoadStateOption(collectionName string, partitionNames ...string) *getLoadStateOption

Parameter

Description

Type

collectionName

Name of the target collection.

string

partitionNames

Names of the target partitions.

...string

entity.LoadState

The entity.LoadState struct type is as follows:

type LoadState struct {
State LoadStateCode
Progress int64
}

entity.LoadStateCode

The entity.LoadStateCode is a private enum type and has the following possible values.

const (
// LoadStateNone LoadStateCode = LoadStateCode(commonpb.LoadState)
LoadStateLoading LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateLoading)
LoadStateLoaded LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateLoaded)
LoadStateUnloading LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateNotExist)
LoadStateNotLoad LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateNotLoad)
)

Return

entity.LoadState

Example

import (
"context"
"github.com/milvus-io/milvus/client/v2/milvusclient"
)

loadState, err := cli.GetLoadState(ctx, milvusclient.NewGetLoadStateOption("customized_setup_1"))
if err != nil {
// handle err
}
fmt.Println(loadState)