scale

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 14 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 ScaleFactoryFn added in v0.22.0

func ScaleFactoryFn() func(ctx context.Context, kafkaCluster *v1beta1.KafkaCluster) (CruiseControlScaler, error)

Types

type CruiseControlScaler

type CruiseControlScaler interface {
	IsReady() bool
	Status() (CruiseControlStatus, error)
	UserTasks(taskIDs ...string) ([]*Result, error)
	IsUp() bool
	AddBrokers(brokerIDs ...string) (*Result, error)
	AddBrokersWithParams(params map[string]string) (*Result, error)
	RemoveBrokersWithParams(params map[string]string) (*Result, error)
	RebalanceWithParams(params map[string]string) (*Result, error)
	StopExecution() (*Result, error)
	RemoveBrokers(brokerIDs ...string) (*Result, error)
	RebalanceDisks(brokerIDs ...string) (*Result, error)
	BrokersWithState(states ...KafkaBrokerState) ([]string, error)
	KafkaClusterState() (*types.KafkaClusterState, error)
	PartitionReplicasByBroker() (map[string]int32, error)
	BrokerWithLeastPartitionReplicas() (string, error)
	LogDirsByBroker() (map[string]map[LogDirState][]string, error)
	KafkaClusterLoad() (*api.KafkaClusterLoadResponse, 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 MockCruiseControlScaler added in v0.22.0

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

MockCruiseControlScaler is a mock of CruiseControlScaler interface.

func NewMockCruiseControlScaler added in v0.22.0

func NewMockCruiseControlScaler(ctrl *gomock.Controller) *MockCruiseControlScaler

NewMockCruiseControlScaler creates a new mock instance.

func (*MockCruiseControlScaler) AddBrokers added in v0.22.0

func (m *MockCruiseControlScaler) AddBrokers(arg0 ...string) (*Result, error)

AddBrokers mocks base method.

func (*MockCruiseControlScaler) AddBrokersWithParams added in v0.22.0

func (m *MockCruiseControlScaler) AddBrokersWithParams(arg0 map[string]string) (*Result, error)

AddBrokersWithParams mocks base method.

func (*MockCruiseControlScaler) BrokerWithLeastPartitionReplicas added in v0.22.0

func (m *MockCruiseControlScaler) BrokerWithLeastPartitionReplicas() (string, error)

BrokerWithLeastPartitionReplicas mocks base method.

func (*MockCruiseControlScaler) BrokersWithState added in v0.22.0

func (m *MockCruiseControlScaler) BrokersWithState(arg0 ...types.BrokerState) ([]string, error)

BrokersWithState mocks base method.

func (*MockCruiseControlScaler) EXPECT added in v0.22.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCruiseControlScaler) IsReady added in v0.22.0

func (m *MockCruiseControlScaler) IsReady() bool

IsReady mocks base method.

func (*MockCruiseControlScaler) IsUp added in v0.22.0

func (m *MockCruiseControlScaler) IsUp() bool

IsUp mocks base method.

func (*MockCruiseControlScaler) KafkaClusterLoad added in v0.22.0

func (m *MockCruiseControlScaler) KafkaClusterLoad() (*api.KafkaClusterLoadResponse, error)

KafkaClusterLoad mocks base method.

func (*MockCruiseControlScaler) KafkaClusterState added in v0.22.0

func (m *MockCruiseControlScaler) KafkaClusterState() (*types.KafkaClusterState, error)

KafkaClusterState mocks base method.

func (*MockCruiseControlScaler) LogDirsByBroker added in v0.22.0

func (m *MockCruiseControlScaler) LogDirsByBroker() (map[string]map[LogDirState][]string, error)

LogDirsByBroker mocks base method.

func (*MockCruiseControlScaler) PartitionReplicasByBroker added in v0.22.0

func (m *MockCruiseControlScaler) PartitionReplicasByBroker() (map[string]int32, error)

PartitionReplicasByBroker mocks base method.

func (*MockCruiseControlScaler) RebalanceDisks added in v0.22.0

func (m *MockCruiseControlScaler) RebalanceDisks(arg0 ...string) (*Result, error)

RebalanceDisks mocks base method.

func (*MockCruiseControlScaler) RebalanceWithParams added in v0.22.0

func (m *MockCruiseControlScaler) RebalanceWithParams(arg0 map[string]string) (*Result, error)

RebalanceWithParams mocks base method.

func (*MockCruiseControlScaler) RemoveBrokers added in v0.22.0

func (m *MockCruiseControlScaler) RemoveBrokers(arg0 ...string) (*Result, error)

RemoveBrokers mocks base method.

func (*MockCruiseControlScaler) RemoveBrokersWithParams added in v0.22.0

func (m *MockCruiseControlScaler) RemoveBrokersWithParams(arg0 map[string]string) (*Result, error)

RemoveBrokersWithParams mocks base method.

func (*MockCruiseControlScaler) Status added in v0.22.0

Status mocks base method.

func (*MockCruiseControlScaler) StopExecution added in v0.22.0

func (m *MockCruiseControlScaler) StopExecution() (*Result, error)

StopExecution mocks base method.

func (*MockCruiseControlScaler) UserTasks added in v0.22.0

func (m *MockCruiseControlScaler) UserTasks(arg0 ...string) ([]*Result, error)

UserTasks mocks base method.

type MockCruiseControlScalerMockRecorder added in v0.22.0

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

MockCruiseControlScalerMockRecorder is the mock recorder for MockCruiseControlScaler.

func (*MockCruiseControlScalerMockRecorder) AddBrokers added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) AddBrokers(arg0 ...interface{}) *gomock.Call

AddBrokers indicates an expected call of AddBrokers.

func (*MockCruiseControlScalerMockRecorder) AddBrokersWithParams added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) AddBrokersWithParams(arg0 interface{}) *gomock.Call

AddBrokersWithParams indicates an expected call of AddBrokersWithParams.

func (*MockCruiseControlScalerMockRecorder) BrokerWithLeastPartitionReplicas added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) BrokerWithLeastPartitionReplicas() *gomock.Call

BrokerWithLeastPartitionReplicas indicates an expected call of BrokerWithLeastPartitionReplicas.

func (*MockCruiseControlScalerMockRecorder) BrokersWithState added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) BrokersWithState(arg0 ...interface{}) *gomock.Call

BrokersWithState indicates an expected call of BrokersWithState.

func (*MockCruiseControlScalerMockRecorder) IsReady added in v0.22.0

IsReady indicates an expected call of IsReady.

func (*MockCruiseControlScalerMockRecorder) IsUp added in v0.22.0

IsUp indicates an expected call of IsUp.

func (*MockCruiseControlScalerMockRecorder) KafkaClusterLoad added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) KafkaClusterLoad() *gomock.Call

KafkaClusterLoad indicates an expected call of KafkaClusterLoad.

func (*MockCruiseControlScalerMockRecorder) KafkaClusterState added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) KafkaClusterState() *gomock.Call

KafkaClusterState indicates an expected call of KafkaClusterState.

func (*MockCruiseControlScalerMockRecorder) LogDirsByBroker added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) LogDirsByBroker() *gomock.Call

LogDirsByBroker indicates an expected call of LogDirsByBroker.

func (*MockCruiseControlScalerMockRecorder) PartitionReplicasByBroker added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) PartitionReplicasByBroker() *gomock.Call

PartitionReplicasByBroker indicates an expected call of PartitionReplicasByBroker.

func (*MockCruiseControlScalerMockRecorder) RebalanceDisks added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) RebalanceDisks(arg0 ...interface{}) *gomock.Call

RebalanceDisks indicates an expected call of RebalanceDisks.

func (*MockCruiseControlScalerMockRecorder) RebalanceWithParams added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) RebalanceWithParams(arg0 interface{}) *gomock.Call

RebalanceWithParams indicates an expected call of RebalanceWithParams.

func (*MockCruiseControlScalerMockRecorder) RemoveBrokers added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) RemoveBrokers(arg0 ...interface{}) *gomock.Call

RemoveBrokers indicates an expected call of RemoveBrokers.

func (*MockCruiseControlScalerMockRecorder) RemoveBrokersWithParams added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) RemoveBrokersWithParams(arg0 interface{}) *gomock.Call

RemoveBrokersWithParams indicates an expected call of RemoveBrokersWithParams.

func (*MockCruiseControlScalerMockRecorder) Status added in v0.22.0

Status indicates an expected call of Status.

func (*MockCruiseControlScalerMockRecorder) StopExecution added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) StopExecution() *gomock.Call

StopExecution indicates an expected call of StopExecution.

func (*MockCruiseControlScalerMockRecorder) UserTasks added in v0.22.0

func (mr *MockCruiseControlScalerMockRecorder) UserTasks(arg0 ...interface{}) *gomock.Call

UserTasks indicates an expected call of UserTasks.

type Result added in v0.21.0

type Result struct {
	TaskID             string
	StartedAt          string
	ResponseStatusCode int
	RequestURL         string
	Result             *types.OptimizationResult
	State              v1beta1.CruiseControlUserTaskState
	Err                error
}

Jump to

Keyboard shortcuts

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