member

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// EvictLeaderBeginTime is the key of evict Leader begin time
	EvictLeaderBeginTime = "evictLeaderBeginTime"
	// EvictLeaderTimeout is the timeout limit of evict leader
	EvictLeaderTimeout = 3 * time.Minute
)
View Source
const (
	// LastAppliedConfigAnnotation is annotation key of last applied configuration
	LastAppliedConfigAnnotation = "pingcap.com/last-applied-configuration"
	// ImagePullBackOff is the pod state of image pull failed
	ImagePullBackOff = "ImagePullBackOff"
	// ErrImagePull is the pod state of image pull failed
	ErrImagePull = "ErrImagePull"
)
View Source
const (
	// MaxResignDDLOwnerCount is the max regign DDL owner count
	MaxResignDDLOwnerCount = 3
)

Variables

This section is empty.

Functions

func GetLastAppliedConfig

func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1.PodSpec, error)

GetLastAppliedConfig get last applied config info from Statefulset's annotation

func NewPDMemberManager

func NewPDMemberManager(pdControl controller.PDControlInterface,
	setControl controller.StatefulSetControlInterface,
	svcControl controller.ServiceControlInterface,
	setLister v1beta1.StatefulSetLister,
	svcLister corelisters.ServiceLister,
	podLister corelisters.PodLister,
	podControl controller.PodControlInterface,
	pvcLister corelisters.PersistentVolumeClaimLister,
	pdScaler Scaler,
	pdUpgrader Upgrader,
	autoFailover bool,
	pdFailover Failover) manager.Manager

NewPDMemberManager returns a *pdMemberManager

func NewTiDBMemberManager

func NewTiDBMemberManager(setControl controller.StatefulSetControlInterface,
	svcControl controller.ServiceControlInterface,
	tidbControl controller.TiDBControlInterface,
	setLister v1beta1.StatefulSetLister,
	svcLister corelisters.ServiceLister,
	tidbUpgrader Upgrader,
	autoFailover bool,
	tidbFailover Failover) manager.Manager

NewTiDBMemberManager returns a *tidbMemberManager

func NewTiKVMemberManager

func NewTiKVMemberManager(pdControl controller.PDControlInterface,
	setControl controller.StatefulSetControlInterface,
	svcControl controller.ServiceControlInterface,
	setLister v1beta1.StatefulSetLister,
	svcLister corelisters.ServiceLister,
	podLister corelisters.PodLister,
	nodeLister corelisters.NodeLister,
	autoFailover bool,
	tikvFailover Failover,
	tikvScaler Scaler,
	tikvUpgrader Upgrader) manager.Manager

NewTiKVMemberManager returns a *tikvMemberManager

func SetLastAppliedConfigAnnotation

func SetLastAppliedConfigAnnotation(set *apps.StatefulSet) error

SetLastAppliedConfigAnnotation set last applied config info to Statefulset's annotation

func SetServiceLastAppliedConfigAnnotation

func SetServiceLastAppliedConfigAnnotation(svc *corev1.Service) error

SetServiceLastAppliedConfigAnnotation set last applied config info to Service's annotation

Types

type Failover added in v0.2.0

type Failover interface {
	Failover(*v1alpha1.TidbCluster) error
	Recover(*v1alpha1.TidbCluster)
}

Failover implements the logic for pd/tikv/tidb's failover and recovery.

func NewFakePDFailover added in v0.2.0

func NewFakePDFailover() Failover

NewFakePDFailover returns a fake Failover

func NewFakeTiDBFailover added in v0.2.0

func NewFakeTiDBFailover() Failover

NewFakeTiDBFailover returns a fake Failover

func NewFakeTiKVFailover added in v0.2.0

func NewFakeTiKVFailover() Failover

NewFakeTiKVFailover returns a fake Failover

func NewPDFailover added in v0.2.0

NewPDFailover returns a pd Failover

func NewTiDBFailover added in v0.2.0

func NewTiDBFailover(failoverPeriod time.Duration) Failover

NewTiDBFailover returns a tidbFailover instance

func NewTiKVFailover added in v0.2.0

func NewTiKVFailover(pdControl controller.PDControlInterface) Failover

NewTiKVFailover returns a tikv Failover

type Scaler

type Scaler interface {
	// ScaleOut scales out the cluster
	ScaleOut(*v1alpha1.TidbCluster, *apps.StatefulSet, *apps.StatefulSet) error
	// ScaleIn scales in the cluster
	ScaleIn(*v1alpha1.TidbCluster, *apps.StatefulSet, *apps.StatefulSet) error
}

Scaler implements the logic for scaling out or scaling in the cluster.

func NewFakePDScaler

func NewFakePDScaler() Scaler

NewFakePDScaler returns a fake Scaler

func NewFakeTiKVScaler

func NewFakeTiKVScaler() Scaler

NewFakeTiKVScaler returns a fake tikv Scaler

func NewPDScaler

NewPDScaler returns a Scaler

func NewTiKVScaler

NewTiKVScaler returns a tikv Scaler

type SvcConfig

type SvcConfig struct {
	Name       string
	Port       int32
	SvcLabel   func(label.Label) label.Label
	MemberName func(clusterName string) string
	Headless   bool
}

SvcConfig corresponds to a K8s service

type Upgrader added in v0.2.0

type Upgrader interface {
	// Upgrade upgrade the cluster
	Upgrade(*v1alpha1.TidbCluster, *apps.StatefulSet, *apps.StatefulSet) error
}

Upgrader implements the logic for upgrading the tidb cluster.

func NewFakePDUpgrader added in v0.2.0

func NewFakePDUpgrader() Upgrader

NewFakePDUpgrader returns a fakePDUpgrader

func NewFakeTiDBUpgrader added in v0.2.0

func NewFakeTiDBUpgrader() Upgrader

NewFakeTiDBUpgrader returns a fake tidb upgrader

func NewFakeTiKVUpgrader added in v0.2.0

func NewFakeTiKVUpgrader() Upgrader

NewFakeTiKVUpgrader returns a fake tikv upgrader

func NewPDUpgrader added in v0.2.0

func NewPDUpgrader(pdControl controller.PDControlInterface,
	podControl controller.PodControlInterface,
	podLister corelisters.PodLister) Upgrader

NewPDUpgrader returns a pdUpgrader

func NewTiDBUpgrader added in v0.2.0

func NewTiDBUpgrader(tidbControl controller.TiDBControlInterface) Upgrader

NewTiDBUpgrader returns a tidb Upgrader

func NewTiKVUpgrader added in v0.2.0

func NewTiKVUpgrader(pdControl controller.PDControlInterface,
	podControl controller.PodControlInterface,
	podLister corelisters.PodLister) Upgrader

NewTiKVUpgrader returns a tikv Upgrader

Jump to

Keyboard shortcuts

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