data

package
v0.0.0-...-a5bc9b0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2021 TiKV Project Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 TiKV Project Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021 TiKV Project Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	TiDB component = iota
	PD
	TiKV
)

Flags for component.

View Source
const (
	BaseDir  = "/var/lib/"
	ParamLen = 8
	MaxRetry = 5
	// DebugLabel is the label for debug.
	DebugLabel = "runmode"
	DebugValue = "debug"
)

Variables

This section is empty.

Functions

func AllOf

func AllOf(s interface{}, p func(int) bool) bool

AllOf returns true if all elements in the slice match the predict func.

func AnyOf

func AnyOf(s interface{}, p func(int) bool) bool

AnyOf returns true if any element in the slice matches the predict func.

func NoneOf

func NoneOf(s interface{}, p func(int) bool) bool

NoneOf returns true if no element in the slice matches the predict func.

Types

type CloudOperator

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

CloudOperator is the interface for cloud operator.

func NewCloudOperator

func NewCloudOperator(namespace, conf string, ctx context.Context) *CloudOperator

NewCloudOperator creates a cloud operator.

func (*CloudOperator) Back

func (c *CloudOperator) Back(version string) error

Back backs up all the components.

func (*CloudOperator) Check

func (c *CloudOperator) Check() bool

func (*CloudOperator) List

func (c *CloudOperator) List() (map[string][]string, error)

List returns all the backup version of the component in one cluster.

func (*CloudOperator) Remove

func (c *CloudOperator) Remove(version string) error

func (*CloudOperator) Restore

func (c *CloudOperator) Restore(version string) error

Restore restores all the components from backup directory.

func (*CloudOperator) Start

func (c *CloudOperator) Start() error

Start starts all the components.

func (*CloudOperator) Stop

func (c *CloudOperator) Stop() error

Stop stops all the pods of the component and will enter debug mode.

type Operator

type Operator interface {
	// Start remove debug annotation and starts all pods
	Start() error
	// Stop stops all debugging pods
	Stop() error
	Back(version string) error
	// Restore
	Restore(version string) error
	// List return all components versions
	// K: pod.Name V: version list
	List() (map[string][]string, error)
	Check() bool
	Remove(version string) error
}

Jump to

Keyboard shortcuts

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