selector

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: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInstanceSelector

func NewInstanceSelector(opts placement.Options) placement.InstanceSelector

NewInstanceSelector creates an instance selector.

func NewMirroredCustomGroupSelector added in v0.15.0

func NewMirroredCustomGroupSelector(
	instanceToGroupID InstanceGroupIDFunc,
	opts placement.Options,
) placement.InstanceSelector

NewMirroredCustomGroupSelector constructs a placement.InstanceSelector which assigns shardsets according to their group ID (provided by instanceToGroupID). That is, instances with the same group ID are assigned the same shardset ID, and will receive the same mirrored traffic.

func NewNonMirroredSelector added in v0.15.0

func NewNonMirroredSelector(opts placement.Options) placement.InstanceSelector

NewNonMirroredSelector constructs an instance selector which doesn't mirror traffic (no shardsets) and which takes into account existing shard placement and instance weight in order to choose instances.

func NewPortMirroredSelector added in v0.15.0

func NewPortMirroredSelector(opts placement.Options) placement.InstanceSelector

NewPortMirroredSelector returns a placement.InstanceSelector which creates groups of instances by their port number and assigns a shardset to each group, taking isolation groups into account while creating groups. This is the default behavior used by NewInstanceSelector if IsMirrored is true.

Types

type InstanceGroupIDFunc added in v0.15.0

type InstanceGroupIDFunc func(inst placement.Instance) (string, error)

InstanceGroupIDFunc maps an instance to its mirrored group.

func NewMapInstanceGroupIDFunc added in v0.15.0

func NewMapInstanceGroupIDFunc(instanceToGroup map[string]string) InstanceGroupIDFunc

NewMapInstanceGroupIDFunc creates a simple lookup function for an instances group, which looks up the group ID for an instance by the instance ID.

Jump to

Keyboard shortcuts

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