Documentation
¶
Index ¶
- func ExecuteCmd(cmd string) ([]byte, error)
- func GetClusterID() (clusterID string)
- func GetGlusterVersion() (string, error)
- type Brick
- type BrickStatus
- type FopStat
- type GCache
- func (gc *GCache) EnableCacheForFuncs(fNames []string)
- func (gc *GCache) EnableVolumeProfiling(vInfo Volume) error
- func (gc *GCache) GConfig() (gConf *conf.GConfig)
- func (gc *GCache) HealInfo(vol string) ([]HealEntry, error)
- func (gc *GCache) IsLeader() (bool, error)
- func (gc *GCache) LocalPeerID() (string, error)
- func (gc *GCache) Peers() ([]Peer, error)
- func (gc *GCache) SetTTL(ttl time.Duration)
- func (gc *GCache) Snapshots() ([]Snapshot, error)
- func (gc *GCache) SplitBrainHealInfo(vol string) ([]HealEntry, error)
- func (gc *GCache) TTL() time.Duration
- func (gc *GCache) VolumeBrickStatus(vol string) ([]BrickStatus, error)
- func (gc *GCache) VolumeInfo() ([]Volume, error)
- func (gc *GCache) VolumeProfileInfo(vol string) ([]ProfileInfo, error)
- func (gc *GCache) VolumeStatus() ([]VolumeStatus, error)
- type GD1
- func (g *GD1) EnableVolumeProfiling(volume Volume) error
- func (g *GD1) GConfig() *conf.GConfig
- func (g GD1) HealInfo(vol string) ([]HealEntry, error)
- func (g *GD1) IsLeader() (bool, error)
- func (g *GD1) LocalPeerID() (string, error)
- func (g *GD1) Peers() ([]Peer, error)
- func (g *GD1) Snapshots() ([]Snapshot, error)
- func (g GD1) SplitBrainHealInfo(vol string) ([]HealEntry, error)
- func (g GD1) VolumeBrickStatus(vol string) ([]BrickStatus, error)
- func (g *GD1) VolumeInfo() ([]Volume, error)
- func (g *GD1) VolumeProfileInfo(vol string) ([]ProfileInfo, error)
- func (g *GD1) VolumeStatus() ([]VolumeStatus, error)
- type GD2
- func (g *GD2) EnableVolumeProfiling(volume Volume) error
- func (g *GD2) GConfig() *conf.GConfig
- func (g GD2) HealInfo(vol string) ([]HealEntry, error)
- func (g *GD2) IsLeader() (bool, error)
- func (g *GD2) LocalPeerID() (string, error)
- func (g *GD2) Peers() ([]Peer, error)
- func (g *GD2) Snapshots() ([]Snapshot, error)
- func (g GD2) SplitBrainHealInfo(vol string) ([]HealEntry, error)
- func (g GD2) VolumeBrickStatus(vol string) ([]BrickStatus, error)
- func (g *GD2) VolumeInfo() ([]Volume, error)
- func (g *GD2) VolumeProfileInfo(vol string) ([]ProfileInfo, error)
- func (g *GD2) VolumeStatus() ([]VolumeStatus, error)
- type GInterface
- type HealEntry
- type Peer
- type ProfileInfo
- type Snapshot
- type SubVolume
- type Volume
- type VolumeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteCmd ¶
ExecuteCmd enables to execute system cmds and returns stdout, err
func GetGlusterVersion ¶
GetGlusterVersion gets the glusterfs version
Types ¶
type Brick ¶
type Brick struct {
Host string `json:"host"`
ID string `json:"id"`
Path string `json:"path"`
PeerID string `json:"peer-id"`
Type string `json:"type"`
VolumeID string `json:"volume-id"`
VolumeName string `json:"volume-name"`
}
Brick represents Gluster Brick
type BrickStatus ¶
type BrickStatus struct {
Hostname string
PeerID string
Status int
PID int
Port int
Path string
Volume string
Capacity uint64
Free uint64
Gd1InodesFree int64 // only valid with GD1, -1 with GD2
Gd1InodesTotal int64 // only valid with GD1, -1 with GD2
}
BrickStatus describes the status details of volume brick
type FopStat ¶
type FopStat struct {
Name string
Hits int
AvgLatency float64
MinLatency float64
MaxLatency float64
}
FopStat defines file ops related details
type GCache ¶
type GCache struct {
// contains filtered or unexported fields
}
GCache is a wrapper around 'GInterface' object
func NewGCache ¶
func NewGCache(gd GInterface) *GCache
NewGCache method creates a new GCache wrapper instance, with 1 minute default time_to_live
func NewGCacheWithTTL ¶
func NewGCacheWithTTL(gd GInterface, ttl time.Duration) *GCache
NewGCacheWithTTL method creates a new GCache wrapper instance. Caching will be disabled if ttl is ZERO
func (*GCache) EnableCacheForFuncs ¶
EnableCacheForFuncs method will enable caching for the given list of functions. If the provided function is not there in the existing list, it will be ignored
func (*GCache) EnableVolumeProfiling ¶
EnableVolumeProfiling method wraps the GInterface.EnableVolumeProfiling call
func (*GCache) LocalPeerID ¶
LocalPeerID method wraps the GInterface.LocalPeerID call
func (*GCache) SplitBrainHealInfo ¶
SplitBrainHealInfo wraps the GInterface.SplitBrainHealInfo call
func (*GCache) VolumeBrickStatus ¶
func (gc *GCache) VolumeBrickStatus(vol string) ([]BrickStatus, error)
VolumeBrickStatus method wraps the GInterface.VolumeBrickStatus call
func (*GCache) VolumeInfo ¶
VolumeInfo method wraps the GInterface.VolumeInfo call
func (*GCache) VolumeProfileInfo ¶
func (gc *GCache) VolumeProfileInfo(vol string) ([]ProfileInfo, error)
VolumeProfileInfo method wraps the GInterface.VolumeProfileInfo call
func (*GCache) VolumeStatus ¶
func (gc *GCache) VolumeStatus() ([]VolumeStatus, error)
VolumeStatus method wraps the GInterface.VolumeStatus call
type GD1 ¶
type GD1 struct {
// contains filtered or unexported fields
}
GD1 enables users to interact with gd1 version
func (*GD1) EnableVolumeProfiling ¶
EnableVolumeProfiling enables profiling for a volume
func (*GD1) GConfig ¶
GConfig method returns the configuration this implements the 'conf.GConfigInterface'
func (*GD1) IsLeader ¶
IsLeader returns true or false based on whether the node is the leader of the cluster or not
func (*GD1) LocalPeerID ¶
LocalPeerID returns local peer ID of glusterd
func (GD1) SplitBrainHealInfo ¶
SplitBrainHealInfo gets gluster vol heal info (GD1)
func (GD1) VolumeBrickStatus ¶
func (g GD1) VolumeBrickStatus(vol string) ([]BrickStatus, error)
VolumeBrickStatus gets brick status info from glusterd2 using rest api
func (*GD1) VolumeInfo ¶
VolumeInfo returns gluster vol info (glusterd)
func (*GD1) VolumeProfileInfo ¶
func (g *GD1) VolumeProfileInfo(vol string) ([]ProfileInfo, error)
VolumeProfileInfo returns profile info details for the volume
func (*GD1) VolumeStatus ¶
func (g *GD1) VolumeStatus() ([]VolumeStatus, error)
VolumeStatus returns gluster vol status (glusterd)
type GD2 ¶
type GD2 struct {
// contains filtered or unexported fields
}
GD2 is struct to interact with Glusterd2 using REST API
func (*GD2) EnableVolumeProfiling ¶
EnableVolumeProfiling enables profiling for a volume
func (*GD2) GConfig ¶
GConfig method returns the configuration this implements the 'conf.GConfigInterface'
func (*GD2) IsLeader ¶
IsLeader returns true or false based on whether the node is the leader of the cluster or not
func (*GD2) LocalPeerID ¶
LocalPeerID returns local peer ID of glusterd2
func (GD2) SplitBrainHealInfo ¶
SplitBrainHealInfo gets heal info from glusterd2 using rest api
func (GD2) VolumeBrickStatus ¶
func (g GD2) VolumeBrickStatus(vol string) ([]BrickStatus, error)
VolumeBrickStatus gets brick status info from glusterd2 using rest api
func (*GD2) VolumeInfo ¶
VolumeInfo returns gluster vol info (glusterd2)
func (*GD2) VolumeProfileInfo ¶
func (g *GD2) VolumeProfileInfo(vol string) ([]ProfileInfo, error)
VolumeProfileInfo returns profile info details for the volume
func (*GD2) VolumeStatus ¶
func (g *GD2) VolumeStatus() ([]VolumeStatus, error)
VolumeStatus returns gluster vol status (glusterd2)
type GInterface ¶
type GInterface interface {
Peers() ([]Peer, error)
LocalPeerID() (string, error)
IsLeader() (bool, error)
HealInfo(vol string) ([]HealEntry, error)
SplitBrainHealInfo(vol string) ([]HealEntry, error)
VolumeInfo() ([]Volume, error)
Snapshots() ([]Snapshot, error)
VolumeProfileInfo(vol string) ([]ProfileInfo, error)
VolumeBrickStatus(vol string) ([]BrickStatus, error)
EnableVolumeProfiling(volinfo Volume) error
VolumeStatus() ([]VolumeStatus, error)
}
GInterface should be implemented in GD1 and GD2 structs
func MakeGluster ¶
func MakeGluster(expConf *conf.Config) (gi GInterface)
MakeGluster returns respective gluster obj based on configuration
type HealEntry ¶
type HealEntry struct {
PeerID string
Hostname string
Brick string
Connected string
NumHealEntries int64
}
HealEntry describe gluster heal info for each brick
type Peer ¶
type Peer struct {
ID string `json:"id"`
PeerAddresses []string `json:"peer-addresses"`
Online bool `json:"online"`
Gd1State int // GD1 only
}
Peer represents a Gluster Peer
type ProfileInfo ¶
type ProfileInfo struct {
BrickName string
Duration uint64
TotalReads uint64
TotalWrites uint64
FopStats []FopStat
DurationInt uint64
TotalReadsInt uint64
TotalWritesInt uint64
FopStatsInt []FopStat
}
ProfileInfo represents volume profile info brickwise
type SubVolume ¶
type SubVolume struct {
ArbiterCount int `json:"arbiter-count"`
Bricks []Brick `json:"bricks"`
DisperseCount int `json:"disperse-count"`
DisperseDataCount int `json:"disperse-data-count"`
DisperseRedundancyCount int `json:"disperse-redundancy-count"`
Name string `json:"name"`
ReplicaCount int `json:"replica-count"`
Type string `json:"type"`
}
SubVolume represents Gluster SubVolume
type Volume ¶
type Volume struct {
DistributeCount int `json:"distribute-count"`
ID string `json:"id"`
Metadata map[string]string `json:"metadata"`
Name string `json:"name"`
Options map[string]string `json:"options"`
SnapList []string `json:"snap-list"`
State string `json:"state"`
SubVolumes []SubVolume `json:"subvols"`
Transport string `json:"transport"`
Type string `json:"type"`
DisperseCount int `json:"disperse-count"`
DisperseDataCount int `json:"disperse-data-count"`
DisperseRedundancyCount int `json:"disperse-redundancy-count"`
ReplicaCount int `json:"replica-count"`
}
Volume represents Gluster Volume
type VolumeStatus ¶
type VolumeStatus struct {
Name string
Nodes []BrickStatus
}
VolumeStatus represents the detailed status of a Gluster volume
Source Files
¶
- brick_status_gd1.go
- brick_status_gd2.go
- cache.go
- common.go
- enable_profile_gd1.go
- enable_profile_gd2.go
- exporterd.go
- gd1.go
- healinfo_gd1.go
- healinfo_gd2.go
- peers_gd1.go
- peers_gd2.go
- profileinfo_gd1.go
- profileinfo_gd2.go
- snapshots_gd1.go
- snapshots_gd2.go
- types.go
- volinfo_gd1.go
- volinfo_gd2.go
- volstatus_gd1.go
- volstatus_gd2.go