types

package
v0.0.0-...-2643bdd Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SubstateAnalyzer contains if proposals are cached and/or ready.
	SubstateAnalyzer Substate = "analyzer"
	// SubstateMonitor contains details about the cruise control monitoring.
	SubstateMonitor Substate = "monitor"
	// SubstateExecutor contains the status of executions in cruise control.
	SubstateExecutor Substate = "executor"
	// SubstateAnomalyDetector contains the details of the anomaly detectors.
	SubstateAnomalyDetector Substate = "anomaly_detector"

	// ValidWindows when specified as a data_from argument, signals to handle
	// the operation based on the information in the available valid snapshot windows.
	// A valid snapshot window is a window whose valid monitored partitions coverage
	// meets the requirements of all the goals.
	ValidWindows DataSource = "VALID_WINDOWS"
	// ValidPartitions signals to handle the operation based on all the available
	// valid partitions. All the snapshot windows will be included in this case.
	ValidPartitions DataSource = "VALID_PARTITIONS"

	// PrioritizeSmallReplica will first move small replicas.
	PrioritizeSmallReplica ReplicaMovementStrategy = "PrioritizeSmallReplicaMovementStrategy"
	// PrioritizeLargeReplica will first move large replicas.
	PrioritizeLargeReplica ReplicaMovementStrategy = "PrioritizeLargeReplicaMovementStrategy"
	// PostponeUrpReplica will first move replicas for partitions having no
	// out-of-sync replica.
	PostponeUrpReplica ReplicaMovementStrategy = "PostponeUrpReplicaMovementStrategy"

	// DiskResource sorts results by disk load.
	DiskResource LoadType = "DISK"
	// CPUResource sorts results by CPU load.
	CPUResource LoadType = "CPU"
	// NetworkInResource sorts results by network-in load.
	NetworkInResource LoadType = "NW_IN"
	// NetworkOutResource sorts results by network-out load.
	NetworkOutResource LoadType = "NW_OUT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddBrokersRequest

type AddBrokersRequest struct {
	// BrokerIDs is a list of ids of new broker(s) to add to the cluster.
	BrokerIDs []int `param:"brokerid"`

	// DryRun will just report what would have happened without doing anything.
	DryRun bool `param:"dryrun"`

	// DataFrom specifies whether to generate proposal from available valid partitions
	// or valid windows.
	DataFrom DataSource `param:"data_from"`

	// Goals is a list of goals used to generate the proposal.
	Goals []string `param:"goals"`

	// KafkaAssigner specifies whether to use Kafka assigner mode to generate proposal.
	KafkaAssigner bool `param:"kafka_assigner"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// ConcurrentPartitionMovementsPerBroker specifies the upper bound of ongoing
	// replica movements going in and out of each broker.
	ConcurrentPartitionMovementsPerBroker int `param:"concurrent_partition_movements_per_broker"`

	// ConcurrentLeaderMovements specifies the upper bound of ongoing leadership
	// movements.
	ConcurrentLeaderMovements int `param:"concurrent_leader_movements"`

	// SkipHardGoalCheck specifies whether to allow hard goal to be skipped in
	// proposal generation.
	SkipHardGoalCheck bool `param:"skip_hard_goal_check"`

	// ExcludedTopicsRegex is a regular expression to specify topic(s) not to be
	// considered for replica movement.
	ExcludedTopicsRegex string `param:"excluded_topics"`

	// UseReadyDefaultGoals specifies whether to only use ready goals to generate
	// proposal.
	UseReadyDefaultGoals bool `param:"use_ready_default_goals"`

	// ExcludeRecentlyDemotedBrokers specifies whether to allow leader replicas
	// to be moved to recently demoted broker.
	ExcludeRecentlyDemotedBrokers bool `param:"exclude_recently_demoted_brokers"`

	// ExcludeRecentlyRemovedBrokers specifies whether to allow replicas to be
	// moved to recently removed broker.
	ExcludeRecentlyRemovedBrokers bool `param:"exclude_recently_removed_brokers"`

	// ReplicaMovementStrategies specifies the replica movement strategy to use.
	ReplicaMovementStrategies ReplicaMovementStrategy `param:"replica_movement_strategies"`

	// ReplicationThrottle is the upper bound on the bandwidth used to move replicas.
	ReplicationThrottle int `param:"replication_throttle"`

	// ThrottleAddedBroker specifies whether to throttle replica movement to new
	// broker(s).
	ThrottleAddedBroker bool `param:"throttle_added_broker"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

AddBrokersRequest represents the parameters for an add_broker request.

func AddBrokersDefaults

func AddBrokersDefaults(brokerIDs []int) *AddBrokersRequest

AddBrokersDefaults returns a request with the default add_broker parameters.

func (*AddBrokersRequest) Validate

func (req *AddBrokersRequest) Validate() error

Validate checks that an AddBrokersRequest is valid.

type AnalyzerState

type AnalyzerState struct {
	IsProposalReady bool            `json:"isProposalReady"`
	ReadyGoals      []string        `json:"readyGoals"`
	GoalReadiness   []GoalReadiness `json:"goalReadiness"`
}

AnalyzerState represents the state of the analyzer.

type Anomaly

type Anomaly struct {
	Description    string `json:"description"`
	AnomalyID      string `json:"anomalyId"`
	DetectionMs    int64  `json:"detectionMs"`
	StatusUpdateMs int64  `json:"statusUpdateMs"`
	Status         string `json:"status"`
}

Anomaly represents the details about an anomaly in the cluster.

type AnomalyDetectorMetrics

type AnomalyDetectorMetrics struct {
	MeanTimeToStartFixMs       float64            `json:"meanTimeToStartFixMs"`
	NumSelfHealingStarted      int                `json:"numSelfHealingStarted"`
	OngoingAnomalyDurationMs   float64            `json:"ongoingAnomalyDurationMs"`
	MeanTimeBetweenAnomaliesMs map[string]float64 `json:"meanTimeBetweenAnomaliesMs"`
}

AnomalyDetectorMetrics represents the metrics for the anomaly detector.

type AnomalyDetectorState

type AnomalyDetectorState struct {
	RecentBrokerFailures    []Anomaly              `json:"recentBrokerFailures"`
	RecentGoalViolations    []Anomaly              `json:"recentGoalViolations"`
	SelfHealingDisabled     []string               `json:"selfHealingDisabled"`
	SelfHealingEnabled      []string               `json:"selfHealingEnabled"`
	RecentDiskFailures      []Anomaly              `json:"recentDiskFailures"`
	Metrics                 AnomalyDetectorMetrics `json:"metrics"`
	RecentMetricAnomalies   []Anomaly              `json:"recentMetricAnomalies"`
	SelfHealingEnabledRatio map[string]float64     `json:"selfHealingEnabledRatio"`
}

AnomalyDetectorState represents the state of the anomaly detector.

type BasicAuthCredentials

type BasicAuthCredentials struct {
	Username string
	Password string
}

BasicAuthCredentials contains the username and password to use for HTTP basic authentication.

type BrokerLoad

type BrokerLoad struct {
	Broker           int     `json:"Broker"`
	BrokerState      string  `json:"BrokerState"`
	FollowerNwInRate float64 `json:"FollowerNwInRate"`
	Leaders          int     `json:"Leaders"`
	DiskMB           float64 `json:"DiskMB"`
	PnwOutRate       float64 `json:"PnwOutRate"`
	NwOutRate        float64 `json:"NwOutRate"`
	Host             string  `json:"Host"`
	CPUPct           float64 `json:"CpuPct"`
	Replicas         int     `json:"Replicas"`
	LeaderNwInRate   float64 `json:"LeaderNwInRate"`
	DiskPct          float64 `json:"DiskPct"`
}

BrokerLoad represents the load from a single Kafka broker.

type ClientOptions

type ClientOptions struct {
	URL       string
	BasicAuth *BasicAuthCredentials
}

ClientOptions contains the parameters for creating a new Cruise Control client.

type ClusterLoad

type ClusterLoad struct {
	Hosts   []HostLoad   `json:"hosts"`
	Brokers []BrokerLoad `json:"brokers"`
}

ClusterLoad represents the load data for hosts and brokers in a cluster.

type DataSource

type DataSource string

DataSource represents where to retrieve data for an operation from.

type DemoteBrokersRequest

type DemoteBrokersRequest struct {
	// BrokerIDs is a list of ids of new broker(s) to demote.
	BrokerIDs []int `param:"brokerid"`

	// BrokerIDsAndLogDirs is a list of broker id and logdir pairs to be demoted
	// in the cluster. The format of a single entry is `id-logdir`.
	BrokerIDsAndLogDirs []string `param:"brokerid_and_logdirs"`

	// DryRun will just report what would have happened without doing anything.
	DryRun bool `param:"dryrun"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// ConcurrentLeaderMovements specifies the upper bound of ongoing leadership
	// movements.
	ConcurrentLeaderMovements int `param:"concurrent_leader_movements"`

	// SkipUrpDemotion specifies whether to skip demoting leader replicas for
	// under replicated partitions.
	SkipUrpDemotion bool `param:"skip_urp_demotion"`

	// ExcludeFollowerDemotion specifies whether to skip demoting follower replicas
	// on the broker to be demoted.
	ExcludeFollowerDemotion bool `param:"exclude_follower_demotion"`

	// ExcludeRecentlyDemotedBrokers specifies whether to allow leader replicas
	// to be moved to recently demoted broker.
	ExcludeRecentlyDemotedBrokers bool `param:"exclude_recently_demoted_brokers"`

	// ReplicaMovementStrategies specifies the replica movement strategy to use.
	ReplicaMovementStrategies ReplicaMovementStrategy `param:"replica_movement_strategies"`

	// ReplicationThrottle is the upper bound on the bandwidth used to move replicas.
	ReplicationThrottle int `param:"replication_throttle"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

DemoteBrokersRequest represents the parameters for a demote_broker request.

func DemoteBrokersDefaults

func DemoteBrokersDefaults(brokerIDs []int) *DemoteBrokersRequest

DemoteBrokersDefaults returns a request with the default demote_broker parameters.

func (*DemoteBrokersRequest) Validate

func (req *DemoteBrokersRequest) Validate() error

Validate checks that a DemoteBrokersRequest is valid.

type ExecutorState

type ExecutorState struct {
	State string `json:"state"`
}

ExecutorState represents the state of the executor.

type FixOfflineReplicasRequest

type FixOfflineReplicasRequest struct {
	// DryRun will just report what would have happened without doing anything.
	DryRun bool `param:"dryrun"`

	// DataFrom specifies whether to generate proposal from available valid partitions
	// or valid windows.
	DataFrom DataSource `param:"data_from"`

	// Goals is a list of goals used to generate the proposal.
	Goals []string `param:"goals"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// ConcurrentPartitionMovementsPerBroker specifies the upper bound of ongoing
	// replica movements going in and out of each broker.
	ConcurrentPartitionMovementsPerBroker int `param:"concurrent_partition_movements_per_broker"`

	// ConcurrentLeaderMovements specifies the upper bound of ongoing leadership
	// movements.
	ConcurrentLeaderMovements int `param:"concurrent_leader_movements"`

	// SkipHardGoalCheck specifies whether to allow hard goal to be skipped in
	// proposal generation.
	SkipHardGoalCheck bool `param:"skip_hard_goal_check"`

	// ExcludedTopicsRegex is a regular expression to specify topic(s) not to be
	// considered for replica movement.
	ExcludedTopicsRegex string `param:"excluded_topics"`

	// UseReadyDefaultGoals specifies whether to only use ready goals to generate
	// proposal.
	UseReadyDefaultGoals bool `param:"use_ready_default_goals"`

	// ExcludeRecentlyDemotedBrokers specifies whether to allow leader replicas
	// to be moved to recently demoted broker.
	ExcludeRecentlyDemotedBrokers bool `param:"exclude_recently_demoted_brokers"`

	// ExcludeRecentlyRemovedBrokers specifies whether to allow replicas to be
	// moved to recently removed broker.
	ExcludeRecentlyRemovedBrokers bool `param:"exclude_recently_removed_brokers"`

	// ReplicaMovementStrategies specifies the replica movement strategy to use.
	ReplicaMovementStrategies ReplicaMovementStrategy `param:"replica_movement_strategies"`

	// ReplicationThrottle is the upper bound on the bandwidth used to move replicas.
	ReplicationThrottle int `param:"replication_throttle"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

FixOfflineReplicasRequest represents the parameters for a fix_offline_replicas request.

func FixOfflineReplicasDefaults

func FixOfflineReplicasDefaults() *FixOfflineReplicasRequest

FixOfflineReplicasDefaults returns a request with the default fix_offline_replicas parameters.

type GenericResponse

type GenericResponse struct {
	Message string `json:"message"`
	Version int    `json:"version"`
}

GenericResponse represents a server response that just consists of a message and version identifier.

type GetKafkaClusterStateRequest

type GetKafkaClusterStateRequest struct {
	// TopicRegex is a regex for filtering partitions to report on.
	TopicRegex string `param:"topic"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

GetKafkaClusterStateRequest represents the parameters for a kafka_cluster_state request.

func GetKafkaClusterStateDefaults

func GetKafkaClusterStateDefaults() *GetKafkaClusterStateRequest

GetKafkaClusterStateDefaults returns a request with the default kafka_cluster_state parameters.

type GetKafkaClusterStateResponse

type GetKafkaClusterStateResponse struct {
	KafkaPartitionState KafkaPartitionState `json:"KafkaPartitionState"`
	KafkaBrokerState    KafkaBrokerState    `json:"KafkaBrokerState"`
	Version             int                 `json:"version"`
}

GetKafkaClusterStateResponse represents a response from the kafka_cluster_state endpoint.

type GetLoadRequest

type GetLoadRequest struct {
	// Start is an optional start-time of the cluster load.
	Start time.Time `param:"start"`

	// End is an optional end-time for the cluster load.
	End time.Time `param:"end"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// PopulateDiskInfo specifies whether to show the load of each disk on a
	// broker.
	PopulateDiskInfo bool `param:"populate_disk_info"`
}

GetLoadRequest represents the parameters for a load request.

func GetLoadDefaults

func GetLoadDefaults() *GetLoadRequest

GetLoadDefaults returns a request with the default load parameters.

type GetLoadResponse

type GetLoadResponse struct {
	Hosts   []HostLoad   `json:"hosts"`
	Brokers []BrokerLoad `json:"brokers"`
	Version int          `json:"version"`
}

GetLoadResponse represents a response to a get load request.

type GetPartitionLoadRequest

type GetPartitionLoadRequest struct {
	// Resource specifies what to sort results by.
	Resource LoadType `param:"resource"`
	// Start is an optional start-time of the partition load.
	Start time.Time `param:"start"`

	// End is an optional end-time for the partition load.
	End time.Time `param:"end"`

	// Entries specifies the number of load entries to return in the response.
	Entries int `param:"entries"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// MaxLoad specifies whether to report the maximum load for partition in windows.
	MaxLoad bool `param:"max_load"`

	// AvgLoad specifies whether to report the average load for partition in windows.
	AvgLoad bool `param:"avg_load"`

	// TopicRegex is a regex to filter partition load based on partition's topic.
	TopicRegex string `param:"topic"`

	// PartitionRange is a number or range to filter partitions with.
	PartitionRange string `param:"partition"`

	// MinValidPartitionRatio is the minimal valid partition ratio requirement for
	// cluster models.
	MinValidPartitionRatio float64 `param:"min_valid_partition_ratio"`

	// BrokerID is a broker to filter results by.
	BrokerID int `param:"broker_id"`
}

GetPartitionLoadRequest represents the parameters for a partition_load request.

func GetPartitionLoadDefaults

func GetPartitionLoadDefaults() *GetPartitionLoadRequest

GetPartitionLoadDefaults returns a request with the default partitiion_load parameters.

type GetPartitionLoadResponse

type GetPartitionLoadResponse struct {
	Records []PartitionLoadRecord `json:"records"`
	Version int                   `json:"version"`
}

GetPartitionLoadResponse represents a response to a get partition load request.

type GetProposalsRequest

type GetProposalsRequest struct {
	// IgnoreProposalCache specifies whether to ignore the proposal cache.
	IgnoreProposalCache bool `param:"ignore_proposal_cache"`

	// DataFrom specifies whether to generate proposal from available valid partitions
	// or valid windows.
	DataFrom DataSource `param:"data_from"`

	// Goals is a list of goals used to generate the proposal.
	Goals []string `param:"goals"`

	// KafkaAssigner specifies whether to use Kafka assigner mode to generate proposal.
	KafkaAssigner bool `param:"kafka_assigner"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// ExcludedTopicsRegex is a regular expression to specify topic(s) not to be
	// considered for replica movement.
	ExcludedTopicsRegex string `param:"excluded_topics"`

	// UseReadyDefaultGoals specifies whether to only use ready goals to generate
	// proposal.
	UseReadyDefaultGoals bool `param:"use_ready_default_goals"`

	// ExcludeRecentlyDemotedBrokers specifies whether to allow leader replicas
	// to be moved to recently demoted broker.
	ExcludeRecentlyDemotedBrokers bool `param:"exclude_recently_demoted_brokers"`

	// ExcludeRecentlyRemovedBrokers specifies whether to allow replicas to be
	// moved to recently removed broker.
	ExcludeRecentlyRemovedBrokers bool `param:"exclude_recently_removed_brokers"`

	// DestinationBrokerIDs specifies brokers to consider moving replicas to.
	DestinationBrokerIDs []string `param:"destination_broker_ids"`

	// RebalanceDisk specifies whether to balance load between brokers or between
	// disks within a broker.
	RebalanceDisk bool `param:"rebalance_disk"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

GetProposalsRequest represents the parameters for a proposals request.

func GetProposalsDefaults

func GetProposalsDefaults() *GetProposalsRequest

GetProposalsDefaults returns a request with the default proposals parameters.

type GetStateRequest

type GetStateRequest struct {
	// Substates is a list of substates to report on. If empty, all substate will
	// be returned.
	Substates []Substate `param:"substates"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`

	// SuperVerbose returns even more detailed state information.
	SuperVerbose bool `param:"super_verbose"`
}

GetStateRequest represents the parameters for a state request.

func GetStateDefaults

func GetStateDefaults() *GetStateRequest

GetStateDefaults returns the defaults for a state request.

type GetStateResponse

type GetStateResponse struct {
	AnalyzerState        AnalyzerState        `json:"AnalyzerState"`
	MonitorState         MonitorState         `json:"MonitorState"`
	ExecutorState        ExecutorState        `json:"ExecutorState"`
	AnomalyDetectorState AnomalyDetectorState `json:"AnomalyDetectorState"`
	Version              int                  `json:"version"`
}

GetStateResponse represents the response to a state request.

type GetUserTasksRequest

type GetUserTasksRequest struct {
	// UserTaskIDs filters the response by a list of specific user tasks IDs.
	UserTaskIDs []string `param:"user_task_ids"`

	// ClientIDs filters the response by a list of client IP addresses.
	ClientIDs []string `param:"client_ids"`

	// Entries specifies the number of entries to return in the response.
	Entries int `param:"entries"`

	// Endpoints filters the results based off specific API endpoints.
	Endpoints []string `param:"endpoints"`

	// RequestTypes filters the results based off the given request types.
	RequestTypes []string `param:"types"`

	// FetchCompletedTask specifies whether to return the original request's response.
	FetchCompletedTask bool `param:"fetch_completed_task"`
}

GetUserTasksRequest represents the parameters for a user_tasks request.

func GetUserTasksDefaults

func GetUserTasksDefaults() *GetUserTasksRequest

GetUserTasksDefaults returns a request with the default user_tasks parameters.

type GetUserTasksResponse

type GetUserTasksResponse struct {
	UserTasks []UserTask `json:"userTasks"`
	Version   int        `json:"version"`
}

GetUserTasksResponse represents the response to a user_tasks request.

type Goal

type Goal struct {
	Name              string     `json:"goal"`
	Status            string     `json:"status"`
	ClusterModelStats ModelStats `json:"clusterModelStats"`
}

Goal represents a goal to be satisfied by a proposal.

type GoalReadiness

type GoalReadiness struct {
	Name                     string                   `json:"name"`
	ModelCompleteRequirement ModelCompleteRequirement `json:"modelCompleteRequirement"`
	Status                   string                   `json:"status"`
}

GoalReadiness represents the status of a goal.

type HostLoad

type HostLoad struct {
	FollowerNwInRate float64 `json:"FollowerNwInRate"`
	Leaders          int     `json:"Leaders"`
	DiskMB           float64 `json:"DiskMB"`
	PnwOutRate       float64 `json:"PnwOutRate"`
	NwOutRate        float64 `json:"NwOutRate"`
	Host             string  `json:"Host"`
	CPUPct           float64 `json:"CpuPct"`
	Replicas         int     `json:"Replicas"`
	LeaderNwInRate   float64 `json:"LeaderNwInRate"`
	DiskPct          float64 `json:"DiskPct"`
}

HostLoad represents the load of a server running a Kafka broker.

type KafkaBrokerState

type KafkaBrokerState struct {
	OfflineLogDirsByBrokerID      map[string][]string `json:"OfflineLogDirsByBrokerId"`
	OnlineLogDirsByBrokerID       map[string][]string `json:"OnlineLogDirsByBrokerId"`
	ReplicaCountByBrokerID        map[string]int      `json:"ReplicaCountByBrokerId"`
	OfflineReplicaCountByBrokerID map[string]int      `json:"OfflineReplicaCountByBrokerId"`
	OutOfSyncCountByBrokerID      map[string]int      `json:"OutOfSyncCountByBrokerId"`
	LeaderCountByBrokerID         map[string]int      `json:"LeaderCountByBrokerId"`
}

KafkaBrokerState represents the state of a single Kafka broker.

type KafkaPartitionState

type KafkaPartitionState struct {
	Offline             []PartitionState `json:"offline"`
	URP                 []PartitionState `json:"urp"`
	WithOfflineReplicas []PartitionState `json:"with-offline-replicas"`
	UnderMinISR         []PartitionState `json:"under-min-isr"`
}

KafkaPartitionState represents the states of the partitions on the cluster.

type LoadType

type LoadType string

LoadType represents a type of resource load to sort results by.

type ModelCompleteRequirement

type ModelCompleteRequirement struct {
	IncludeAllTopics                 bool    `json:"includeAllTopics"`
	MinMonitoredPartitionsPercentage float64 `json:"minMonitoredPartitionsPercentage"`
	RequiredNumSnapshots             int     `json:"requiredNumSnapshots"`
}

ModelCompleteRequirement represents the requirements for which a model is complete.

type ModelMetadata

type ModelMetadata struct {
	Brokers  int `json:"brokers"`
	Replicas int `json:"replicas"`
	Topics   int `json:"topics"`
}

ModelMetadata represents the metadata for a given model.

type ModelStatistics

type ModelStatistics struct {
	AVG ModelStatsValues `json:"AVG"`
	STD ModelStatsValues `json:"STD"`
	MIN ModelStatsValues `json:"MIN"`
	MAX ModelStatsValues `json:"MAX"`
}

ModelStatistics represents groups of statistical data for a model.

type ModelStats

type ModelStats struct {
	Metadata   ModelMetadata   `json:"metadata"`
	Statistics ModelStatistics `json:"statistics"`
}

ModelStats represents the statistics for a training model.

type ModelStatsValues

type ModelStatsValues struct {
	Disk            float64 `json:"disk"`
	Replicas        float64 `json:"replicas"`
	LeaderReplicas  float64 `json:"leaderReplicas"`
	CPU             float64 `json:"cpu"`
	NetworkOutbound float64 `json:"networkOutbound"`
	NetworkInbound  float64 `json:"networkInbound"`
	TopicReplicas   float64 `json:"topicReplicas"`
	PotentialNwOut  float64 `json:"potentialNwOut"`
}

ModelStatsValues represents the actual values for a given model.

type MonitorState

type MonitorState struct {
	TrainingPct                 float64            `json:"trainingPct"`
	Trained                     bool               `json:"trained"`
	NumFlawedPartitions         int                `json:"numFlawedPartitions"`
	State                       string             `json:"state"`
	NumTotalPartitions          int                `json:"numTotalPartitions"`
	NumMonitoredWindows         int                `json:"numMonitoredWindows"`
	MonitoredWindows            map[string]float64 `json:"monitoredWindows"`
	MonitoringCoveragePct       float64            `json:"monitoringCoveragePct"`
	ReasonOfLatestPauseOrResume string             `json:"reasonOfLatestPauseOrResume"`
	NumValidPartitions          int                `json:"numValidPartitions"`
}

MonitorState represents the state of the monitor.

type PartitionLoadRecord

type PartitionLoadRecord struct {
	Leader          int     `json:"leader"`
	Disk            float64 `json:"disk"`
	Partition       int     `json:"partition"`
	Followers       []int   `json:"followers"`
	MsgIn           float64 `json:"msg_in"`
	Topic           string  `json:"topic"`
	CPU             float64 `json:"cpu"`
	NetworkOutbound float64 `json:"networkOutbound"`
	NetworkInbound  float64 `json:"networkInbound"`
}

PartitionLoadRecord represents the load details for a single partition.

type PartitionState

type PartitionState struct {
	InSync    []int  `json:"in-sync"`
	OutOfSync []int  `json:"out-of-sync"`
	Leader    int    `json:"leader"`
	Offline   []int  `json:"offline"`
	Replicas  []int  `json:"replicas"`
	Topic     string `json:"topic"`
	Partition int    `json:"partition"`
}

PartitionState represents the state of a single partition.

type Proposal

type Proposal struct {
	OldLeader      int            `json:"oldLeader"`
	OldReplicas    []int          `json:"oldReplicas"`
	NewReplicas    []int          `json:"newReplicas"`
	TopicPartition TopicPartition `json:"topicPartition"`
}

Proposal represents the actions taken for a single proposal.

type ProposalsResponse

type ProposalsResponse struct {
	Summary                ProposalsSummary `json:"summary"`
	GoalSummary            []Goal           `json:"goalSummary"`
	LoadBeforeOptimization ClusterLoad      `json:"loadBeforeOptimization"`
	LoadAfterOptimization  ClusterLoad      `json:"loadAfterOptimization"`
	Proposals              []Proposal       `json:"proposals"`
	Version                int              `json:"version"`
}

ProposalsResponse represents a response to a proposals request.

type ProposalsSummary

type ProposalsSummary struct {
	NumIntraBrokerReplicaMovements int      `json:"numIntraBrokerReplicaMovements"`
	ExcludedBrokersForLeadership   []int    `json:"excludedBrokersForLeadership"`
	ExcludedBrokersForReplicaMove  []int    `json:"excludedBrokersForReplicaMove"`
	NumReplicaMovements            int      `json:"numReplicaMovements"`
	IntraBrokerDataToMoveMB        int      `json:"intraBrokerDataToMoveMB"`
	RecentWindows                  int      `json:"recentWindows"`
	DataToMoveMB                   int      `json:"dataToMoveMB"`
	MonitoredPartitionsPercentage  float64  `json:"monitoredPartitionsPercentage"`
	ExcludedTopics                 []string `json:"excludedTopics"`
	NumLeaderMovements             int      `json:"numLeaderMovements"`
}

ProposalsSummary represents the summary of the proposals.

type RebalanceRequest

type RebalanceRequest struct {
	// DryRun will just report what would have happened without doing anything.
	DryRun bool `param:"dryrun"`

	// DataFrom specifies whether to generate proposal from available valid partitions
	// or valid windows.
	DataFrom DataSource `param:"data_from"`

	// Goals is a list of goals used to generate the proposal.
	Goals []string `param:"goals"`

	// KafkaAssigner specifies whether to use Kafka assigner mode to generate proposal.
	KafkaAssigner bool `param:"kafka_assigner"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// ConcurrentPartitionMovementsPerBroker specifies the upper bound of ongoing
	// replica movements going in and out of each broker.
	ConcurrentPartitionMovementsPerBroker int `param:"concurrent_partition_movements_per_broker"`

	// ConcurrentIntraPartitionMovements specifies the upper bound of ongoing
	// replica movements going between disks of a single broker.
	ConcurrentIntraPartitionMovements int `param:"concurrent_intra_partition_movements"`

	// ConcurrentLeaderMovements specifies the upper bound of ongoing leadership
	// movements.
	ConcurrentLeaderMovements int `param:"concurrent_leader_movements"`

	// SkipHardGoalCheck specifies whether to allow hard goal to be skipped in
	// proposal generation.
	SkipHardGoalCheck bool `param:"skip_hard_goal_check"`

	// ExcludedTopicsRegex is a regular expression to specify topic(s) not to be
	// considered for replica movement.
	ExcludedTopicsRegex string `param:"excluded_topics"`

	// UseReadyDefaultGoals specifies whether to only use ready goals to generate
	// proposal.
	UseReadyDefaultGoals bool `param:"use_ready_default_goals"`

	// ExcludeRecentlyDemotedBrokers specifies whether to allow leader replicas
	// to be moved to recently demoted broker.
	ExcludeRecentlyDemotedBrokers bool `param:"exclude_recently_demoted_brokers"`

	// ExcludeRecentlyRemovedBrokers specifies whether to allow replicas to be
	// moved to recently removed broker.
	ExcludeRecentlyRemovedBrokers bool `param:"exclude_recently_removed_brokers"`

	// ReplicaMovementStrategies specifies the replica movement strategy to use.
	ReplicaMovementStrategies ReplicaMovementStrategy `param:"replica_movement_strategies"`

	// IgnoreProposalCache specifies whether to ignore the proposal cache.
	IgnoreProposalCache bool `param:"ignore_proposal_cache"`

	// ReplicationThrottle is the upper bound on the bandwidth used to move replicas.
	ReplicationThrottle int `param:"replication_throttle"`

	// DestinationBrokerIDs specifies brokers to consider moving replicas to.
	DestinationBrokerIDs []int `param:"destination_broker_ids"`

	// RebalanceDisk specifies whether to balance load between disks within each
	// broker or between brokers in cluster
	RebalanceDisk bool `param:"rebalance_disk"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

RebalanceRequest represents the parameters for a rebalance request.

func RebalanceDefaults

func RebalanceDefaults() *RebalanceRequest

RebalanceDefaults returns a request with the default parameters for a rebalance request.

type RemoveBrokersRequest

type RemoveBrokersRequest struct {
	// BrokerIDs is a list of ids of new broker(s) to remove from the cluster.
	BrokerIDs []int `param:"brokerid"`

	// DryRun will just report what would have happened without doing anything.
	DryRun bool `param:"dryrun"`

	// DataFrom specifies whether to generate proposal from available valid partitions
	// or valid windows.
	DataFrom DataSource `param:"data_from"`

	// Goals is a list of goals used to generate the proposal.
	Goals []string `param:"goals"`

	// KafkaAssigner specifies whether to use Kafka assigner mode to generate proposal.
	KafkaAssigner bool `param:"kafka_assigner"`

	// AllowCapacityEstimation specifies whether to allow broker capacity to be
	// estimated from other brokers in the cluster.
	AllowCapacityEstimation bool `param:"allow_capacity_estimation"`

	// ConcurrentPartitionMovementsPerBroker specifies the upper bound of ongoing
	// replica movements going in and out of each broker.
	ConcurrentPartitionMovementsPerBroker int `param:"concurrent_partition_movements_per_broker"`

	// ConcurrentLeaderMovements specifies the upper bound of ongoing leadership
	// movements.
	ConcurrentLeaderMovements int `param:"concurrent_leader_movements"`

	// SkipHardGoalCheck specifies whether to allow hard goal to be skipped in
	// proposal generation.
	SkipHardGoalCheck bool `param:"skip_hard_goal_check"`

	// ExcludedTopicsRegex is a regular expression to specify topic(s) not to be
	// considered for replica movement.
	ExcludedTopicsRegex string `param:"excluded_topics"`

	// UseReadyDefaultGoals specifies whether to only use ready goals to generate
	// proposal.
	UseReadyDefaultGoals bool `param:"use_ready_default_goals"`

	// ExcludeRecentlyDemotedBrokers specifies whether to allow leader replicas
	// to be moved to recently demoted broker.
	ExcludeRecentlyDemotedBrokers bool `param:"exclude_recently_demoted_brokers"`

	// ExcludeRecentlyRemovedBrokers specifies whether to allow replicas to be
	// moved to recently removed broker.
	ExcludeRecentlyRemovedBrokers bool `param:"exclude_recently_removed_brokers"`

	// ReplicaMovementStrategies specifies the replica movement strategy to use.
	ReplicaMovementStrategies ReplicaMovementStrategy `param:"replica_movement_strategies"`

	// ReplicationThrottle is the upper bound on the bandwidth used to move replicas.
	ReplicationThrottle int `param:"replication_throttle"`

	// ThrottleAddedBroker specifies whether to throttle replica movement from the removed
	// broker(s).
	ThrottleRemovedBroker bool `param:"throttle_removed_broker"`

	// DestinationBrokerIDs specifies brokers to prioritize moving replicas to.
	DestinationBrokerIDs []int `param:"destination_broker_ids"`

	// Verbose returns detailed state information.
	Verbose bool `param:"verbose"`
}

RemoveBrokersRequest represents the parameters for a remove_broker request.

func RemoveBrokersDefaults

func RemoveBrokersDefaults(brokerIDs []int) *RemoveBrokersRequest

RemoveBrokersDefaults returns a request with the defaults for a remove_broker request.

func (*RemoveBrokersRequest) Validate

func (req *RemoveBrokersRequest) Validate() error

Validate checks that a RemoveBrokersRequest is valid.

type ReplicaMovementStrategy

type ReplicaMovementStrategy string

ReplicaMovementStrategy represents a replica movement strategy.

type Substate

type Substate string

Substate represents a substate for a GET state request.

type TopicPartition

type TopicPartition struct {
	Hash      int    `json:"hash"`
	Partition int    `json:"partition"`
	Topic     string `json:"topic"`
}

TopicPartition represents a single partition for a topic.

type TriggerSamplingRequest

type TriggerSamplingRequest struct {
	// Reason provides a message for why the request was made.
	Reason string `param:"reason"`
}

TriggerSamplingRequest represents a request to pause or resume metrics sampling

func TriggerSamplingDefaults

func TriggerSamplingDefaults() *TriggerSamplingRequest

TriggerSamplingDefaults returns a TriggerSamplingRequest with the default parameters.

type UserTask

type UserTask struct {
	Status         string `json:"Status"`
	UserTaskID     string `json:"UserTaskId"`
	StartMs        string `json:"StartMs"`
	ClientIdentity string `json:"ClientIdentity"`
	RequestURL     string `json:"RequestURL"`
}

UserTask contains the details for a single user-initiated task.

Jump to

Keyboard shortcuts

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