directory

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileIdSaveInterval = 10000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileId

type FileId struct {
	VolumeId uint32
	Key      uint64
	Hashcode uint32
}

func NewFileId

func NewFileId(VolumeId uint32, Key uint64, Hashcode uint32) *FileId

func ParseFileId

func ParseFileId(fid string) *FileId

func (*FileId) String

func (n *FileId) String() string

type Machine

type Machine struct {
	Server  MachineInfo
	Volumes []storage.VolumeInfo
}

func NewMachine

func NewMachine(server, publicUrl string, volumes []storage.VolumeInfo) *Machine

type MachineInfo

type MachineInfo struct {
	Url       string //<server name/ip>[:port]
	PublicUrl string
}

type Mapper

type Mapper struct {
	Machines []*Machine

	Writers []uint32 // transient array of Writers volume id

	FileIdSequence uint64
	// contains filtered or unexported fields
}

func NewMapper

func NewMapper(dirname string, filename string, volumeSizeLimit uint64) (m *Mapper)

func (*Mapper) Add

func (m *Mapper) Add(machine Machine)

func (*Mapper) Get

func (m *Mapper) Get(vid uint32) (*Machine, error)

func (*Mapper) NextFileId

func (m *Mapper) NextFileId(c string) (uint64, int)

func (*Mapper) PickForWrite

func (m *Mapper) PickForWrite(c string) (string, int, MachineInfo, error)

Jump to

Keyboard shortcuts

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