/** * The resource configuration is updated -review and update state. * @param resources updated resources specification * @return a list of any dynamically added provider roles * (purely for testing purposes) */ @VisibleForTesting public synchronized List<ProviderRole> updateResourceDefinitions(ConfTree resources) throws BadConfigException, IOException { log.debug("Updating resources to {}", resources); // snapshot the (possibly unresolved) values ConfTreeSerDeser serDeser = new ConfTreeSerDeser(); unresolvedInstanceDefinition.setResources( serDeser.fromInstance(resources)); // assign another copy under the instance definition for resolving // and then driving application size instanceDefinition.setResources(serDeser.fromInstance(resources)); onInstanceDefinitionUpdated(); // propagate the role table Map<String, Map<String, String>> updated = resources.components; getClusterStatus().roles = SliderUtils.deepClone(updated); getClusterStatus().updateTime = now(); return buildRoleRequirementsFromResources(); }
/** * The resource configuration is updated -review and update state. * @param resources updated resources specification * @return a list of any dynamically added provider roles * (purely for testing purposes) */ @VisibleForTesting public synchronized List<ProviderRole> updateResourceDefinitions(ConfTree resources) throws BadConfigException, IOException { log.debug("Updating resources to {}", resources); // snapshot the (possibly unresolved) values ConfTreeSerDeser serDeser = new ConfTreeSerDeser(); unresolvedInstanceDefinition.setResources( serDeser.fromInstance(resources)); // assign another copy under the instance definition for resolving // and then driving application size instanceDefinition.setResources(serDeser.fromInstance(resources)); onInstanceDefinitionUpdated(); // propagate the role table Map<String, Map<String, String>> updated = resources.components; getClusterStatus().roles = SliderUtils.deepClone(updated); getClusterStatus().updateTime = now(); return buildRoleRequirementsFromResources(); }