stage

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "stage",
	Short: "Execute a series of partition reassignments",
	Long:  long,
	RunE: func(cmd *cobra.Command, args []string) error {
		rs, err := readReassignments(reassignmentsFilepath)
		if err != nil {
			return fmt.Errorf("problem reading reassignments json file: %w", err)
		}

		if rs.Version != 1 {
			return fmt.Errorf("unsupported version '%d'", rs.Version)
		}

		client := &kafka.Client{Addr: kafka.TCP(vars.BootstrapServer)}

		err = ReconcileUntilDone(client, rs, maxMovesPerBroker, dryRun)
		if err != nil {
			return err
		}

		fmt.Println("Reassignments complete.")
		return nil
	},
}

Functions

func ReconcileUntilDone

func ReconcileUntilDone(client *kafka.Client, rs *Reassignments, maxMovesPerBroker int, dryRun bool) error

Types

type Reassignment

type Reassignment struct {
	Topic     string   `json:"topic"`
	Partition int      `json:"partition"`
	Replicas  []int    `json:"replicas"`
	LogDirs   []string `json:"log_dirs,omitempty"`
	// contains filtered or unexported fields
}

func (Reassignment) String

func (r Reassignment) String() string

type Reassignments

type Reassignments struct {
	Partitions []Reassignment `json:"partitions"`
	Version    int            `json:"version"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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