protected void validateComponentProperties(ConfTreeOperations props) throws BadConfigException { for (String compName : props.getComponentNames()) { MapOperations mo = props.getComponent(compName); if (mo == null) continue; for (String key : mo.keySet()) { validatePropertyNamePrefix(key); } } }
protected void validateGlobalProperties(ConfTreeOperations props) throws BadConfigException { for (String key : props.getGlobalOptions().keySet()) { validatePropertyNamePrefix(key); } } }
/** * Get the node failure threshold for a specific role, falling back to * the global one if not * @param roleGroup role group * @return the threshold for failures */ private int getNodeFailureThresholdForRole(String roleGroup) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleGroup, NODE_FAILURE_THRESHOLD, nodeFailureThreshold); }
/** * Reads and sets the heartbeat monitoring interval. If bad value is provided then log it and set to default. * * @param instanceDefinition */ private void initializeAgentDebugCommands(AggregateConf instanceDefinition) { String launchParameterStr = instanceDefinition.getAppConfOperations(). getGlobalOptions().getOption(AgentKeys.AGENT_INSTANCE_DEBUG_DATA, ""); agentLaunchParameter = new AgentLaunchParameter(launchParameterStr); }
/** * Is this app package versioned? * * @return true if {@link SliderKeys#APP_VERSION} was set in the app config * provided during creation of this app * @since 0.80.0-incubating */ public boolean isVersioned() { return StringUtils.isNotEmpty(getAppConfOperations().getGlobalOptions() .get(SliderKeys.APP_VERSION)); }
private void propagatePythonExecutable(Configuration config, AggregateConf instanceDefinition) { String pythonExec = config.get( PYTHON_EXECUTABLE_PATH); if (pythonExec != null) { instanceDefinition.getAppConfOperations().getGlobalOptions().putIfUnset( PYTHON_EXECUTABLE_PATH, pythonExec); } }
public void validateNodeCount(AggregateConf instanceDescription, String name, int min, int max) throws BadCommandArgumentsException { MapOperations component = instanceDescription.getResourceOperations().getComponent(name); int count; if (component == null) { count = 0; } else { count = component.getOptionInt(ResourceKeys.COMPONENT_INSTANCES, 0); } validateNodeCount(name, count, min, max); }
/** * Get a component option * @param name component name * @param option option name * @param defVal default value * @return resolved value */ public String getComponentOpt(String name, String option, String defVal) { MapOperations roleopts = getComponent(name); if (roleopts == null) { return defVal; } return roleopts.getOption(option, defVal); }
/** * Merge the map of a single component * @param component component name * @param map map to merge */ public void mergeSingleComponentMap(String component, Map<String, String> map) { MapOperations comp = getOrAddComponent(component); comp.putAll(map); } /**
/** * get a global option * @param key key * @return value or null * */ public String get(String key) { return globalOptions.get(key); } /**
/** * Reads and sets the heartbeat monitoring interval. If bad value is provided then log it and set to default. * * @param instanceDefinition */ private void initializeAgentDebugCommands(AggregateConf instanceDefinition) { String launchParameterStr = instanceDefinition.getAppConfOperations(). getGlobalOptions().getOption(AgentKeys.AGENT_INSTANCE_DEBUG_DATA, ""); agentLaunchParameter = new AgentLaunchParameter(launchParameterStr); }
/** * Is this app package versioned? * * @return true if {@link SliderKeys#APP_VERSION} was set in the app config * provided during creation of this app * @since 0.80.0-incubating */ public boolean isVersioned() { return StringUtils.isNotEmpty(getAppConfOperations().getGlobalOptions() .get(SliderKeys.APP_VERSION)); }
private void propagatePythonExecutable(Configuration config, AggregateConf instanceDefinition) { String pythonExec = config.get( PYTHON_EXECUTABLE_PATH); if (pythonExec != null) { instanceDefinition.getAppConfOperations().getGlobalOptions().putIfUnset( PYTHON_EXECUTABLE_PATH, pythonExec); } }
/** * Get the health threshold percent for a specific role, falling back to * the global one if not. * @param roleGroup role group * @return the threshold percent for health */ public int getHealthThresholdPercentForRole(String roleGroup) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleGroup, CONTAINER_HEALTH_THRESHOLD_PERCENT, healthThresholdPercent); }
protected void validateComponentProperties(ConfTreeOperations props) throws BadConfigException { for (String compName : props.getComponentNames()) { MapOperations mo = props.getComponent(compName); if (mo == null) continue; for (String key : mo.keySet()) { validatePropertyNamePrefix(key); } } }
protected void validateGlobalProperties(ConfTreeOperations props) throws BadConfigException { for (String key : props.getGlobalOptions().keySet()) { validatePropertyNamePrefix(key); } } }
/** * Merge the map of a single component * @param component component name * @param map map to merge */ public void mergeSingleComponentMap(String component, Map<String, String> map) { MapOperations comp = getOrAddComponent(component); comp.putAll(map); } /**
/** * Get the node failure threshold for a specific role, falling back to * the global one if not * @param roleGroup role group * @return the threshold for failures */ private int getNodeFailureThresholdForRole(String roleGroup) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleGroup, NODE_FAILURE_THRESHOLD, nodeFailureThreshold); }