snapshotter

package
v1.4.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWSSnapshotter

type AWSSnapshotter struct {
	BaseSnapshotter
}

The snapshotter for creating snapshots from volumes (during a backup) and volumes from snapshots (during a restore) on AWS EBS.

func (*AWSSnapshotter) GenerateBackupMetadata

func (s *AWSSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)

func (*AWSSnapshotter) GetVolumeID

func (s *AWSSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)

func (*AWSSnapshotter) Init

func (s *AWSSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error

func (*AWSSnapshotter) PrepareRestoreMetadata

func (s *AWSSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)

func (*AWSSnapshotter) SetVolumeID

func (s *AWSSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error

type BaseSnapshotter

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

func (*BaseSnapshotter) Init

func (s *BaseSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error

func (*BaseSnapshotter) PrepareCSBK8SMeta

func (s *BaseSnapshotter) PrepareCSBK8SMeta(csb *CloudSnapBackup, tc *v1alpha1.TidbCluster) ([]*corev1.Pod, string, error)

type CloudSnapBackup

type CloudSnapBackup struct {
	TiKV       *TiKVBackup            `json:"tikv"`
	PD         Component              `json:"pd"`
	TiDB       Component              `json:"tidb"`
	Kubernetes *KubernetesBackup      `json:"kubernetes"`
	Options    map[string]interface{} `json:"options"`
}

func NewCloudSnapshotBackup

func NewCloudSnapshotBackup(tc *v1alpha1.TidbCluster) (csb *CloudSnapBackup)

type Component

type Component struct {
	Replicas int32 `json:"replicas"`
}

type GCPSnapshotter

type GCPSnapshotter struct {
	BaseSnapshotter
}

The GCPSnapshotter for creating snapshots from volumes (during a backup) and volumes from snapshots (during a restore) on Google Compute Engine Disks.

func (*GCPSnapshotter) GenerateBackupMetadata

func (s *GCPSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)

func (*GCPSnapshotter) GetVolumeID

func (s *GCPSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)

func (*GCPSnapshotter) Init

func (s *GCPSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error

func (*GCPSnapshotter) PrepareRestoreMetadata

func (s *GCPSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)

func (*GCPSnapshotter) SetVolumeID

func (s *GCPSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error

type KubernetesBackup

type KubernetesBackup struct {
	PVCs         []*corev1.PersistentVolumeClaim `json:"pvcs"`
	PVs          []*corev1.PersistentVolume      `json:"pvs"`
	TiDBCluster  *v1alpha1.TidbCluster           `json:"crd_tidb_cluster"`
	Unstructured *unstructured.Unstructured      `json:"options"`
}

type NoneSnapshotter

type NoneSnapshotter struct {
}

func (*NoneSnapshotter) GenerateBackupMetadata

func (s *NoneSnapshotter) GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)

func (*NoneSnapshotter) GetVolumeID

func (s *NoneSnapshotter) GetVolumeID(pv *corev1.PersistentVolume) (string, error)

func (*NoneSnapshotter) Init

func (s *NoneSnapshotter) Init(deps *controller.Dependencies, conf map[string]string) error

func (*NoneSnapshotter) PrepareRestoreMetadata

func (s *NoneSnapshotter) PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)

func (*NoneSnapshotter) SetVolumeID

func (s *NoneSnapshotter) SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error

type Snapshotter

type Snapshotter interface {
	// Init prepares the Snapshotter for usage, it would add
	// specific parameters as config map[string]string in the future.
	Init(deps *controller.Dependencies, conf map[string]string) error

	// GetVolumeID returns the cloud provider specific identifier
	// for the PersistentVolume-PV.
	GetVolumeID(pv *corev1.PersistentVolume) (string, error)

	// GenerateBackupMetadata performs the preparations for creating
	// a snapshot from the used volume for PV/PVC.
	GenerateBackupMetadata(b *v1alpha1.Backup, tc *v1alpha1.TidbCluster) (*CloudSnapBackup, string, error)

	// PrepareRestoreMetadata performs the preparations for creating
	// a volume from the snapshot that has been backed up.
	PrepareRestoreMetadata(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)

	// SetVolumeID sets the cloud provider specific identifier
	// for the PersistentVolume-PV.
	SetVolumeID(pv *corev1.PersistentVolume, volumeID string) error
}

type StoresBackup

type StoresBackup struct {
	StoreID uint64          `json:"store_id"`
	Volumes []*VolumeBackup `json:"volumes"`
}

type StoresMixture

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

func NewRestoreStoresMixture

func NewRestoreStoresMixture(s Snapshotter) *StoresMixture

func (*StoresMixture) PrepareCSBStoresMeta

func (m *StoresMixture) PrepareCSBStoresMeta(csb *CloudSnapBackup, pods []*corev1.Pod) (string, error)

func (*StoresMixture) ProcessCSBPVCsAndPVs

func (m *StoresMixture) ProcessCSBPVCsAndPVs(r *v1alpha1.Restore, csb *CloudSnapBackup) (string, error)

func (*StoresMixture) SetPod

func (m *StoresMixture) SetPod(pod *corev1.Pod)

type TiKVBackup

type TiKVBackup struct {
	Component
	Stores []*StoresBackup `json:"stores"`
}

type VolumeBackup

type VolumeBackup struct {
	VolumeID        string `json:"volume_id"`
	Type            string `json:"type"`
	MountPath       string `json:"mount_path"`
	SnapshotID      string `json:"snapshot_id"`
	RestoreVolumeID string `json:"restore_volume_id"`
}

Jump to

Keyboard shortcuts

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