scale

package
v0.22.0-dev.4 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KafkaBrokerAlive    = types.BrokerStateAlive
	KafkaBrokerDead     = types.BrokerStateDead
	KafkaBrokerNew      = types.BrokerStateNew
	KafkaBrokerDemoted  = types.BrokerStateDemoted
	KafkaBrokerBadDisks = types.BrokerStateBadDisks
)

Variables

This section is empty.

Functions

func CruiseControlURL added in v0.21.0

func CruiseControlURL(namespace, domain, endpoint, name string) string

func CruiseControlURLFromKafkaCluster added in v0.21.0

func CruiseControlURLFromKafkaCluster(instance *v1beta1.KafkaCluster) string

func MockNewCruiseControlScaler

func MockNewCruiseControlScaler()

Types

type CruiseControlScaler

type CruiseControlScaler interface {
	IsReady() bool
	Status() CruiseControlStatus
	GetUserTasks(taskIDs ...string) ([]*Result, error)
	IsUp() bool
	AddBrokers(brokerIDs ...string) (*Result, error)
	RemoveBrokers(brokerIDs ...string) (*Result, error)
	RebalanceDisks(brokerIDs ...string) (*Result, error)
	BrokersWithState(states ...KafkaBrokerState) ([]string, error)
	PartitionReplicasByBroker() (map[string]int32, error)
	BrokerWithLeastPartitionReplicas() (string, error)
	LogDirsByBroker() (map[string]map[LogDirState][]string, error)
}

func NewCruiseControlScaler

func NewCruiseControlScaler(ctx context.Context, serverURL string) (CruiseControlScaler, error)

type CruiseControlStatus added in v0.21.0

type CruiseControlStatus struct {
	MonitorReady  bool
	ExecutorReady bool
	AnalyzerReady bool
	ProposalReady bool
	GoalsReady    bool

	MonitoredWindows   float32
	MonitoringCoverage float64
}

CruiseControlStatus struct is used to describe internal state of Cruise Control.

func (CruiseControlStatus) InExecution added in v0.21.0

func (s CruiseControlStatus) InExecution() bool

InExecution returns true if the Executor component of Cruise Control is performing an operation which means that new operations cannot be started until the current has finished or the forced to be terminated.

func (CruiseControlStatus) IsReady added in v0.21.0

func (s CruiseControlStatus) IsReady() bool

IsReady returns true if the Analyzer and Monitor components of Cruise Control are in ready state.

type KafkaBrokerState added in v0.21.0

type KafkaBrokerState = types.BrokerState

type LogDirState added in v0.21.0

type LogDirState int8
const (
	LogDirStateOnline LogDirState = iota
	LogDirStateOffline
)

type Result added in v0.21.0

type Result struct {
	TaskID    string
	StartedAt string
	State     v1beta1.CruiseControlUserTaskState
	Err       string
}

Jump to

Keyboard shortcuts

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