diskopt

package
v0.0.0-...-e27f3f3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
	Locations       []*Location
	VolumeSizeLimit uint64
	Ip              string
	Port            int
}

func NewDisk

func NewDisk(dirNames []string, maxVolumeCounts []int, ip string, port int) (v *Disk)

NewDisk 新建磁盘

func (*Disk) AddVolume

func (s *Disk) AddVolume(volumeListString string, collection string, replicaPlacement string, ttlString string, preallocate int64) (err error)

func (*Disk) CheckCompactVolume

func (s *Disk) CheckCompactVolume(volumeIdString string, garbageThresholdString string) (error, bool)

func (*Disk) CommitCompactVolume

func (s *Disk) CommitCompactVolume(volumeIdString string) error

func (*Disk) CompactVolume

func (s *Disk) CompactVolume(volumeIdString string) error

func (*Disk) Delete

func (s *Disk) Delete(i util.VIDType, n *needle.Needle) (uint32, error)

func (*Disk) DeleteVolume

func (s *Disk) DeleteVolume(vid util.VIDType) error

func (*Disk) FindVolume

func (s *Disk) FindVolume(vid util.VIDType) *volume.Volume

func (*Disk) HasVolume

func (s *Disk) HasVolume(i util.VIDType) bool

func (*Disk) ReadVolumeNeedle

func (s *Disk) ReadVolumeNeedle(i util.VIDType, n *needle.Needle) (int, error)

func (*Disk) Status

func (s *Disk) Status() []*volume.VolumeInfo

func (*Disk) Write

func (s *Disk) Write(i util.VIDType, n *needle.Needle) (size uint32, isUnchanged bool, err error)

type Location

type Location struct {
	Directory      string
	MaxVolumeCount int
	Volumes        map[util.VIDType]*volume.Volume
	sync.RWMutex
}

func NewLocation

func NewLocation(dir string, maxVolumeCount int) *Location

func (*Location) DeleteVolumeById

func (l *Location) DeleteVolumeById(vid util.VIDType) (e error)

func (*Location) FindVolume

func (l *Location) FindVolume(vid util.VIDType) (*volume.Volume, bool)

func (*Location) SetVolume

func (l *Location) SetVolume(vid util.VIDType, volume *volume.Volume)

func (*Location) VolumesLen

func (l *Location) VolumesLen() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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