Documentation
¶
Index ¶
- type EventName
- type EventQueue
- type EventQueueFactory
- func (f *EventQueueFactory) EventQueue(name string) *EventQueue
- func (f *EventQueueFactory) RegistryEventHandler(name string, handle Handle) Handle
- func (f *EventQueueFactory) RegistryEventProbe(name string, probe Probe) Probe
- func (f *EventQueueFactory) Start(ctx context.Context) error
- func (f *EventQueueFactory) SyncConfig(cfg *api.ColocationConfig) error
- type Handle
- type NodeMonitorEvent
- type NodeResourceEvent
- type PodEvent
- type Probe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventQueue ¶
type EventQueue struct { // Name is the name of event. Name string // Workers is the number of handle workers that are allowed to sync concurrently. Workers int // Queue for caching events Queue workqueue.RateLimitingInterface // List of handlers that need to handle this event. Handlers []Handle // List of event detectors. // Generate an event and put the event in the queue Probes []Probe }
func NewEventQueue ¶
func NewEventQueue(name string) *EventQueue
func (*EventQueue) AddHandler ¶
func (eq *EventQueue) AddHandler(handle ...Handle)
func (*EventQueue) AddProbe ¶
func (eq *EventQueue) AddProbe(p ...Probe)
func (*EventQueue) GetQueue ¶
func (eq *EventQueue) GetQueue() workqueue.RateLimitingInterface
func (*EventQueue) ProcessEvent ¶
func (eq *EventQueue) ProcessEvent(ctx context.Context)
func (*EventQueue) SetWorkers ¶
func (eq *EventQueue) SetWorkers(workers int)
type EventQueueFactory ¶
type EventQueueFactory struct { Mutex sync.RWMutex Queues map[string]*EventQueue }
func (*EventQueueFactory) EventQueue ¶
func (f *EventQueueFactory) EventQueue(name string) *EventQueue
func (*EventQueueFactory) RegistryEventHandler ¶
func (f *EventQueueFactory) RegistryEventHandler(name string, handle Handle) Handle
func (*EventQueueFactory) RegistryEventProbe ¶
func (f *EventQueueFactory) RegistryEventProbe(name string, probe Probe) Probe
func (*EventQueueFactory) SyncConfig ¶
func (f *EventQueueFactory) SyncConfig(cfg *api.ColocationConfig) error
type Handle ¶
type Handle interface { // HandleName returns name of the handler HandleName() string // Handle handles the given event // Return an error only if the event needs to be re-enqueued to be processed // Need to avoid returning errors that cannot be resolved by retrying Handle(event interface{}) error // IsActive returns true if the handler is enabled IsActive() bool // RefreshCfg hot update handler's cfg. RefreshCfg(cfg *api.ColocationConfig) error }
type NodeMonitorEvent ¶
type NodeMonitorEvent struct { // TimeStamp is the time when event occur. TimeStamp time.Time // Resource represents which resource is under pressure. Resource corev1.ResourceName }
NodeMonitorEvent defines node pressure event.
type NodeResourceEvent ¶
NodeResourceEvent defines node resource event, overSubscription resource recently.
Click to show internal directories.
Click to hide internal directories.