craigcondit commented on code in PR #446:
URL: https://github.com/apache/yunikorn-core/pull/446#discussion_r1019564712
##########
pkg/common/configs/configs.go:
##########
@@ -53,3 +52,51 @@ func (ctx *SchedulerConfigContext) Get(policyGroup string)
*SchedulerConfig {
defer ctx.lock.RUnlock()
return ctx.configs[policyGroup]
}
+
+func AddConfigMapCallback(id string, callback func()) {
+ configMapLock.Lock()
+ defer configMapLock.Unlock()
+ configMapCallbacks[id] = callback
+}
+
+func RemoveConfigMapCallback(id string) {
+ configMapLock.Lock()
+ defer configMapLock.Unlock()
+ delete(configMapCallbacks, id)
+}
Review Comment:
I'll add the comments.
Currently, nothing calls these, as we don't have any config vars specific to
the core. See comments on https://issues.apache.org/jira/browse/YUNIKORN-1213
for the first likely candidate (controlling health check interval).
The idea is that code which can respond to config changes will get a
callback when new values are loaded, and can update internal state.
--
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]