You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2020/04/16 20:04:00 UTC

[GitHub] [storm] Ethanlm commented on a change in pull request #3249: [STORM-3624] Fix race condition when loading scheduler configs

Ethanlm commented on a change in pull request #3249: [STORM-3624] Fix race condition when loading scheduler configs
URL: https://github.com/apache/storm/pull/3249#discussion_r409816471
 
 

 ##########
 File path: storm-server/src/main/java/org/apache/storm/scheduler/multitenant/MultitenantScheduler.java
 ##########
 @@ -30,20 +32,22 @@
     private static final Logger LOG = LoggerFactory.getLogger(MultitenantScheduler.class);
     protected IConfigLoader configLoader;
     private Map<String, Object> conf;
+    private SchedulerConfigCache<Map<String, Number>> schedulerConfigCache;
 
     @Override
     public void prepare(Map<String, Object> conf, StormMetricsRegistry metricsRegistry) {
         this.conf = conf;
         configLoader = ConfigLoaderFactoryService.createConfigLoader(conf);
-
+        schedulerConfigCache = new SchedulerConfigCache<>(conf, this::loadConfig);
 
 Review comment:
   There are currently two schedulers (ResourceAwareScheduler, MultitenantScheduler) need to have this logic. And maybe in the future a new scheduler or other existing schedulers will want to have configs too.  I keep this class to wrap the logic and to avoid repeat the code in schedulers. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services