Documentation ¶
Overview ¶
Package notifications provides interfaces for AIStore notifications
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package notifications provides interfaces for AIStore notifications
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Index ¶
- func OnFinished(n cluster.Notif, err error)
- func OnProgress(n cluster.Notif)
- type Base
- func (base *Base) LastNotifTime() int64
- func (base *Base) NotifyInterval() time.Duration
- func (base *Base) OnFinishedCB() func(cluster.Notif, error)
- func (base *Base) OnProgressCB() func(cluster.Notif)
- func (base *Base) SetLastNotified(now int64)
- func (base *Base) Subscribers() []string
- func (base *Base) Upon(u cluster.Upon) bool
- type Callback
- type Listener
- type ListenerBase
- func (nlb *ListenerBase) Aborted() bool
- func (nlb *ListenerBase) ActiveCount() int
- func (nlb *ListenerBase) ActiveNotifiers() cluster.NodeMap
- func (nlb *ListenerBase) AddedTime() int64
- func (nlb *ListenerBase) Bcks() []*cmn.Bck
- func (nlb *ListenerBase) Callback(nl Listener, ts int64)
- func (nlb *ListenerBase) EndTime() int64
- func (nlb *ListenerBase) Err() error
- func (nlb *ListenerBase) FinCount() int
- func (nlb *ListenerBase) Finished() bool
- func (nlb *ListenerBase) GetOwner() string
- func (nlb *ListenerBase) HasFinished(node *cluster.Snode) bool
- func (nlb *ListenerBase) Kind() string
- func (nlb *ListenerBase) LastUpdated(si *cluster.Snode) int64
- func (nlb *ListenerBase) Lock()
- func (nlb *ListenerBase) MarkFinished(node *cluster.Snode)
- func (nlb *ListenerBase) NodeStats() *NodeStats
- func (nlb *ListenerBase) NodesTardy(periodicNotifTime time.Duration) (nodes cluster.NodeMap, tardy bool)
- func (nlb *ListenerBase) Notifiers() cluster.NodeMap
- func (nlb *ListenerBase) ProgressInterval() time.Duration
- func (nlb *ListenerBase) RLock()
- func (nlb *ListenerBase) RUnlock()
- func (nlb *ListenerBase) SetAborted()
- func (nlb *ListenerBase) SetAddedTime()
- func (nlb *ListenerBase) SetErr(err error)
- func (nlb *ListenerBase) SetOwner(o string)
- func (nlb *ListenerBase) SetStats(daeID string, stats any)
- func (nlb *ListenerBase) Status() *Status
- func (nlb *ListenerBase) String() string
- func (nlb *ListenerBase) UUID() string
- func (nlb *ListenerBase) Unlock()
- type NodeStats
- func (ns *NodeStats) Len() (l int)
- func (ns *NodeStats) Load(key string) (val any, ok bool)
- func (ns *NodeStats) MarshalJSON() (data []byte, err error)
- func (ns *NodeStats) Range(f func(string, any) bool)
- func (ns *NodeStats) Store(key string, stats any)
- func (ns *NodeStats) UnmarshalJSON(data []byte) (err error)
- type Status
- type StatusVec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnFinished ¶
func OnProgress ¶
Types ¶
type Base ¶ added in v1.3.16
type Base struct { F func(n cluster.Notif, err error) // notification callback P func(n cluster.Notif) // on progress notification callback Dsts []string // node IDs to notify When cluster.Upon // see the enum below Interval time.Duration // interval at which progress needs to be updated // contains filtered or unexported fields }
func (*Base) LastNotifTime ¶ added in v1.3.16
func (*Base) NotifyInterval ¶ added in v1.3.16
func (*Base) OnFinishedCB ¶ added in v1.3.16
func (*Base) OnProgressCB ¶ added in v1.3.16
func (*Base) SetLastNotified ¶ added in v1.3.16
func (*Base) Subscribers ¶ added in v1.3.16
type Listener ¶ added in v1.3.16
type Listener interface { Callback(nl Listener, ts int64) UnmarshalStats(rawMsg []byte) (any, bool, bool, error) Lock() Unlock() RLock() RUnlock() Notifiers() cluster.NodeMap Kind() string Bcks() []*cmn.Bck SetErr(error) Err() error UUID() string SetAborted() Aborted() bool Status() *Status SetStats(daeID string, stats any) NodeStats() *NodeStats QueryArgs() cmn.HreqArgs EndTime() int64 SetAddedTime() AddedTime() int64 Finished() bool String() string GetOwner() string SetOwner(string) LastUpdated(si *cluster.Snode) int64 ProgressInterval() time.Duration // detailed ref-counting ActiveNotifiers() cluster.NodeMap FinCount() int ActiveCount() int HasFinished(node *cluster.Snode) bool MarkFinished(node *cluster.Snode) NodesTardy(periodicNotifTime time.Duration) (nodes cluster.NodeMap, tardy bool) }
type ListenerBase ¶ added in v1.3.16
type ListenerBase struct { Common struct { UUID string Action string // async operation kind (see cmn/api_const.go) Owned string // "": not owned | equalIC: IC | otherwise, pid + IC SmapVersion int64 // smap version in which NL is added Bck []*cmn.Bck } // construction Srcs cluster.NodeMap // all notifiers ActiveSrcs cluster.NodeMap // running notifiers F Callback `json:"-"` // optional listening-side callback Stats *NodeStats // [daeID => Stats (e.g. cmn.SnapExt)] // runtime FinTime atomic.Int64 // timestamp when finished AbortedX atomic.Bool // sets if the xaction is Aborted ErrValue cos.ErrValue // reported error and count // contains filtered or unexported fields }
func (*ListenerBase) Aborted ¶ added in v1.3.16
func (nlb *ListenerBase) Aborted() bool
func (*ListenerBase) ActiveCount ¶ added in v1.3.16
func (nlb *ListenerBase) ActiveCount() int
func (*ListenerBase) ActiveNotifiers ¶ added in v1.3.16
func (nlb *ListenerBase) ActiveNotifiers() cluster.NodeMap
func (*ListenerBase) AddedTime ¶ added in v1.3.16
func (nlb *ListenerBase) AddedTime() int64
func (*ListenerBase) Bcks ¶ added in v1.3.16
func (nlb *ListenerBase) Bcks() []*cmn.Bck
func (*ListenerBase) Callback ¶ added in v1.3.16
func (nlb *ListenerBase) Callback(nl Listener, ts int64)
is called after all Notifiers will have notified OR on failure (err != nil)
func (*ListenerBase) EndTime ¶ added in v1.3.16
func (nlb *ListenerBase) EndTime() int64
func (*ListenerBase) Err ¶ added in v1.3.16
func (nlb *ListenerBase) Err() error
func (*ListenerBase) FinCount ¶ added in v1.3.16
func (nlb *ListenerBase) FinCount() int
func (*ListenerBase) Finished ¶ added in v1.3.16
func (nlb *ListenerBase) Finished() bool
func (*ListenerBase) GetOwner ¶ added in v1.3.16
func (nlb *ListenerBase) GetOwner() string
func (*ListenerBase) HasFinished ¶ added in v1.3.16
func (nlb *ListenerBase) HasFinished(node *cluster.Snode) bool
func (*ListenerBase) Kind ¶ added in v1.3.16
func (nlb *ListenerBase) Kind() string
func (*ListenerBase) LastUpdated ¶ added in v1.3.16
func (nlb *ListenerBase) LastUpdated(si *cluster.Snode) int64
func (*ListenerBase) Lock ¶ added in v1.3.16
func (nlb *ListenerBase) Lock()
func (*ListenerBase) MarkFinished ¶ added in v1.3.16
func (nlb *ListenerBase) MarkFinished(node *cluster.Snode)
func (*ListenerBase) NodeStats ¶ added in v1.3.16
func (nlb *ListenerBase) NodeStats() *NodeStats
func (*ListenerBase) NodesTardy ¶ added in v1.3.16
func (nlb *ListenerBase) NodesTardy(periodicNotifTime time.Duration) (nodes cluster.NodeMap, tardy bool)
under rlock
func (*ListenerBase) Notifiers ¶ added in v1.3.16
func (nlb *ListenerBase) Notifiers() cluster.NodeMap
func (*ListenerBase) ProgressInterval ¶ added in v1.3.16
func (nlb *ListenerBase) ProgressInterval() time.Duration
func (*ListenerBase) RLock ¶ added in v1.3.16
func (nlb *ListenerBase) RLock()
func (*ListenerBase) RUnlock ¶ added in v1.3.16
func (nlb *ListenerBase) RUnlock()
func (*ListenerBase) SetAborted ¶ added in v1.3.16
func (nlb *ListenerBase) SetAborted()
func (*ListenerBase) SetAddedTime ¶ added in v1.3.16
func (nlb *ListenerBase) SetAddedTime()
func (*ListenerBase) SetErr ¶ added in v1.3.16
func (nlb *ListenerBase) SetErr(err error)
func (*ListenerBase) SetOwner ¶ added in v1.3.16
func (nlb *ListenerBase) SetOwner(o string)
func (*ListenerBase) SetStats ¶ added in v1.3.16
func (nlb *ListenerBase) SetStats(daeID string, stats any)
func (*ListenerBase) Status ¶ added in v1.3.16
func (nlb *ListenerBase) Status() *Status
func (*ListenerBase) String ¶ added in v1.3.16
func (nlb *ListenerBase) String() string
func (*ListenerBase) UUID ¶ added in v1.3.16
func (nlb *ListenerBase) UUID() string
func (*ListenerBase) Unlock ¶ added in v1.3.16
func (nlb *ListenerBase) Unlock()
type NodeStats ¶
func NewNodeStats ¶
func (*NodeStats) MarshalJSON ¶
func (*NodeStats) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.