public AggregateConf(ConfTree resources, ConfTree appConf, ConfTree internal) { setResources(resources); setAppConf(appConf); setInternal(internal); }
public AggregateConf(ConfTree resources, ConfTree appConf, ConfTree internal) { setResources(resources); setAppConf(appConf); setInternal(internal); }
/** * 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(); }
private void loadConf(AggregateConf conf) throws IOException { conf.setInternal(confTreeSerDeser.load(fileSystem, internal)); conf.setResources(confTreeSerDeser.load(fileSystem, resources)); conf.setAppConf(confTreeSerDeser.load(fileSystem, app_conf)); }
private void loadConf(AggregateConf conf) throws IOException { conf.setInternal(confTreeSerDeser.load(fileSystem, internal)); conf.setResources(confTreeSerDeser.load(fileSystem, resources)); conf.setAppConf(confTreeSerDeser.load(fileSystem, app_conf)); }
/** * Implementation of cluster flexing. * It should be the only way that anything -even the AM itself on startup- * asks for nodes. * @param resources the resource tree * @throws SliderException slider problems, including invalid configs * @throws IOException IO problems */ public void flexCluster(ConfTree resources) throws IOException, SliderException { AggregateConf newConf = new AggregateConf(appState.getInstanceDefinitionSnapshot()); newConf.setResources(resources); // verify the new definition is valid sliderAMProvider.validateInstanceDefinition(newConf); providerService.validateInstanceDefinition(newConf); appState.updateResourceDefinitions(resources); // reset the scheduled windows...the values // may have changed appState.resetFailureCounts(); // ask for more containers if needed reviewRequestAndReleaseNodes("flexCluster"); }
/** * Take a snapshot of the configuration * @param instanceDefinition source * @throws IOException marshalling/copying problems */ public AggregateConf(AggregateConf instanceDefinition) throws IOException { ConfTreeOperations resourcesSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getResources()); ConfTreeOperations appConfSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getAppConf()); ConfTreeOperations internalsSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getInternal()); //build a new aggregate from the snapshots setResources(resourcesSnapshot.confTree); setAppConf(appConfSnapshot.confTree); setInternal(internalsSnapshot.confTree); }
/** * Implementation of cluster flexing. * It should be the only way that anything -even the AM itself on startup- * asks for nodes. * @param resources the resource tree * @throws SliderException slider problems, including invalid configs * @throws IOException IO problems */ public void flexCluster(ConfTree resources) throws IOException, SliderException { AggregateConf newConf = new AggregateConf(appState.getInstanceDefinitionSnapshot()); newConf.setResources(resources); // verify the new definition is valid sliderAMProvider.validateInstanceDefinition(newConf); providerService.validateInstanceDefinition(newConf); appState.updateResourceDefinitions(resources); // reset the scheduled windows...the values // may have changed appState.resetFailureCounts(); // ask for more containers if needed reviewRequestAndReleaseNodes("flexCluster"); }
/** * Take a snapshot of the configuration * @param instanceDefinition source * @throws IOException marshalling/copying problems */ public AggregateConf(AggregateConf instanceDefinition) throws IOException { ConfTreeOperations resourcesSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getResources()); ConfTreeOperations appConfSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getAppConf()); ConfTreeOperations internalsSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getInternal()); //build a new aggregate from the snapshots setResources(resourcesSnapshot.confTree); setAppConf(appConfSnapshot.confTree); setInternal(internalsSnapshot.confTree); }