normalizer

package
v0.0.0-...-485fd57 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// If a tablet's hostname ever goes over 60 chars then it will not be able
	// to boostrap properly because it will truncate the master hostname and replication will fail.
	// See the chart at the bottom of https://dev.mysql.com/doc/refman/8.0/en/change-master-to.html
	MaxTabletHostnameLength = 60

	// allow up to 99 replicas. Statefulsets can go higher, but it's not likely for this use case
	MaxTabletOrdinalLength = 2
)

Variables

View Source
var ClientError = errors.New("Client Error")

Functions

func NewClientError

func NewClientError(err error) error

func ResourceSelectorsAsLabelSelector

func ResourceSelectorsAsLabelSelector(rSels []vitessv1alpha2.ResourceSelector) (labels.Selector, error)

ResourceSelectorsAsLabelSelector converts the []ResourceSelector api type into a struct that implements labels.Selector.

Types

type Normalizer

type Normalizer struct {
	// contains filtered or unexported fields
}

func New

func New(client client.Client) *Normalizer

func (*Normalizer) ListFromSelectors

func (n *Normalizer) ListFromSelectors(ctx context.Context, rSels []vitessv1alpha2.ResourceSelector, retList runtime.Object) error

func (*Normalizer) NormalizeCellLockserver

func (n *Normalizer) NormalizeCellLockserver(cell *vitessv1alpha2.VitessCell) error

func (*Normalizer) NormalizeCluster

func (n *Normalizer) NormalizeCluster(cluster *vitessv1alpha2.VitessCluster) error

func (*Normalizer) NormalizeClusterCells

func (n *Normalizer) NormalizeClusterCells(cluster *vitessv1alpha2.VitessCluster) error

func (*Normalizer) NormalizeClusterKeyspaceShards

func (n *Normalizer) NormalizeClusterKeyspaceShards(cluster *vitessv1alpha2.VitessCluster, keyspace *vitessv1alpha2.VitessKeyspace) error

func (*Normalizer) NormalizeClusterKeyspaces

func (n *Normalizer) NormalizeClusterKeyspaces(cluster *vitessv1alpha2.VitessCluster) error

func (*Normalizer) NormalizeClusterLockserver

func (n *Normalizer) NormalizeClusterLockserver(cluster *vitessv1alpha2.VitessCluster) error

func (*Normalizer) NormalizeClusterShardTablets

func (n *Normalizer) NormalizeClusterShardTablets(cluster *vitessv1alpha2.VitessCluster, shard *vitessv1alpha2.VitessShard) error

func (*Normalizer) TestClusterSanity

func (n *Normalizer) TestClusterSanity(cluster *vitessv1alpha2.VitessCluster) error

func (*Normalizer) ValidateCluster

func (n *Normalizer) ValidateCluster(cluster *vitessv1alpha2.VitessCluster) error

func (*Normalizer) ValidateTablet

func (n *Normalizer) ValidateTablet(tablet *vitessv1alpha2.VitessTablet) error

type ValidationError

type ValidationError error
var (
	ValidationErrorNoLockserverForCluster ValidationError = errors.New("No Lockserver in Cluster")
	ValidationErrorNoLockserverForCell    ValidationError = errors.New("No Lockserver in Cell")

	ValidationErrorNoCells     ValidationError = errors.New("No Cells in Cluster")
	ValidationErrorNoShards    ValidationError = errors.New("No Shards in Cluster")
	ValidationErrorNoTablets   ValidationError = errors.New("No Tablets in Cluster")
	ValidationErrorNoKeyspaces ValidationError = errors.New("No Keyspaces in Cluster")

	ValidationErrorOverlappingKeyrange ValidationError = errors.New("Multiple shards provided with the same keyrange")

	ValidationErrorNoCellForTablet   ValidationError = errors.New("No Cell for Tablet")
	ValidationErrorTabletNameTooLong ValidationError = errors.New("Tablet name is too long and would break mysql replication")
)

Jump to

Keyboard shortcuts

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