config

package
v1.1.0-beta.0...-9958228 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2024 PingCAP, Inc. Licensed under Apache-2.0.

Index

Constants

View Source
const (
	GP3Volume EBSVolumeType = "gp3"
	IO1Volume               = "io1"
	IO2Volume               = "io2"
)

Variables

This section is empty.

Functions

func ParseImportThreadsFromConfig

func ParseImportThreadsFromConfig(resp []byte) (uint, error)

func ParseLogBackupEnableFromConfig

func ParseLogBackupEnableFromConfig(resp []byte) (bool, error)

func ParseMergeRegionSizeFromConfig

func ParseMergeRegionSizeFromConfig(resp []byte) (uint64, uint64, error)

Types

type ClusterInfo

type ClusterInfo struct {
	Version        string            `json:"cluster_version" toml:"cluster_version"`
	FullBackupType string            `json:"full_backup_type" toml:"full_backup_type"`
	ResolvedTS     uint64            `json:"resolved_ts" toml:"resolved_ts"`
	Replicas       map[string]uint64 `json:"replicas" toml:"replicas"`
}

ClusterInfo represents the tidb cluster level meta infos. such as pd cluster id/alloc id, cluster resolved ts and tikv configuration.

type ConfigTerm

type ConfigTerm[T uint | uint64] struct {
	Value    T
	Modified bool
}

type EBSBasedBRMeta

type EBSBasedBRMeta struct {
	ClusterInfo    *ClusterInfo   `json:"cluster_info" toml:"cluster_info"`
	TiKVComponent  *TiKVComponent `json:"tikv" toml:"tikv"`
	TiDBComponent  *TiDBComponent `json:"tidb" toml:"tidb"`
	PDComponent    *PDComponent   `json:"pd" toml:"pd"`
	KubernetesMeta *Kubernetes    `json:"kubernetes" toml:"kubernetes"`
	Options        map[string]any `json:"options" toml:"options"`
	Region         string         `json:"region" toml:"region"`
}

func NewMetaFromStorage

func NewMetaFromStorage(ctx context.Context, s storage.ExternalStorage) (*EBSBasedBRMeta, error)

func (*EBSBasedBRMeta) CheckClusterInfo

func (c *EBSBasedBRMeta) CheckClusterInfo()

func (*EBSBasedBRMeta) ConfigFromFile

func (c *EBSBasedBRMeta) ConfigFromFile(path string) error

ConfigFromFile loads config from file.

func (*EBSBasedBRMeta) GetFullBackupType

func (c *EBSBasedBRMeta) GetFullBackupType() string

func (*EBSBasedBRMeta) GetResolvedTS

func (c *EBSBasedBRMeta) GetResolvedTS() uint64

func (*EBSBasedBRMeta) GetStoreCount

func (c *EBSBasedBRMeta) GetStoreCount() uint64

func (*EBSBasedBRMeta) GetTiKVVolumeCount

func (c *EBSBasedBRMeta) GetTiKVVolumeCount() uint64

func (*EBSBasedBRMeta) SetClusterVersion

func (c *EBSBasedBRMeta) SetClusterVersion(version string)

func (*EBSBasedBRMeta) SetFullBackupType

func (c *EBSBasedBRMeta) SetFullBackupType(t string)

func (*EBSBasedBRMeta) SetResolvedTS

func (c *EBSBasedBRMeta) SetResolvedTS(id uint64)

func (*EBSBasedBRMeta) SetRestoreVolumeIDs

func (c *EBSBasedBRMeta) SetRestoreVolumeIDs(idMap map[string]string)

func (*EBSBasedBRMeta) SetSnapshotIDs

func (c *EBSBasedBRMeta) SetSnapshotIDs(idMap map[string]string)

func (*EBSBasedBRMeta) SetVolumeAZs

func (c *EBSBasedBRMeta) SetVolumeAZs(idMap map[string]string)

func (*EBSBasedBRMeta) String

func (c *EBSBasedBRMeta) String() string

type EBSStore

type EBSStore struct {
	StoreID uint64       `json:"store_id" toml:"store_id"`
	Volumes []*EBSVolume `json:"volumes" toml:"volumes"`
}

type EBSVolume

type EBSVolume struct {
	ID              string `json:"volume_id" toml:"volume_id"`
	Type            string `json:"type" toml:"type"`
	SnapshotID      string `json:"snapshot_id" toml:"snapshot_id"`
	RestoreVolumeId string `json:"restore_volume_id" toml:"restore_volume_id"`
	VolumeAZ        string `json:"volume_az" toml:"volume_az"`
	Status          string `json:"status" toml:"status"`
}

EBSVolume is passed by TiDB deployment tools: TiDB Operator and TiUP(in future) we should do snapshot inside BR, because we need some logic to determine the order of snapshot starts. TODO finish the info with TiDB Operator developer.

type EBSVolumeType

type EBSVolumeType string

func (EBSVolumeType) Valid

func (t EBSVolumeType) Valid() bool

type KVConfig

type KVConfig struct {
	ImportGoroutines    ConfigTerm[uint]
	MergeRegionSize     ConfigTerm[uint64]
	MergeRegionKeyCount ConfigTerm[uint64]
}

type Kubernetes

type Kubernetes struct {
	PVs     []*corev1.PersistentVolume      `json:"pvs" toml:"pvs"`
	PVCs    []*corev1.PersistentVolumeClaim `json:"pvcs" toml:"pvcs"`
	CRD     any                             `json:"crd_tidb_cluster" toml:"crd_tidb_cluster"`
	Options map[string]any                  `json:"options" toml:"options"`
}

type PDComponent

type PDComponent struct {
	Replicas int `json:"replicas"`
}

type TiDBComponent

type TiDBComponent struct {
	Replicas int `json:"replicas"`
}

type TiKVComponent

type TiKVComponent struct {
	Replicas int         `json:"replicas"`
	Stores   []*EBSStore `json:"stores"`
}

Jump to

Keyboard shortcuts

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