Documentation ¶
Index ¶
- type Backend
- type BackupCodec
- type BackupFile
- func (f *BackupFile) DeSerialize() (header *BackupHeader, kvs map[string]string, err error)
- func (f *BackupFile) ReadEntryFromPos(pos uint64) (entryLength uint64, entry *commonpb.KeyDataPair, err error)
- func (f *BackupFile) ReadHeader() (header *BackupHeader, headerLength uint64, err error)
- func (f *BackupFile) Reset()
- func (f *BackupFile) WriteEntry(k, v string) error
- func (f *BackupFile) WriteHeader(header *BackupHeader) error
- type BackupHeader
- type BackupHeaderExtra
- type BackupHeaderVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 BackupHeaderVersion `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,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:"-"` }
BackupHeader stores etcd backup header information
func (*BackupHeader) ProtoMessage ¶
func (v *BackupHeader) ProtoMessage()
func (*BackupHeader) Reset ¶
func (v *BackupHeader) Reset()
func (*BackupHeader) String ¶
func (v *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
)
Click to show internal directories.
Click to hide internal directories.