Back to godoc.org

Package events

v0.9.0
Latest Go to latest

The latest major version is .

Published: Aug 10, 2020 | License: Apache-2.0 | Module: github.com/apache/incubator-yunikorn-core

Index

func CreateAndSetEventCache

func CreateAndSetEventCache()

func CreateAppEventRecord

func CreateAppEventRecord(objectID, reason, message string) (*si.EventRecord, error)

func CreateNodeEventRecord

func CreateNodeEventRecord(objectID, reason, message string) (*si.EventRecord, error)

func CreateQueueEventRecord

func CreateQueueEventRecord(objectID, groupID, reason, message string) (*si.EventRecord, error)

func CreateRequestEventRecord

func CreateRequestEventRecord(objectID, groupID, reason, message string) (*si.EventRecord, error)

type EventCache

type EventCache struct {
	Store EventStore // storing eventChannel

	sync.Mutex
	// contains filtered or unexported fields
}

func GetEventCache

func GetEventCache() *EventCache

func (*EventCache) AddEvent

func (ec *EventCache) AddEvent(event *si.EventRecord)

func (*EventCache) StartService

func (ec *EventCache) StartService()

func (*EventCache) Stop

func (ec *EventCache) Stop()

type EventPublisher

type EventPublisher interface {
	StartService()
	Stop()
}

func CreateShimPublisher

func CreateShimPublisher(store EventStore) EventPublisher

type EventStore

type EventStore interface {
	Store(event *si.EventRecord)
	CollectEvents() []*si.EventRecord
	CountStoredEvents() int
}

The EventStore operates under the following assumptions:

- for a given ObjectID only one (the latest) event is stored
- there is a cap for the number of events stored
- the CollectEvents() function clears the currently stored events in the EventStore

Assuming the rate of events generated by the scheduler component in a given time period is high, calling CollectEvents() periodically should be fine. Objects are stored using their ObjectID, so different types of objects with the same id overwrite each other.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier