algo

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Overview

Package algo implements different types of placement algorithms

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAlgorithm

func NewAlgorithm(opts placement.Options) placement.Algorithm

NewAlgorithm returns a placement algorithm with given options

Types

type PlacementHelper

type PlacementHelper interface {
	// Instances returns the list of instances managed by the PlacementHelper.
	Instances() []placement.Instance

	// CanMoveShard checks if the shard can be moved from the instance to the target isolation group.
	CanMoveShard(shard uint32, fromInstance placement.Instance, toIsolationGroup string) bool
}

PlacementHelper helps the algorithm to place shards.

func NewPlacementHelper

func NewPlacementHelper(p placement.Placement, opts placement.Options) PlacementHelper

NewPlacementHelper returns a placement helper

Jump to

Keyboard shortcuts

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