Documentation
¶
Index ¶
- Constants
- Variables
- func CreateHoles()
- func GenerateSnapshotDiskName(name string) string
- func GetSnapshotNameFromDiskName(diskName string) (string, error)
- func IsHeadDisk(diskName string) bool
- func PreloadLunMap(d *diffDisk) error
- func SliceContains(chain []string, item string) bool
- type BackingFile
- type DiskInfo
- type Hole
- type Info
- type PrepareRemoveAction
- type Replica
- func (r *Replica) Chain() ([]string, error)
- func (r *Replica) Close() error
- func (r *Replica) Delete() error
- func (r *Replica) DeleteAll() error
- func (r *Replica) DisplayChain() ([]string, error)
- func (r *Replica) GetCloneStatus() string
- func (r *Replica) GetRemainSnapshotCounts() int
- func (r *Replica) GetReplicaMode() string
- func (r *Replica) GetRevisionCounter() int64
- func (r *Replica) GetUsage() (*types.VolUsage, error)
- func (r *Replica) GetUsedBlocks() string
- func (r *Replica) GetUsedLogicalBlocks() string
- func (r *Replica) Info() Info
- func (r *Replica) ListDisks() map[string]types.DiskInfo
- func (r *Replica) PrepareRemoveDisk(name string) ([]PrepareRemoveAction, error)
- func (r *Replica) ReadAt(buf []byte, offset int64) (int, error)
- func (r *Replica) Reload(preload bool) (*Replica, error)
- func (r *Replica) RemoveDiffDisk(name string) error
- func (r *Replica) ReplaceDisk(target, source string) error
- func (r *Replica) Resize(obj interface{}) error
- func (r *Replica) Revert(name, created string) (*Replica, error)
- func (r *Replica) SetCheckpoint(snapshotName string) error
- func (r *Replica) SetCloneStatus(status string) error
- func (r *Replica) SetRebuilding(rebuilding bool) error
- func (r *Replica) SetReplicaMode(mode string) error
- func (r *Replica) SetRevisionCounter(counter int64) error
- func (r *Replica) SetRevisionCounterCloneReplica(counter int64) error
- func (r *Replica) Snapshot(name string, userCreated bool, created string) error
- func (r *Replica) Sync() (int, error)
- func (r *Replica) Unmap(offset int64, length int64) (int, error)
- func (r *Replica) UpdateCloneInfo(snapName, revCount string) error
- func (r *Replica) WriteAt(buf []byte, offset int64) (int, error)
- type Server
- func (s *Server) CheckPreDeleteConditions() error
- func (s *Server) Close() error
- func (s *Server) Create(size int64) error
- func (s *Server) Delete() error
- func (s *Server) DeleteAll() error
- func (s *Server) GetRevisionCounter() (int64, error)
- func (s *Server) GetUsage() (*types.VolUsage, error)
- func (s *Server) Open() error
- func (s *Server) PingResponse() error
- func (s *Server) PrepareRemoveDisk(name string) ([]PrepareRemoveAction, error)
- func (s *Server) PrevStatus() (State, Info)
- func (s *Server) ReadAt(buf []byte, offset int64) (int, error)
- func (s *Server) Reload() error
- func (s *Server) RemoveDiffDisk(name string) error
- func (s *Server) ReplaceDisk(target, source string) error
- func (s *Server) Replica() *Replica
- func (s *Server) Resize(size string) error
- func (s *Server) Revert(name, created string) error
- func (s *Server) SetCheckpoint(snapshotName string) error
- func (s *Server) SetPreload(preload bool) error
- func (s *Server) SetRebuilding(rebuilding bool) error
- func (s *Server) SetReplicaMode(mode string) error
- func (s *Server) SetRevisionCounter(counter int64) error
- func (s *Server) Snapshot(name string, userCreated bool, createdTime string) error
- func (s *Server) Start(action string) error
- func (s *Server) Stats() *types.Stats
- func (s *Server) Status() (State, Info)
- func (s *Server) Sync() (int, error)
- func (s *Server) Unmap(offset int64, length int64) (int, error)
- func (s *Server) UpdateCloneInfo(snapName, revCount string) error
- func (s *Server) UpdateLUNMap() error
- func (s *Server) WriteAt(buf []byte, offset int64) (int, error)
- type State
- type UsedGenerator
Constants ¶
const ( OpCoalesce = "coalesce" // Source is parent, target is child OpRemove = "remove" OpReplace = "replace" )
Variables ¶
var ActionChannel chan string
var Dir string
var HoleCreatorChan = make(chan Hole, 1000000)
var StartTime time.Time
Functions ¶
func CreateHoles ¶
func CreateHoles()
CreateHoles removes the offsets from corresponding sparse files
func IsHeadDisk ¶
func PreloadLunMap ¶
func PreloadLunMap(d *diffDisk) error
func SliceContains ¶ added in v1.12.1
Types ¶
type BackingFile ¶
type Hole ¶
type Hole struct {
// contains filtered or unexported fields
}
Hole holds the fd, len and offset for fallocate operation
type Info ¶
type PrepareRemoveAction ¶
type Replica ¶
type Replica struct { sync.RWMutex ReplicaStartTime time.Time ReplicaType string CloneSnapName string Clone bool // contains filtered or unexported fields }
func CreateTempReplica ¶
func NewReadOnly ¶
func NewReadOnly(preload bool, dir, head string, backingFile *BackingFile) (*Replica, error)
func (*Replica) Chain ¶
Chain returns the disk chain starting with Head(index=0), till the base snapshot
func (*Replica) DisplayChain ¶
func (*Replica) GetCloneStatus ¶
func (*Replica) GetRemainSnapshotCounts ¶
func (*Replica) GetRevisionCounter ¶
func (*Replica) GetUsedBlocks ¶
func (*Replica) GetUsedLogicalBlocks ¶
func (*Replica) PrepareRemoveDisk ¶
func (r *Replica) PrepareRemoveDisk(name string) ([]PrepareRemoveAction, error)
PrepareRemoveDisk mark and prepare the list of the disks that is going to be deleted. NOTE: We don't delete latest snapshot because the data needs to be merged into Head file where IO's are being precessed that means we need to block IO's for some time till this get precessed.
func (*Replica) RemoveDiffDisk ¶
func (*Replica) ReplaceDisk ¶
ReplaceDisk replace the source with target snapshot and remove and close both source and target and open new instance of file for R/W and update the file index with new reference. If replace disk is being used then it is possible to delete a snapshot whose parent or child is user created
func (*Replica) SetCheckpoint ¶ added in v1.12.1
SetCheckpoint ...
func (*Replica) SetCloneStatus ¶
func (*Replica) SetRebuilding ¶
func (*Replica) SetReplicaMode ¶
SetReplicaMode ...
func (*Replica) SetRevisionCounter ¶
func (*Replica) SetRevisionCounterCloneReplica ¶
SetRevisionCounterCloneReplica set revision counter for clone replica
func (*Replica) UpdateCloneInfo ¶
UpdateCloneInfo update the clone information such as snapshot name and revisionCount
type Server ¶
type Server struct { sync.RWMutex ReplicaAddress string ServerType string //This channel is used to montitor the IO connection //between controller and replica. If the connection is broken, //the replica attempts to connect back to controller MonitorChannel chan struct{} // contains filtered or unexported fields }
func CreateTempServer ¶
func (*Server) CheckPreDeleteConditions ¶
CheckPreDeleteConditions checks if any replica exists. If it exists, it closes all the connections with the replica and deletes the entry from the controller.
func (*Server) Close ¶
Close drain the data from HoleCreatorChan and close all the associated files with the replica instance.
func (*Server) GetRevisionCounter ¶
GetRevisionCounter reads the revison counter
func (*Server) PingResponse ¶
func (*Server) PrepareRemoveDisk ¶
func (s *Server) PrepareRemoveDisk(name string) ([]PrepareRemoveAction, error)
func (*Server) PrevStatus ¶
func (*Server) RemoveDiffDisk ¶
func (*Server) ReplaceDisk ¶
func (*Server) SetCheckpoint ¶ added in v1.12.1
SetCheckpoint ...
func (*Server) SetPreload ¶
SetPreload sets/unsets preloadDuringOpen flag
func (*Server) SetRebuilding ¶
func (*Server) SetReplicaMode ¶
SetReplicaMode ...
func (*Server) SetRevisionCounter ¶
func (*Server) Stats ¶
Stats returns the revisionCache and Peerdetails TODO: What to return in Stats and GetUsage if s.r is nil?
func (*Server) UpdateCloneInfo ¶
func (*Server) UpdateLUNMap ¶
UpdateLUNMap updates the original LUNmap with any changes which have been encountered after PreloadVolume. This can be called only once just after reload is called after syncing the files from healthy replicas
type UsedGenerator ¶
type UsedGenerator struct {
// contains filtered or unexported fields
}
func (*UsedGenerator) Err ¶
func (u *UsedGenerator) Err() error
func (*UsedGenerator) Generate ¶
func (u *UsedGenerator) Generate() <-chan int64