componentutil

package
v0.10.3-0...-b48f531 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHealthRespWithErr

func CheckHealthRespWithErr(err error) *milvuspb.CheckHealthResponse

func CheckHealthRespWithErrMsg

func CheckHealthRespWithErrMsg(errMsg ...string) *milvuspb.CheckHealthResponse

func WaitForComponentHealthy

func WaitForComponentHealthy[T interface {
	GetComponentStates(ctx context.Context, _ *milvuspb.GetComponentStatesRequest, opts ...grpc.CallOption) (*milvuspb.ComponentStates, error)
}](ctx context.Context, client T, serviceName string, attempts uint, sleep time.Duration) error

WaitForComponentHealthy wait for component's state to be healthy

func WaitForComponentInit

func WaitForComponentInit[T interface {
	GetComponentStates(ctx context.Context, _ *milvuspb.GetComponentStatesRequest, opts ...grpc.CallOption) (*milvuspb.ComponentStates, error)
}](ctx context.Context, client T, serviceName string, attempts uint, sleep time.Duration) error

WaitForComponentInit wait for component's state to be initializing

func WaitForComponentInitOrHealthy

func WaitForComponentInitOrHealthy[T interface {
	GetComponentStates(ctx context.Context, _ *milvuspb.GetComponentStatesRequest, opts ...grpc.CallOption) (*milvuspb.ComponentStates, error)
}](ctx context.Context, client T, serviceName string, attempts uint, sleep time.Duration) error

WaitForComponentInitOrHealthy wait for component's state to be initializing or healthy

func WaitForComponentStates

func WaitForComponentStates[T interface {
	GetComponentStates(ctx context.Context, _ *milvuspb.GetComponentStatesRequest, opts ...grpc.CallOption) (*milvuspb.ComponentStates, error)
}](ctx context.Context, client T, serviceName string, states []commonpb.StateCode, attempts uint, sleep time.Duration) error

WaitForComponentStates wait for component's state to be one of the specific states

Types

type ComponentStateService

type ComponentStateService struct {
	// contains filtered or unexported fields
}

ComponentStateService is a helper type to implement a GetComponentStates rpc at server side. StandBy -> Initializing -> Healthy -> Abnormal -> Healthy All can transfer into Stopping

func NewComponentStateService

func NewComponentStateService(role string) *ComponentStateService

NewComponentStateService create a ComponentStateService

func (*ComponentStateService) GetComponentStates

GetComponentStates get the component state of a milvus node.

func (*ComponentStateService) OnAbnormal

func (s *ComponentStateService) OnAbnormal()

func (*ComponentStateService) OnHealthy

func (s *ComponentStateService) OnHealthy()

func (*ComponentStateService) OnInitialized

func (s *ComponentStateService) OnInitialized(nodeID int64)

func (*ComponentStateService) OnStopping

func (s *ComponentStateService) OnStopping()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL