system

package
v0.0.0-...-72cc25f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-2-Clause-Patent Imports: 29 Imported by: 12

Documentation

Index

Constants

View Source
const (
	// FaultDomainSeparator is the dividing character for different levels of a
	// fault domain.
	FaultDomainSeparator = "/"

	// FaultDomainNilStr is the string value of a nil FaultDomain.
	FaultDomainNilStr = "(nil)"

	// FaultDomainRootID is the ID of the root node
	FaultDomainRootID = 1
)
View Source
const RankFaultDomainPrefix = "rank"

RankFaultDomainPrefix is the prefix for rank-level fault domains.

Variables

View Source
var (
	ErrEmptyGroupMap = errors.New("empty group map (all ranks excluded?)")
	ErrRaftUnavail   = errors.New("raft service unavailable (not started yet?)")
	ErrUninitialized = errors.New("system is uninitialized (storage format required?)")
)

Functions

func DelMgmtProperty

func DelMgmtProperty(db SysAttrSetter, key string) error

DelMgmtProperty deletes the MS property for the supplied key.

func ErrSystemAttrNotFound

func ErrSystemAttrNotFound(key string) *errSystemAttrNotFound

func FaultBadFaultDomainDepth

func FaultBadFaultDomainDepth(domain *FaultDomain, expDepth int) *fault.Fault

FaultBadFaultDomainDepth generates a fault indicating that the server could not join because its fault domain depth was inconsistent with already-joined members.

func FaultPoolLocked

func FaultPoolLocked(poolUUID, lockID uuid.UUID, lockTime time.Time) *fault.Fault

FaultPoolLocked generates a fault indicating that the pool is locked.

func GetAttributes

func GetAttributes(db SysAttrGetter, keys []string) (map[string]string, error)

GetAttributes returns the user-viewable system attributes for the supplied keys.

func GetMgmtProperty

func GetMgmtProperty(db SysAttrGetter, key string) (string, error)

GetMgmtProperty returns the MS property for the supplied key.

func GetUserProperties

func GetUserProperties(db SysAttrGetter, sysProps daos.SystemPropertyMap, keys []string) (map[string]string, error)

GetUserProperties returns the user-visible properties for the supplied keys, or all user-visible properties if no keys are supplied.

func GetUserProperty

func GetUserProperty(db SysAttrGetter, sysProps daos.SystemPropertyMap, key string) (val string, err error)

GetUserProperty returns a single user-visible property for the supplied key, or an error if the key is unknown.

func IsEmptyGroupMap

func IsEmptyGroupMap(err error) bool

IsEmptyGroupMap returns a boolean indicating whether or not the supplied error corresponds to an empty system group map.

func IsErrSystemAttrNotFound

func IsErrSystemAttrNotFound(err error) bool

func IsJoinFailure

func IsJoinFailure(err error) bool

IsJoinFailure returns a boolean indicating whether or not the supplied error is an instance of ErrJoinFailure.

func IsMemberExists

func IsMemberExists(err error) bool

IsMemberExists returns a boolean indicating whether or not the supplied error is an instance of ErrMemberExists.

func IsMemberNotFound

func IsMemberNotFound(err error) bool

IsMemberNotFound returns a boolean indicating whether or not the supplied error is an instance of ErrMemberNotFound.

func IsNotLeader

func IsNotLeader(err error) bool

IsNotLeader returns a boolean indicating whether or not the supplied error is an instance of ErrNotLeader.

func IsNotReady

func IsNotReady(err error) bool

IsNotReady is a convenience function for checking if an error indicates that the system is not ready to serve requests.

func IsNotReplica

func IsNotReplica(err error) bool

IsNotReplica returns a boolean indicating whether or not the supplied error is an instance of ErrNotReplica.

func IsPoolNotFound

func IsPoolNotFound(err error) bool

IsPoolNotFound returns a boolean indicating whether or not the supplied error is an instance of ErrPoolNotFound.

func IsUnavailable

func IsUnavailable(err error) bool

IsUnavailable returns a boolean indicating whether or not the supplied error corresponds to some unavailability state.

func IsUninitialized

func IsUninitialized(err error) bool

IsUninitialized returns a boolean indicating whether or not the supplied error corresponds to an uninitialized system.

func MockControlAddr

func MockControlAddr(t *testing.T, idx uint32) *net.TCPAddr

func SetAttributes

func SetAttributes(db SysAttrSetter, attrs map[string]string) error

SetAttributes updates the system attributes with the supplied map. To delete an attribute, set the value to an empty string.

func SetMgmtProperty

func SetMgmtProperty(db SysAttrSetter, key, value string) error

SetMgmtProperty updates the MS property for the supplied key/value.

func SetUserProperties

func SetUserProperties(db SysAttrSetter, sysProps daos.SystemPropertyMap, toSet map[string]string) error

SetUserProperties sets the user-visible properties based on the supplied key/value pairs.

func SetUserProperty

func SetUserProperty(db SysAttrSetter, sysProps daos.SystemPropertyMap, key, value string) error

SetUserProperty sets a single user-visible property for the supplied key/value.

Types

type ErrJoinFailure

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

ErrJoinFailure indicates the failure of a Join request due to some structured error condition.

func ErrAdminExcluded

func ErrAdminExcluded(uuid uuid.UUID, rank ranklist.Rank) *ErrJoinFailure

func ErrRankChanged

func ErrRankChanged(new, cur ranklist.Rank, uuid uuid.UUID) *ErrJoinFailure

func ErrUuidChanged

func ErrUuidChanged(new, cur uuid.UUID, rank ranklist.Rank) *ErrJoinFailure

func (*ErrJoinFailure) Error

func (err *ErrJoinFailure) Error() string

type ErrMemberExists

type ErrMemberExists struct {
	Rank *ranklist.Rank
	UUID *uuid.UUID
}

ErrMemberExists indicates the failure of an operation that expected the given member to not exist.

func ErrRankExists

func ErrRankExists(r ranklist.Rank) *ErrMemberExists

func ErrUuidExists

func ErrUuidExists(u uuid.UUID) *ErrMemberExists

func (*ErrMemberExists) Error

func (err *ErrMemberExists) Error() string

type ErrMemberNotFound

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

ErrMemberNotFound indicates a failure to find a member with the given search criterion.

func ErrMemberAddrNotFound

func ErrMemberAddrNotFound(a *net.TCPAddr) *ErrMemberNotFound

func ErrMemberRankNotFound

func ErrMemberRankNotFound(r ranklist.Rank) *ErrMemberNotFound

func ErrMemberUUIDNotFound

func ErrMemberUUIDNotFound(u uuid.UUID) *ErrMemberNotFound

func (*ErrMemberNotFound) Error

func (err *ErrMemberNotFound) Error() string

type ErrNotLeader

type ErrNotLeader struct {
	LeaderHint string
	Replicas   []string
}

ErrNotLeader indicates that a request was made to a control plane instance that is not the current Management Service Leader.

func (*ErrNotLeader) Error

func (err *ErrNotLeader) Error() string

type ErrNotReplica

type ErrNotReplica struct {
	Replicas []string
}

ErrNotReplica indicates that a request was made to a control plane instance that is not a designated Management Service replica.

func (*ErrNotReplica) Error

func (err *ErrNotReplica) Error() string

type ErrPoolNotFound

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

ErrPoolNotFound indicates a failure to find a pool service with the given search criterion.

func ErrPoolLabelNotFound

func ErrPoolLabelNotFound(l string) *ErrPoolNotFound

func ErrPoolRankNotFound

func ErrPoolRankNotFound(r ranklist.Rank) *ErrPoolNotFound

func ErrPoolUUIDNotFound

func ErrPoolUUIDNotFound(u uuid.UUID) *ErrPoolNotFound

func (*ErrPoolNotFound) Error

func (err *ErrPoolNotFound) Error() string

func (*ErrPoolNotFound) MarshalJSON

func (err *ErrPoolNotFound) MarshalJSON() ([]byte, error)

func (*ErrPoolNotFound) UnmarshalJSON

func (err *ErrPoolNotFound) UnmarshalJSON(data []byte) error

type FaultDomain

type FaultDomain struct {
	Domains []string // Hierarchical sequence of fault domain levels
}

FaultDomain represents a multi-layer fault domain.

func MemberFaultDomain

func MemberFaultDomain(m *Member) *FaultDomain

MemberFaultDomain generates a standardized fault domain for a Member, based on its parent fault domain and rank.

func MustCreateFaultDomain

func MustCreateFaultDomain(domains ...string) *FaultDomain

MustCreateFaultDomain creates a FaultDomain from a sequence of strings representing individual levels of the domain. If it is not possible to create a valid FaultDomain, it panics.

func MustCreateFaultDomainFromString

func MustCreateFaultDomainFromString(domainStr string) *FaultDomain

MustCreateFaultDomainFromString creates a FaultDomain from a string in the fault domain path format. If it is not possible to create a valid FaultDomain, it panics.

func NewFaultDomain

func NewFaultDomain(domains ...string) (*FaultDomain, error)

NewFaultDomain creates a FaultDomain from a sequence of strings representing individual levels of the domain. For each level of the domain, we assume case insensitivity and trim leading/trailing whitespace.

func NewFaultDomainFromString

func NewFaultDomainFromString(domainStr string) (*FaultDomain, error)

NewFaultDomainFromString creates a FaultDomain from a string in the fault domain path format (example: /rack0/pdu1/hostname). If the string isn't formatted correctly, returns an error.

func (*FaultDomain) BottomLevel

func (f *FaultDomain) BottomLevel() string

BottomLevel returns the descriptor for the lowest level of this fault domain.

func (*FaultDomain) Empty

func (f *FaultDomain) Empty() bool

Empty checks whether the fault domain is empty or not.

func (*FaultDomain) Equals

func (f *FaultDomain) Equals(other *FaultDomain) bool

Equals checks if the fault domains are equal.

func (*FaultDomain) IsAncestorOf

func (f *FaultDomain) IsAncestorOf(d *FaultDomain) bool

IsAncestorOf determines if this fault domain is an ancestor of the one passed in. This includes a 0th-degree ancestor (i.e. it is identical).

func (*FaultDomain) Level

func (f *FaultDomain) Level(level int) (string, error)

Level returns the descriptor for the requested level of the fault domain. Level 0 is the bottom level. Level (n - 1) is the top level.

func (*FaultDomain) MustCreateChild

func (f *FaultDomain) MustCreateChild(childLevel string) *FaultDomain

MustCreateChild creates a child fault domain. If that is not possible, it panics.

func (*FaultDomain) NewChild

func (f *FaultDomain) NewChild(childLevel string) (*FaultDomain, error)

NewChild creates a FaultDomain with a level below this one.

func (*FaultDomain) NumLevels

func (f *FaultDomain) NumLevels() int

NumLevels gets the number of levels in the domain.

func (*FaultDomain) String

func (f *FaultDomain) String() string

func (*FaultDomain) TopLevel

func (f *FaultDomain) TopLevel() string

TopLevel returns the descriptor for the highest level of this fault domain below the root.

type FaultDomainTree

type FaultDomainTree struct {
	Domain   *FaultDomain
	ID       uint32
	Children []*FaultDomainTree
}

FaultDomainTree is a node in a tree of FaultDomain objects. This tree structure is not thread-safe and callers are expected to add access synchronization if needed.

func NewFaultDomainTree

func NewFaultDomainTree(domains ...*FaultDomain) *FaultDomainTree

NewFaultDomainTree creates a FaultDomainTree including all the passed-in fault domains.

func (*FaultDomainTree) AddDomain

func (t *FaultDomainTree) AddDomain(domain *FaultDomain) error

AddDomain adds a child fault domain, including intermediate nodes, to the fault domain tree.

func (*FaultDomainTree) Copy

func (t *FaultDomainTree) Copy() *FaultDomainTree

Copy creates a copy of the full FaultDomainTree in memory.

func (*FaultDomainTree) Depth

func (t *FaultDomainTree) Depth() int

Depth determines the overall depth of the tree.

func (*FaultDomainTree) Domains

func (t *FaultDomainTree) Domains() []*FaultDomain

Domains returns the list of domains needed to reconstruct the tree.

func (*FaultDomainTree) IsBalanced

func (t *FaultDomainTree) IsBalanced() bool

IsBalanced verifies that all the branches of the tree are the same depth.

func (*FaultDomainTree) IsLeaf

func (t *FaultDomainTree) IsLeaf() bool

IsLeaf verifies if the FaultDomainTree is a leaf node.

func (*FaultDomainTree) IsRoot

func (t *FaultDomainTree) IsRoot() bool

IsRoot verifies if the FaultDomainTree is a root node.

func (*FaultDomainTree) Merge

func (t *FaultDomainTree) Merge(t2 *FaultDomainTree) error

Merge merges another FaultDomainTree into this one.

func (*FaultDomainTree) RemoveDomain

func (t *FaultDomainTree) RemoveDomain(domain *FaultDomain) error

RemoveDomain removes a given fault domain from the tree.

func (*FaultDomainTree) String

func (t *FaultDomainTree) String() string

func (*FaultDomainTree) Subtree

func (t *FaultDomainTree) Subtree(domains ...*FaultDomain) (*FaultDomainTree, error)

Subtree returns the subtree represented by the set of domains.

func (*FaultDomainTree) WithID

func (t *FaultDomainTree) WithID(id uint32) *FaultDomainTree

WithID changes the integer ID of the FaultDomainTree node.

func (*FaultDomainTree) WithNodeDomain

func (t *FaultDomainTree) WithNodeDomain(domain *FaultDomain) *FaultDomainTree

WithNodeDomain changes the domain of the FaultDomainTree node.

type JoinRequest

type JoinRequest struct {
	Rank                    Rank
	UUID                    uuid.UUID
	ControlAddr             *net.TCPAddr
	PrimaryFabricURI        string
	SecondaryFabricURIs     []string
	FabricContexts          uint32
	SecondaryFabricContexts []uint32
	FaultDomain             *FaultDomain
	Incarnation             uint64
	CheckMode               bool
}

JoinRequest contains information needed for join membership update.

type JoinResponse

type JoinResponse struct {
	Member     *Member
	Created    bool
	PrevState  MemberState
	MapVersion uint32
}

JoinResponse contains information returned from join membership update.

type Member

type Member struct {
	Rank                    ranklist.Rank `json:"rank"`
	Incarnation             uint64        `json:"incarnation"`
	UUID                    uuid.UUID     `json:"uuid"`
	Addr                    *net.TCPAddr  `json:"addr"`
	PrimaryFabricURI        string        `json:"fabric_uri"`
	SecondaryFabricURIs     []string      `json:"secondary_fabric_uris"`
	PrimaryFabricContexts   uint32        `json:"fabric_contexts"`
	SecondaryFabricContexts []uint32      `json:"secondary_fabric_contexts"`
	State                   MemberState   `json:"-"`
	Info                    string        `json:"info"`
	FaultDomain             *FaultDomain  `json:"fault_domain"`
	LastUpdate              time.Time     `json:"last_update"`
}

Member refers to a data-plane instance that is a member of this DAOS system running on host with the control-plane listening at "Addr".

func MockMember

func MockMember(t *testing.T, idx uint32, state MemberState, info ...string) *Member

MockMember returns a system member with appropriate values.

func MockMemberFullSpec

func MockMemberFullSpec(t *testing.T, rank Rank, uuidStr string, uri string, addr *net.TCPAddr, state MemberState) *Member

MockMemberFullSpec returns a reference to a new member struct.

func NewMember

func NewMember(rank ranklist.Rank, uuidStr string, uris []string, addr *net.TCPAddr, state MemberState) *Member

NewMember returns a reference to a new member struct.

func (*Member) FabricURIs

func (sm *Member) FabricURIs() []string

FabricURIs returns all fabric URIs, with the primary URI first.

func (*Member) MarshalJSON

func (sm *Member) MarshalJSON() ([]byte, error)

MarshalJSON marshals system.Member to JSON.

func (*Member) String

func (sm *Member) String() string

func (*Member) UnmarshalJSON

func (sm *Member) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals system.Member from JSON.

func (*Member) WithFaultDomain

func (sm *Member) WithFaultDomain(fd *FaultDomain) *Member

WithFaultDomain adds the fault domain field and returns the updated member.

func (*Member) WithInfo

func (sm *Member) WithInfo(msg string) *Member

WithInfo adds info field and returns updated member.

type MemberResult

type MemberResult struct {
	Addr    string
	Rank    ranklist.Rank
	Action  string
	Errored bool
	Msg     string
	State   MemberState `json:"state"`
}

MemberResult refers to the result of an action on a Member.

func MockMemberResult

func MockMemberResult(rank Rank, action string, err error, state MemberState) *MemberResult

MockMemberResult return a result from an action on a system member.

func NewMemberResult

func NewMemberResult(rank ranklist.Rank, err error, state MemberState, action ...string) *MemberResult

NewMemberResult returns a reference to a new member result struct.

Host address and action fields are not always used so not populated here.

func (*MemberResult) Equals

func (mr *MemberResult) Equals(other *MemberResult) bool

Equals returns true if dereferenced structs share the same field values.

func (*MemberResult) MarshalJSON

func (mr *MemberResult) MarshalJSON() ([]byte, error)

MarshalJSON marshals system.MemberResult to JSON.

func (*MemberResult) UnmarshalJSON

func (mr *MemberResult) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals system.MemberResult from JSON.

type MemberResults

type MemberResults []*MemberResult

MemberResults is a type alias for a slice of member result references.

func (MemberResults) Errors

func (mrs MemberResults) Errors() error

Errors returns an error indicating if and which ranks failed.

type MemberState

type MemberState int

MemberState represents the activity state of DAOS system members.

const (
	// MemberStateUnknown is the default invalid state.
	MemberStateUnknown MemberState = 0x0000
	// MemberStateAwaitFormat indicates the member is waiting for format.
	MemberStateAwaitFormat MemberState = 0x0001
	// MemberStateStarting indicates the member has started but is not
	// ready.
	MemberStateStarting MemberState = 0x0002
	// MemberStateReady indicates the member has setup successfully.
	MemberStateReady MemberState = 0x0004
	// MemberStateJoined indicates the member has joined the system.
	MemberStateJoined MemberState = 0x0008
	// MemberStateStopping indicates prep-shutdown successfully run.
	MemberStateStopping MemberState = 0x0010
	// MemberStateStopped indicates process has been stopped.
	MemberStateStopped MemberState = 0x0020
	// MemberStateExcluded indicates rank has been automatically excluded from DAOS system.
	MemberStateExcluded MemberState = 0x0040
	// MemberStateErrored indicates the process stopped with errors.
	MemberStateErrored MemberState = 0x0080
	// MemberStateUnresponsive indicates the process is not responding.
	MemberStateUnresponsive MemberState = 0x0100
	// MemberStateAdminExcluded indicates that the rank has been administratively excluded.
	MemberStateAdminExcluded MemberState = 0x0200
	// MemberStateCheckerStarted indicates that the rank is running in checker mode.
	MemberStateCheckerStarted MemberState = 0x0400
	// MemberStateMax is the last entry indicating end of list.
	MemberStateMax MemberState = 0x0800

	// ExcludedMemberFilter defines the state(s) to be used when determining
	// whether or not a member should be excluded from CaRT group map updates.
	ExcludedMemberFilter = MemberStateAwaitFormat | MemberStateExcluded | MemberStateAdminExcluded
	// AvailableMemberFilter defines the state(s) to be used when determining
	// whether or not a member is available for the purposes of pool creation, etc.
	AvailableMemberFilter = MemberStateReady | MemberStateJoined
	// AllMemberFilter will match all valid member states.
	AllMemberFilter = MemberState(0xFFFF)
	// NonExcludedMemberFilter matches all members that don't match the ExcludedMemberFilter.
	NonExcludedMemberFilter = AllMemberFilter ^ ExcludedMemberFilter
)

func MemberStateFromString

func MemberStateFromString(in string) MemberState

func MemberStates2Mask

func MemberStates2Mask(desiredStates ...MemberState) (MemberState, bool)

MemberStates2Mask returns a state bitmask and a flag indicating whether to include the "Unknown" state from an input list of desired member states.

func (MemberState) String

func (ms MemberState) String() string

type MemberStore

type MemberStore interface {
	MemberCount(...MemberState) (int, error)
	MemberRanks(...MemberState) ([]Rank, error)
	FindMemberByRank(rank Rank) (*Member, error)
	FindMemberByUUID(uuid uuid.UUID) (*Member, error)
	AllMembers() ([]*Member, error)
	AddMember(member *Member) error
	UpdateMember(member *Member) error
	RemoveMember(member *Member) error
	CurMapVersion() (uint32, error)
	FaultDomainTree() *FaultDomainTree
}

type Members

type Members []*Member

Members is a type alias for a slice of member references

type Membership

type Membership struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Membership tracks details of system members.

func MockMembership

func MockMembership(t *testing.T, log logging.Logger, mdb MemberStore, resolver TCPResolver) *Membership

MockMembership returns an initialized *Membership using the given MemberStore.

func NewMembership

func NewMembership(log logging.Logger, mdb MemberStore) *Membership

NewMembership returns a reference to a new DAOS system membership.

func (*Membership) Add

func (m *Membership) Add(member *Member) (int, error)

Add adds member to membership, returns member count.

func (*Membership) AddOrReplace

func (m *Membership) AddOrReplace(newMember *Member) error

AddOrReplace adds member to membership or replaces member if it exists.

Note: this method updates state without checking if state transition is legal so use with caution.

func (*Membership) CheckHosts

func (m *Membership) CheckHosts(hosts string, ctlPort int) (*RankSet, *hostlist.HostSet, error)

CheckHosts returns set of all ranks on any of the hosts in provided host set string and another slice of all hosts from input hostset string that are missing from the membership. Host addresses are resolved before looking up resident ranks to verify destination server is still available.

func (*Membership) CheckRanks

func (m *Membership) CheckRanks(ranks string) (hit, miss *RankSet, err error)

CheckRanks returns rank sets of existing and missing membership ranks from provided rank set string, if empty string is given then return hit rank set containing all ranks in the membership.

func (*Membership) CompressedFaultDomainTree

func (m *Membership) CompressedFaultDomainTree(ranks ...uint32) ([]uint32, error)

CompressedFaultDomainTree returns the tree of fault domains of joined members in a compressed format. Each domain is represented as a tuple: (level, ID, number of children) Except for the rank, which is represented as: (rank) The order of items is a breadth-first traversal of the tree.

func (*Membership) Count

func (m *Membership) Count() (int, error)

Count returns the number of members.

func (*Membership) Get

func (m *Membership) Get(rank Rank) (*Member, error)

Get retrieves member reference from membership based on Rank.

func (*Membership) HostList

func (m *Membership) HostList(rankSet *RankSet) []string

HostList returns slice of control addresses that contain any of the ranks in the input rank list.

If input rank list is empty, return all hosts in membership and ignore ranks that are not in the membership.

func (*Membership) HostRanks

func (m *Membership) HostRanks(rankSet *RankSet) map[string][]Rank

HostRanks returns mapping of control addresses to ranks managed by harness at that address.

Filter to include only host keys with any of the provided ranks, if supplied.

func (*Membership) Join

func (m *Membership) Join(req *JoinRequest) (resp *JoinResponse, err error)

Join creates or updates an entry in the membership for the given JoinRequest.

func (*Membership) MarkRankDead

func (m *Membership) MarkRankDead(rank Rank, incarnation uint64) error

MarkRankDead is a helper method to mark a rank as dead in response to a swim_rank_dead event.

func (*Membership) Members

func (m *Membership) Members(rankSet *RankSet, desiredStates ...MemberState) (members Members, err error)

Members returns slice of references to all system members ordered by rank.

Empty rank list implies no filtering/include all and ignore ranks that are not in the membership. Optionally filter on desired states.

func (*Membership) OnEvent

func (m *Membership) OnEvent(_ context.Context, evt *events.RASEvent)

OnEvent handles events on channel and updates member states accordingly.

func (*Membership) RankList

func (m *Membership) RankList() ([]Rank, error)

RankList returns slice of all ordered member ranks.

func (*Membership) Remove

func (m *Membership) Remove(rank Rank)

Remove removes member from membership, idempotent.

func (*Membership) UpdateMemberStates

func (m *Membership) UpdateMemberStates(results MemberResults, updateOnFail bool) error

UpdateMemberStates updates member's state according to result state.

If updateOnFail is false, only update member state and info if result is a success, if true then update state even if result is errored.

func (*Membership) WithTCPResolver

func (m *Membership) WithTCPResolver(resolver TCPResolver) *Membership

WithTCPResolver adds a resolveTCPFn to the membership structure.

type PoolService

type PoolService struct {
	PoolUUID   uuid.UUID
	PoolLabel  string
	State      PoolServiceState
	Replicas   []Rank
	Storage    *PoolServiceStorage
	LastUpdate time.Time
}

PoolService represents a pool service created to manage metadata for a DAOS Pool.

func NewPoolService

func NewPoolService(uuid uuid.UUID, tierStorage []uint64, ranks []Rank) *PoolService

NewPoolService returns a properly-initialized *PoolService.

type PoolServiceState

type PoolServiceState uint

PoolServiceState is used to represent the state of the pool service

const (
	// PoolServiceStateCreating indicates that the pool service is being created
	PoolServiceStateCreating PoolServiceState = iota
	// PoolServiceStateReady indicates that the pool service is ready to be used
	PoolServiceStateReady
	// PoolServiceStateDestroying indicates that the pool service is being destroyed
	PoolServiceStateDestroying
	// PoolServiceStateDegraded indicates that the pool service is being Degraded
	PoolServiceStateDegraded
	// PoolServiceStateUnknown indicates that the pool service is Unknown state
	PoolServiceStateUnknown
)

func (PoolServiceState) MarshalJSON

func (pss PoolServiceState) MarshalJSON() ([]byte, error)

func (PoolServiceState) String

func (pss PoolServiceState) String() string

func (*PoolServiceState) UnmarshalJSON

func (pss *PoolServiceState) UnmarshalJSON(data []byte) error

type PoolServiceStorage

type PoolServiceStorage struct {
	sync.Mutex
	CreationRankStr string // string rankset set at creation

	CurrentRankStr string // string rankset representing current ranks

	PerRankTierStorage []uint64 // storage allocated to each tier on a rank
	// contains filtered or unexported fields
}

PoolServiceStorage holds information about the pool storage.

func (*PoolServiceStorage) CreationRanks

func (pss *PoolServiceStorage) CreationRanks() []Rank

CreationRanks returns the set of target ranks associated with the pool's creation.

func (*PoolServiceStorage) CurrentRanks

func (pss *PoolServiceStorage) CurrentRanks() []Rank

CurrentRanks returns the set of target ranks associated with the pool's current.

func (*PoolServiceStorage) String

func (pss *PoolServiceStorage) String() string

func (*PoolServiceStorage) TotalNVMe

func (pss *PoolServiceStorage) TotalNVMe() uint64

TotalNVMe returns the total amount of NVMe storage allocated to the pool, calculated from the current set of ranks multiplied by the per-rank NVMe allocation made at creation time.

func (*PoolServiceStorage) TotalSCM

func (pss *PoolServiceStorage) TotalSCM() uint64

TotalSCM returns the total amount of SCM storage allocated to the pool, calculated from the current set of ranks multiplied by the per-rank SCM allocation made at creation time.

type RankGroups

type RankGroups map[string]*ranklist.RankSet

RankGroups maps a set of ranks to string value (group).

func (RankGroups) FromMemberResults

func (rgs RankGroups) FromMemberResults(results MemberResults, fieldSep string) error

FromMemberResults initializes groupings of ranks that had a particular result from a requested action, populated from a slice of system member results.

Supplied fieldsep parameter is used to separate row field elements in the string that is used as the key for the rank groups.

func (RankGroups) FromMembers

func (rgs RankGroups) FromMembers(members Members) error

FromMembers initializes groupings of ranks that are at a particular state from a slice of system members.

func (RankGroups) Keys

func (rgs RankGroups) Keys() []string

Keys returns sorted group names.

Sort first by number of ranks in grouping then by alphabetical order of group name.

func (RankGroups) String

func (rgs RankGroups) String() string

type SysAttrGetter

type SysAttrGetter interface {
	GetSystemAttrs(keys []string, filterFn func(string) bool) (map[string]string, error)
}

SysAttrGetter defines an interface to be implemented by something that can get system properties.

type SysAttrSetter

type SysAttrSetter interface {
	SetSystemAttrs(props map[string]string) error
}

SysAttrSetter defines an interface to be implemented by something that can set system properties.

type TCPResolver

type TCPResolver func(string, string) (*net.TCPAddr, error)

TCPResolver is a type alias for the net.ResolveTCPAddr function signature.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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