master

package
v0.0.0-...-f2d997f Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxHeartbeatDuration time.Duration = time.Second * 10

Functions

This section is empty.

Types

type Master

type Master struct {
	Port       int
	PublicPort int

	VMStatusList   []*VolumeManagerStatus
	VStatusListMap map[uint64][]*VolumeStatus

	Server *http.ServeMux

	PublicServer *http.ServeMux

	Metadata    Metadata
	Replication [3]int
	// contains filtered or unexported fields
}

func NewMaster

func NewMaster() (*Master, error)

func (*Master) Start

func (m *Master) Start()

func (*Master) Stop

func (m *Master) Stop()

type Metadata

type Metadata interface {
	Get(filePath string) (vid uint64, fid uint64, fileName string, err error)
	Set(filePath string, vid uint64, fid uint64, fileName string) error
	Delete(filePath string) error
	Has(filePath string) bool
	io.Closer
}

type MetadataRedis

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

func NewMetadataRedis

func NewMetadataRedis(host string, port int, password string, database int) (*MetadataRedis, error)

func (*MetadataRedis) Close

func (m *MetadataRedis) Close() error

func (*MetadataRedis) Delete

func (m *MetadataRedis) Delete(filePath string) error

func (*MetadataRedis) Get

func (m *MetadataRedis) Get(filePath string) (vid uint64, fid uint64, fileName string, err error)

func (*MetadataRedis) Has

func (m *MetadataRedis) Has(filePath string) bool

func (*MetadataRedis) Set

func (m *MetadataRedis) Set(filePath string, vid uint64, fid uint64, fileName string) error

type Size

type Size interface {
	Size() int64
}

type VolumeManagerStatus

type VolumeManagerStatus struct {
	AdminHost  string
	AdminPort  int
	PublicHost string
	PublicPort int

	Machine    string
	DataCenter string

	DiskSize        uint64
	DiskUsed        uint64
	DiskFree        uint64
	MaxDiskUsed     uint64
	CanCreateVolume bool

	VolumeMaxSize uint64

	LastHeartbeat time.Time `json:"-"`

	VStatusList []*VolumeStatus
}

func (*VolumeManagerStatus) IsAlive

func (vms *VolumeManagerStatus) IsAlive() bool

type VolumeStatus

type VolumeStatus struct {
	Id           uint64
	DataFileSize uint64
	MaxFreeSpace uint64

	Writable bool
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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