replica

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpCoalesce      = "coalesce" // Source is parent, target is child
	OpRemove        = "remove"
	OpMarkAsRemoved = "markasremoved"
)
View Source
const (
	Initial    = State("initial")
	Open       = State("open")
	Closed     = State("closed")
	Dirty      = State("dirty")
	Rebuilding = State("rebuilding")
	Error      = State("error")
)

Variables

This section is empty.

Functions

func GenerateSnapshotDiskName added in v0.2.0

func GenerateSnapshotDiskName(name string) string

Types

type BackingFile

type BackingFile struct {
	Size       int64
	SectorSize int64
	Name       string
	Disk       types.DiffDisk
}

type Backup added in v0.2.0

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

func NewBackup added in v0.2.0

func NewBackup(backingFile *BackingFile) *Backup

func (*Backup) CloseSnapshot added in v0.2.0

func (rb *Backup) CloseSnapshot(id, volumeID string) error

func (*Backup) CompareSnapshot added in v0.2.0

func (rb *Backup) CompareSnapshot(id, compareID, volumeID string) (*metadata.Mappings, error)

func (*Backup) HasSnapshot added in v0.2.0

func (rb *Backup) HasSnapshot(id, volumeID string) bool

func (*Backup) OpenSnapshot added in v0.2.0

func (rb *Backup) OpenSnapshot(id, volumeID string) error

func (*Backup) ReadSnapshot added in v0.2.0

func (rb *Backup) ReadSnapshot(id, volumeID string, start int64, data []byte) error

type Info

type Info struct {
	Size            int64
	Head            string
	Dirty           bool
	Rebuilding      bool
	Parent          string
	SectorSize      int64
	BackingFileName string
	BackingFile     *BackingFile `json:"-"`
}

func ReadInfo

func ReadInfo(dir string) (Info, error)

type PrepareRemoveAction added in v0.2.0

type PrepareRemoveAction struct {
	Action string `json:"action"`
	Source string `json:"source"`
	Target string `json:"target"`
}

type Replica

type Replica struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(size, sectorSize int64, dir string, backingFile *BackingFile) (*Replica, error)

func NewReadOnly added in v0.2.0

func NewReadOnly(dir, head string, backingFile *BackingFile) (*Replica, error)

func (*Replica) Chain

func (r *Replica) Chain() ([]string, error)

func (*Replica) Close

func (r *Replica) Close() error

func (*Replica) Delete

func (r *Replica) Delete() error

func (*Replica) DisplayChain added in v0.2.0

func (r *Replica) DisplayChain() ([]string, error)

func (*Replica) Info

func (r *Replica) Info() Info

func (*Replica) PrepareRemoveDisk added in v0.2.0

func (r *Replica) PrepareRemoveDisk(name string) ([]PrepareRemoveAction, error)

func (*Replica) ReadAt

func (r *Replica) ReadAt(buf []byte, offset int64) (int, error)

func (*Replica) Reload

func (r *Replica) Reload() (*Replica, error)

func (*Replica) RemoveDiffDisk

func (r *Replica) RemoveDiffDisk(name string, markOnly bool) error

func (*Replica) Revert added in v0.2.0

func (r *Replica) Revert(name string) (*Replica, error)

func (*Replica) SetRebuilding

func (r *Replica) SetRebuilding(rebuilding bool) error

func (*Replica) Snapshot

func (r *Replica) Snapshot(name string) error

func (*Replica) WriteAt

func (r *Replica) WriteAt(buf []byte, offset int64) (int, error)

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewServer

func NewServer(dir string, backing *BackingFile, sectorSize int64) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Create

func (s *Server) Create(size int64) error

func (*Server) Delete

func (s *Server) Delete() error

func (*Server) Open

func (s *Server) Open() error

func (*Server) PrepareRemoveDisk added in v0.2.0

func (s *Server) PrepareRemoveDisk(name string) ([]PrepareRemoveAction, error)

func (*Server) ReadAt

func (s *Server) ReadAt(buf []byte, offset int64) (int, error)

func (*Server) Reload

func (s *Server) Reload() error

func (*Server) RemoveDiffDisk

func (s *Server) RemoveDiffDisk(name string, markOnly bool) error

func (*Server) Replica

func (s *Server) Replica() *Replica

func (*Server) Revert added in v0.2.0

func (s *Server) Revert(name string) error

func (*Server) SetRebuilding

func (s *Server) SetRebuilding(rebuilding bool) error

func (*Server) Snapshot

func (s *Server) Snapshot(name string) error

func (*Server) Status

func (s *Server) Status() (State, Info)

func (*Server) WriteAt

func (s *Server) WriteAt(buf []byte, offset int64) (int, error)

type State

type State string

type UsedGenerator added in v0.2.0

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

func (*UsedGenerator) Err added in v0.2.0

func (u *UsedGenerator) Err() error

func (*UsedGenerator) Generate added in v0.2.0

func (u *UsedGenerator) Generate() <-chan int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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