Documentation ¶
Index ¶
- Constants
- type ClusterConfiguration
- type ClusterState
- func (s *ClusterState) ActiveMASH() *MASHMap
- func (s *ClusterState) ActiveMembers() int
- func (cs *ClusterState) GapPercentage() float64
- func (s *ClusterState) HasLeader() bool
- func (cs *ClusterState) Healthy() bool
- func (s *ClusterState) IdealLeader() uint32
- func (s *ClusterState) IdealMash() *MASHMap
- func (s *ClusterState) MashAt(v int64) *MASHMap
- func (s *ClusterState) ProposedMASH() *MASHMap
- func (s *ClusterState) ProposedMashNumber() (proposed int64, active int64, allmax bool)
- func (cs *ClusterState) String() string
- type Configuration
- type FileConfig
- func (c *FileConfig) BlockCache() int
- func (c *FileConfig) ClusterEnabled() bool
- func (c *FileConfig) ClusterEtcdEndpoints() []string
- func (c *FileConfig) ClusterPrefix() string
- func (c *FileConfig) CoalesceMaxInterval() int
- func (c *FileConfig) CoalesceMaxPoints() int
- func (c *FileConfig) GRPCAdvertise() []string
- func (c *FileConfig) GRPCEnabled() bool
- func (c *FileConfig) GRPCListen() string
- func (c *FileConfig) HttpAdvertise() []string
- func (c *FileConfig) HttpEnabled() bool
- func (c *FileConfig) HttpListen() string
- func (c *FileConfig) RadosReadCache() int
- func (c *FileConfig) RadosWriteCache() int
- func (c *FileConfig) StorageCephConf() string
- func (c *FileConfig) StorageCephDataPool() string
- func (c *FileConfig) StorageCephHotPool() string
- func (c *FileConfig) StorageFilepath() string
- type MASHMap
- func (currentMash *MASHMap) CompatibleIntermediateMash(idealMash *MASHMap) *MASHMap
- func (mm *MASHMap) Equivalent(rhs *MASHMap) bool
- func (mm *MASHMap) Gap() int64
- func (mm *MASHMap) IntersectWithFreeSpace(r *MashRange, excluding uint32) *MashRange
- func (mm *MASHMap) Len() int
- func (mm *MASHMap) Less(i, j int) bool
- func (mm *MASHMap) String() string
- func (mm *MASHMap) Swap(i, j int)
- type MashRange
- type Member
Constants ¶
View Source
const HASHRANGE_END = (1 << 32)
View Source
const True = "true"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterConfiguration ¶
type ClusterConfiguration interface { // Returns true if we hold the write lock for the given uuid. Returns false // if we do not have the write lock, or we are trying to get rid of the write // lock WeHoldWriteLockFor(uuid []byte) bool WatchMASHChange(w func(flushComplete chan bool)) PeerHTTPAdvertise(nodename string) ([]string, error) PeerGRPCAdvertise(nodename string) ([]string, error) GetCachedClusterState() *ClusterState // MASHNumber() int64 // Called when the node knows it is faulty (generally pre-panic). This // removes the delay that would normally accompany the lease expiry Fault(fz string, args ...interface{}) // Get a tunable, and watch it for all future changes. Only meant to be // used by Rez WatchTunable(name string, onchange func(v string)) error GetEtcdClient() *etcd.Client }
type ClusterState ¶
type ClusterState struct { Revision int64 Members map[string]*Member Mashes map[int64]map[string]*MashRange Leader string LeaderRevision int64 // contains filtered or unexported fields }
func QueryClusterState ¶
func (*ClusterState) ActiveMASH ¶
func (s *ClusterState) ActiveMASH() *MASHMap
func (*ClusterState) ActiveMembers ¶
func (s *ClusterState) ActiveMembers() int
func (*ClusterState) GapPercentage ¶
func (cs *ClusterState) GapPercentage() float64
func (*ClusterState) HasLeader ¶
func (s *ClusterState) HasLeader() bool
func (*ClusterState) Healthy ¶
func (cs *ClusterState) Healthy() bool
func (*ClusterState) IdealLeader ¶
func (s *ClusterState) IdealLeader() uint32
func (*ClusterState) IdealMash ¶
func (s *ClusterState) IdealMash() *MASHMap
func (*ClusterState) MashAt ¶
func (s *ClusterState) MashAt(v int64) *MASHMap
func (*ClusterState) ProposedMASH ¶
func (s *ClusterState) ProposedMASH() *MASHMap
func (*ClusterState) ProposedMashNumber ¶
func (s *ClusterState) ProposedMashNumber() (proposed int64, active int64, allmax bool)
Highest map num, all at max
func (*ClusterState) String ¶
func (cs *ClusterState) String() string
type Configuration ¶
type Configuration interface { ClusterEnabled() bool ClusterPrefix() string ClusterEtcdEndpoints() []string StorageCephConf() string StorageFilepath() string StorageCephDataPool() string StorageCephHotPool() string HttpEnabled() bool HttpListen() string HttpAdvertise() []string GRPCEnabled() bool GRPCListen() string GRPCAdvertise() []string BlockCache() int RadosReadCache() int RadosWriteCache() int // Note that these are "live" and called in the hotpath, so buffer them CoalesceMaxPoints() int CoalesceMaxInterval() int }
func LoadEtcdConfig ¶
func LoadEtcdConfig(cfg Configuration, nodename string) (Configuration, error)
The file config is loaded first, and used to bootstrap etcd if requred
func LoadFileConfig ¶
func LoadFileConfig(path string) (Configuration, error)
type FileConfig ¶
type FileConfig struct { Cluster struct { Prefix string EtcdEndpoint []string Enabled bool } Http struct { Listen string Advertise []string Enabled bool } Grpc struct { Listen string Advertise []string Enabled bool } Storage struct { Filepath string CephDataPool string CephHotPool string CephConf string } Cache struct { BlockCache int RadosWriteCache int RadosReadCache int } Debug struct { Cpuprofile bool Heapprofile bool } Coalescence struct { MaxPoints int Interval int } }
func (*FileConfig) BlockCache ¶
func (c *FileConfig) BlockCache() int
func (*FileConfig) ClusterEnabled ¶
func (c *FileConfig) ClusterEnabled() bool
func (*FileConfig) ClusterEtcdEndpoints ¶
func (c *FileConfig) ClusterEtcdEndpoints() []string
func (*FileConfig) ClusterPrefix ¶
func (c *FileConfig) ClusterPrefix() string
func (*FileConfig) CoalesceMaxInterval ¶
func (c *FileConfig) CoalesceMaxInterval() int
func (*FileConfig) CoalesceMaxPoints ¶
func (c *FileConfig) CoalesceMaxPoints() int
func (*FileConfig) GRPCAdvertise ¶
func (c *FileConfig) GRPCAdvertise() []string
func (*FileConfig) GRPCEnabled ¶
func (c *FileConfig) GRPCEnabled() bool
func (*FileConfig) GRPCListen ¶
func (c *FileConfig) GRPCListen() string
func (*FileConfig) HttpAdvertise ¶
func (c *FileConfig) HttpAdvertise() []string
func (*FileConfig) HttpEnabled ¶
func (c *FileConfig) HttpEnabled() bool
func (*FileConfig) HttpListen ¶
func (c *FileConfig) HttpListen() string
func (*FileConfig) RadosReadCache ¶
func (c *FileConfig) RadosReadCache() int
func (*FileConfig) RadosWriteCache ¶
func (c *FileConfig) RadosWriteCache() int
func (*FileConfig) StorageCephConf ¶
func (c *FileConfig) StorageCephConf() string
func (*FileConfig) StorageCephDataPool ¶
func (c *FileConfig) StorageCephDataPool() string
func (*FileConfig) StorageCephHotPool ¶
func (c *FileConfig) StorageCephHotPool() string
func (*FileConfig) StorageFilepath ¶
func (c *FileConfig) StorageFilepath() string
type MASHMap ¶
type MASHMap struct { Ranges []*MashRange Hashes []uint32 Nodenames []string Weights []int64 TotalWeight int64 // contains filtered or unexported fields }
func (*MASHMap) CompatibleIntermediateMash ¶
func (*MASHMap) Equivalent ¶
Return true if these maps are identical
func (*MASHMap) IntersectWithFreeSpace ¶
Return the range that is the intersection of mashRange and the free space in mm if you remove 'excluding' (the hash of a node)
Click to show internal directories.
Click to hide internal directories.