restore

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LocalTmpDir = "/tmp/nebula-br"

Variables

This section is empty.

Functions

func FlattenBackupMeta

func FlattenBackupMeta(backup *meta.BackupMeta) map[string]*PartInfo

FlattenBackupMeta flatten backup meta to a map for convenience because of (spaceId + partId) can specify a unique part

func FlattenRestoreMeta

func FlattenRestoreMeta(resp *meta.RestoreMetaResp) map[string][]*nebula.HostAddr

FlattenRestoreMeta flatten meta.RestoreMetaResp to a map for convenience because of (spaceId + partId) can specify a unique part

func GenDataPathKey

func GenDataPathKey(host *nebula.HostAddr, partKey string) string

GenDataPathKey generate a unique key for data path

func GenPartKey

func GenPartKey(spaceId, partId string) string

GenPartKey generate a unique key for part

func NewPathSelectorMap

func NewPathSelectorMap(storages []*meta.ServiceInfo) map[string]*PathSelector

func ParseAddr

func ParseAddr(addrStr string) (*nebula.HostAddr, error)

func ParseMetaFromFile

func ParseMetaFromFile(filename string) (*meta.BackupMeta, error)

func StringifyAddr

func StringifyAddr(addr *nebula.HostAddr) string

func UriJoin

func UriJoin(elem ...string) (string, error)

Types

type Config

type Config struct {
	BackupName  string
	Concurrency int32
	Backend     *pb.Backend
}

type HostDir

type HostDir struct {
	Host string // ip
	Dir  string // nebula root dir
}

type NebulaHosts

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

func (*NebulaHosts) GetMetas

func (h *NebulaHosts) GetMetas() []*meta.ServiceInfo

func (*NebulaHosts) GetStorages

func (h *NebulaHosts) GetStorages() []*meta.ServiceInfo

func (*NebulaHosts) LoadFrom

func (h *NebulaHosts) LoadFrom(resp *meta.ListClusterInfoResp) error

type PartInfo

type PartInfo struct {
	SpaceID        string
	PartID         string
	HostAddr       *nebula.HostAddr
	DataPath       string
	CheckpointPath string
	CommitLogId    int64
	LastLogId      int64
}

PartInfo save a unique part's information for FlattenBackupMeta

type PathSelector

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

func NewPathSelector

func NewPathSelector(paths [][]byte) *PathSelector

func (*PathSelector) EvenlyGet

func (p *PathSelector) EvenlyGet() string

Jump to

Keyboard shortcuts

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