backend

package
v0.10.3-0...-54aaeda Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_backup_header_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Load() (*meta.Meta, error)
	Save(meta *meta.Meta) error
	Clean() error
	Backup(meta *meta.Meta, backupFile string) error
	BackupV2(file string) error
	Restore(backupFile string) error
}

func NewBackend

func NewBackend(cfg *configs.MilvusConfig, version string) (Backend, error)

type BackupCodec

type BackupCodec struct{}

func NewBackupCodec

func NewBackupCodec() *BackupCodec

func (*BackupCodec) DeSerialize

func (c *BackupCodec) DeSerialize(file BackupFile) (header *BackupHeader, kvs map[string]string, err error)

func (*BackupCodec) Serialize

func (c *BackupCodec) Serialize(header *BackupHeader, kvs map[string]string) (BackupFile, error)

type BackupFile

type BackupFile []byte

func (*BackupFile) DeSerialize

func (f *BackupFile) DeSerialize() (header *BackupHeader, kvs map[string]string, err error)

func (*BackupFile) ReadEntryFromPos

func (f *BackupFile) ReadEntryFromPos(pos uint64) (entryLength uint64, entry *commonpb.KeyDataPair, err error)

func (*BackupFile) ReadHeader

func (f *BackupFile) ReadHeader() (header *BackupHeader, headerLength uint64, err error)

func (*BackupFile) Reset

func (f *BackupFile) Reset()

func (*BackupFile) WriteEntry

func (f *BackupFile) WriteEntry(k, v string) error

func (*BackupFile) WriteHeader

func (f *BackupFile) WriteHeader(header *BackupHeader) error

type BackupHeader

type BackupHeader struct {

	// Version number for backup format
	Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	// instance name, as rootPath for key prefix
	Instance string `protobuf:"bytes,2,opt,name=instance,proto3" json:"instance,omitempty"`
	// MetaPath used in keys
	MetaPath string `protobuf:"bytes,3,opt,name=meta_path,json=metaPath,proto3" json:"meta_path,omitempty"`
	// Entries record number of key-value in backup
	Entries int64 `protobuf:"varint,4,opt,name=entries,proto3" json:"entries,omitempty"`
	// Component is the backup target
	Component string `protobuf:"bytes,5,opt,name=component,proto3" json:"component,omitempty"`
	// Extra property reserved
	Extra []byte `protobuf:"bytes,6,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*BackupHeader) Descriptor deprecated

func (*BackupHeader) Descriptor() ([]byte, []int)

Deprecated: Use BackupHeader.ProtoReflect.Descriptor instead.

func (*BackupHeader) GetComponent

func (x *BackupHeader) GetComponent() string

func (*BackupHeader) GetEntries

func (x *BackupHeader) GetEntries() int64

func (*BackupHeader) GetExtra

func (x *BackupHeader) GetExtra() []byte

func (*BackupHeader) GetInstance

func (x *BackupHeader) GetInstance() string

func (*BackupHeader) GetMetaPath

func (x *BackupHeader) GetMetaPath() string

func (*BackupHeader) GetVersion

func (x *BackupHeader) GetVersion() int32

func (*BackupHeader) ProtoMessage

func (*BackupHeader) ProtoMessage()

func (*BackupHeader) ProtoReflect

func (x *BackupHeader) ProtoReflect() protoreflect.Message

func (*BackupHeader) Reset

func (x *BackupHeader) Reset()

func (*BackupHeader) String

func (x *BackupHeader) String() string

type BackupHeaderExtra

type BackupHeaderExtra struct {
	EntryIncludeRootPath bool `json:"entry_include_root_path"`
}

func GetExtra

func GetExtra(extra []byte) *BackupHeaderExtra

func (*BackupHeaderExtra) ToJSONBytes

func (v *BackupHeaderExtra) ToJSONBytes() []byte

type BackupHeaderVersion

type BackupHeaderVersion int32
const (
	BackupHeaderVersionV1 BackupHeaderVersion = iota
)

Jump to

Keyboard shortcuts

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