glusterfs

package
v0.0.0-...-a4c6052 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = 1
	MB = KB * 1024
	GB = MB * 1024
	TB = GB * 1024
)
View Source
const (
	VGDISPLAY_SIZE_KB                  = 11
	VGDISPLAY_PHYSICAL_EXTENT_SIZE     = 12
	VGDISPLAY_TOTAL_NUMBER_EXTENTS     = 13
	VGDISPLAY_ALLOCATED_NUMBER_EXTENTS = 14
	VGDISPLAY_FREE_NUMBER_EXTENTS      = 15
)
View Source
const (

	// :TODO: This should be saved on the brick object so that on upgrades
	// or changes it still has the correct older value
	THINP_SNAPSHOT_FACTOR = 1.25
)

Variables

View Source
var (

	// :TODO: Need to add what the maximum number of volumes is
	BRICK_MIN_SIZE = uint64(1 * GB)
	BRICK_MAX_SIZE = uint64(4 * TB)
	BRICK_MAX_NUM  = 200

	ErrNoSpace = errors.New("No space")
)

Functions

This section is empty.

Types

type Brick

type Brick struct {
	Id       string `json:"id"`
	Path     string `json:"path"`
	NodeId   string `json:"node_id"`
	DeviceId string `json:"device_id"`
	Size     uint64 `json:"size"`
	// contains filtered or unexported fields
}

func NewBrick

func NewBrick(size uint64, db *GlusterFSDB) *Brick

func (*Brick) AllocateStorage

func (b *Brick) AllocateStorage(nodeid, deviceid string) error

func (*Brick) Create

func (b *Brick) Create() error

func (*Brick) Destroy

func (b *Brick) Destroy() error

func (*Brick) FreeStorage

func (b *Brick) FreeStorage() error

func (*Brick) Load

func (b *Brick) Load(db *GlusterFSDB)

type BrickNode

type BrickNode struct {
	NodeId   string `json:"meta"`
	DeviceId string `json:"device"`
}

type BrickNodes

type BrickNodes []BrickNode

type GlusterFSDB

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

func NewGlusterFSDB

func NewGlusterFSDB(dbfile string) *GlusterFSDB

func (*GlusterFSDB) Close

func (g *GlusterFSDB) Close()

func (*GlusterFSDB) Commit

func (g *GlusterFSDB) Commit() error

func (*GlusterFSDB) Load

func (g *GlusterFSDB) Load() error

func (*GlusterFSDB) Node

func (g *GlusterFSDB) Node(id string) *NodeEntry

func (*GlusterFSDB) Reader

func (g *GlusterFSDB) Reader(closure func() error) error

func (*GlusterFSDB) Volume

func (g *GlusterFSDB) Volume(id string) *VolumeEntry

func (*GlusterFSDB) Writer

func (g *GlusterFSDB) Writer(closure func() error) error

type GlusterFSDbOnDisk

type GlusterFSDbOnDisk struct {
	Nodes   map[string]*NodeEntry
	Volumes map[string]*VolumeEntry
}

type GlusterFSPlugin

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

func NewGlusterFSPlugin

func NewGlusterFSPlugin() *GlusterFSPlugin

func (*GlusterFSPlugin) Close

func (g *GlusterFSPlugin) Close()

func (*GlusterFSPlugin) NodeAdd

func (*GlusterFSPlugin) NodeAddDevice

func (m *GlusterFSPlugin) NodeAddDevice(id string, req *requests.DeviceAddRequest) error

func (*GlusterFSPlugin) NodeInfo

func (m *GlusterFSPlugin) NodeInfo(id string) (*requests.NodeInfoResp, error)

func (*GlusterFSPlugin) NodeList

func (m *GlusterFSPlugin) NodeList() (*requests.NodeListResponse, error)

func (*GlusterFSPlugin) NodeRemove

func (m *GlusterFSPlugin) NodeRemove(id string) error

func (*GlusterFSPlugin) VolumeCreate

func (*GlusterFSPlugin) VolumeDelete

func (m *GlusterFSPlugin) VolumeDelete(id string) error

func (*GlusterFSPlugin) VolumeInfo

func (m *GlusterFSPlugin) VolumeInfo(id string) (*requests.VolumeInfoResp, error)

func (*GlusterFSPlugin) VolumeList

func (m *GlusterFSPlugin) VolumeList() (*requests.VolumeListResponse, error)

func (*GlusterFSPlugin) VolumeResize

func (m *GlusterFSPlugin) VolumeResize(id string) (*requests.VolumeInfoResp, error)

type GlusterRing

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

func NewGlusterRing

func NewGlusterRing(db *GlusterFSDB) *GlusterRing

func (*GlusterRing) CreateRing

func (g *GlusterRing) CreateRing()

func (*GlusterRing) GetNodes

func (g *GlusterRing) GetNodes(brick_num int, id string) (BrickNodes, error)

type NodeEntry

type NodeEntry struct {
	Info requests.NodeInfoResp
	// contains filtered or unexported fields
}

func NewNodeEntry

func NewNodeEntry(v *requests.NodeAddRequest, db *GlusterFSDB) *NodeEntry

func (*NodeEntry) Copy

func (n *NodeEntry) Copy() *NodeEntry

func (*NodeEntry) Device

func (n *NodeEntry) Device(id string) *requests.DeviceResponse

func (*NodeEntry) DeviceAdd

func (n *NodeEntry) DeviceAdd(req *requests.DeviceRequest) error

func (*NodeEntry) Load

func (n *NodeEntry) Load(db *GlusterFSDB)

type RingOutput

type RingOutput struct {
	Nodes     BrickNodes `json:"nodes"`
	Partition int        `json:"partition"`
}

type VolumeEntry

type VolumeEntry struct {
	Info  requests.VolumeInfoResp
	State VolumeStateResponse
	// contains filtered or unexported fields
}

func NewVolumeEntry

func NewVolumeEntry(v *requests.VolumeCreateRequest,
	bricks []*Brick,
	replica int,
	db *GlusterFSDB) *VolumeEntry

func (*VolumeEntry) Copy

func (v *VolumeEntry) Copy() *VolumeEntry

func (*VolumeEntry) CreateGlusterVolume

func (v *VolumeEntry) CreateGlusterVolume() error

func (*VolumeEntry) Destroy

func (v *VolumeEntry) Destroy() error

func (*VolumeEntry) Load

func (v *VolumeEntry) Load(db *GlusterFSDB)

type VolumeStateResponse

type VolumeStateResponse struct {
	Bricks  []*Brick `json:"bricks"`
	Started bool     `json:"started"`
	Created bool     `json:"created"`
	Replica int      `json:"replica"`
}

Jump to

Keyboard shortcuts

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