public AggregateConfResource(AggregateConf conf, UriBuilder uriBuilder) { if (uriBuilder != null) { this.href = uriBuilder.build().toASCIIString(); resources = ResourceFactory.createConfTreeResource(conf.getResources(), uriBuilder.clone().path("configurations").path("resources")); internal = ResourceFactory.createConfTreeResource(conf.getInternal(), uriBuilder.clone().path("configurations").path("internal")); appConf = ResourceFactory.createConfTreeResource(conf.getAppConf(), uriBuilder.clone().path("configurations").path("appConf")); initConfMap(); } else { resources = null; internal = null; appConf = null; } }
aggregateConf.getInternal().global); SliderUtils.mergeMapsIgnoreDuplicateKeys(options, aggregateConf.getAppConf().global); mergeInComponentMap(cd, aggregateConf.getInternal()); mergeInComponentMap(cd, aggregateConf.getAppConf()); mergeInComponentMap(cd, aggregateConf.getResources());
aggregateConf.getInternal().global); SliderUtils.mergeMapsIgnoreDuplicateKeys(options, aggregateConf.getAppConf().global); mergeInComponentMap(cd, aggregateConf.getInternal()); mergeInComponentMap(cd, aggregateConf.getAppConf()); mergeInComponentMap(cd, aggregateConf.getResources());
public AggregateConfResource(AggregateConf conf, UriBuilder uriBuilder) { if (uriBuilder != null) { this.href = uriBuilder.build().toASCIIString(); resources = ResourceFactory.createConfTreeResource(conf.getResources(), uriBuilder.clone().path("configurations").path("resources")); internal = ResourceFactory.createConfTreeResource(conf.getInternal(), uriBuilder.clone().path("configurations").path("internal")); appConf = ResourceFactory.createConfTreeResource(conf.getAppConf(), uriBuilder.clone().path("configurations").path("appConf")); initConfMap(); } else { resources = null; internal = null; appConf = null; } }
private void saveConf(AggregateConf conf) throws IOException { confTreeSerDeser.save(fileSystem, internal, conf.getInternal(), true); confTreeSerDeser.save(fileSystem, resources, conf.getResources(), true); confTreeSerDeser.save(fileSystem, app_conf, conf.getAppConf(), true); }
private void saveConf(AggregateConf conf) throws IOException { confTreeSerDeser.save(fileSystem, internal, conf.getInternal(), true); confTreeSerDeser.save(fileSystem, resources, conf.getResources(), true); confTreeSerDeser.save(fileSystem, app_conf, conf.getAppConf(), true); }
/** * 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); }
/** * 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); }
internalsSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getInternal());
internalsSnapshot = ConfTreeOperations.fromInstance(instanceDefinition.getInternal());
@Override public Messages.GetInstanceDefinitionResponseProto getInstanceDefinition( Messages.GetInstanceDefinitionRequestProto request) throws IOException, YarnException { onRpcCall("getinstancedefinition"); String internal; String resources; String app; AggregateConf instanceDefinition = state.getInstanceDefinitionSnapshot(); internal = instanceDefinition.getInternal().toJson(); resources = instanceDefinition.getResources().toJson(); app = instanceDefinition.getAppConf().toJson(); assert internal != null; assert resources != null; assert app != null; log.debug("Generating getInstanceDefinition Response"); Messages.GetInstanceDefinitionResponseProto.Builder builder = Messages.GetInstanceDefinitionResponseProto.newBuilder(); builder.setInternal(internal); builder.setResources(resources); builder.setApplication(app); return builder.build(); }
@Override public Messages.GetInstanceDefinitionResponseProto getInstanceDefinition( Messages.GetInstanceDefinitionRequestProto request) throws IOException, YarnException { onRpcCall("getinstancedefinition"); String internal; String resources; String app; AggregateConf instanceDefinition = state.getInstanceDefinitionSnapshot(); internal = instanceDefinition.getInternal().toJson(); resources = instanceDefinition.getResources().toJson(); app = instanceDefinition.getAppConf().toJson(); assert internal != null; assert resources != null; assert app != null; log.debug("Generating getInstanceDefinition Response"); Messages.GetInstanceDefinitionResponseProto.Builder builder = Messages.GetInstanceDefinitionResponseProto.newBuilder(); builder.setInternal(internal); builder.setResources(resources); builder.setApplication(app); return builder.build(); }
scheduleEscalation(instanceDefinition.getInternal()); scheduleHealthThresholdMonitor(instanceDefinition.getResources());
scheduleEscalation(instanceDefinition.getInternal());