libs

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const AppName = "elasticsearch-reroute-shards"
View Source
const AppVersion = "v1.0.0"

Variables

View Source
var (
	CfgFile      string
	Listen       string
	CacheEnabled bool
)

Functions

func DryRunTable

func DryRunTable()

func InitConfig added in v1.0.1

func InitConfig()

func InitLogging added in v1.0.1

func InitLogging(level string, logFormat string)

func MoveCommandsToTable

func MoveCommandsToTable(input []MoveCommand)

func RebalanceInfoToTable

func RebalanceInfoToTable(input rebalanceInfo)

func RerouteResponseToTable

func RerouteResponseToTable(input rerouteResponse)

func Run added in v1.0.1

func Run()

func SettingsToTable

func SettingsToTable(input map[string]interface{})

func ShardsAvailableForMoveToTable

func ShardsAvailableForMoveToTable(input []shard)

Types

type Elastic

type Elastic struct {
	HttpClient   *http.Client
	HttpUsername string
	HttpPassword string
}

func (Elastic) ExecuteMoveCommands

func (e Elastic) ExecuteMoveCommands(url string, moveCommands ShardsReroute, dryRun bool) rerouteResponse

func (Elastic) GetDiskSpaceInfo

func (e Elastic) GetDiskSpaceInfo(url string, allowedPercentOfDifference int, fromNode string, toNode string) rebalanceInfo

GetDiskSpaceInfo func

func (Elastic) GetShardsInfo

func (e Elastic) GetShardsInfo(url string, diskSpaceInfo rebalanceInfo, shardsToMove int) []shard

func (Elastic) PrepareMoveCommand

func (e Elastic) PrepareMoveCommand(shards []shard, fromNode, toNode string) ShardsReroute

type MoveCommand

type MoveCommand struct {
	Move struct {
		Index    string `json:"index"`
		Shard    string `json:"shard"`
		FromNode string `json:"from_node"`
		ToNode   string `json:"to_node"`
	} `json:"move"`
}

type ShardsReroute

type ShardsReroute struct {
	Commands []MoveCommand `json:"commands"`
}

Jump to

Keyboard shortcuts

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