pbacsko commented on code in PR #579:
URL: https://github.com/apache/yunikorn-core/pull/579#discussion_r1276102018
##########
pkg/events/event_system.go:
##########
@@ -125,3 +169,38 @@ func (ec *EventSystemImpl) AddEvent(event *si.EventRecord)
{
metrics.GetEventMetrics().IncEventsNotChanneled()
}
}
+
+func (ec *EventSystemImpl) readIsTrackingEnabled() bool {
+ return common.GetConfigurationBool(configs.GetConfigMap(),
configs.CMEventTrackingEnabled, configs.DefaultEventTrackingEnabled)
+}
+
+func (ec *EventSystemImpl) readRequestCapacity() int {
+ return common.GetConfigurationInt(configs.GetConfigMap(),
configs.CMEventRequestCapacity, configs.DefaultEventRequestCapacity)
+}
+
+func (ec *EventSystemImpl) readRingBufferCapacity() uint64 {
+ return common.GetConfigurationUint(configs.GetConfigMap(),
configs.CMEventRingBufferCapacity, configs.DefaultEventRingBufferCapacity)
+}
+
+func (ec *EventSystemImpl) isRestartNeeded() bool {
+ ec.Lock()
+ defer ec.Unlock()
+ return ec.readIsTrackingEnabled() != ec.trackingEnabled
+}
+
+func (ec *EventSystemImpl) Restart() {
+ ec.Stop()
+ ec.StartServiceWithPublisher(true)
+}
+
+func (ec *EventSystemImpl) reloadConfig() {
+ ec.requestCapacity = ec.readRequestCapacity()
+ newRingBufferCapacity := ec.readRingBufferCapacity()
+
+ // resize the ring buffer with new capacity
+ ec.eventBuffer.Resize(newRingBufferCapacity)
Review Comment:
Here, it's useful to print a log message if the resize results in losing
events.
I'd check the lowest ID before/after and then log something (not sure if
WARN is needed, INFO might be sufficient).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]