@Override public Object extractValue(Config config, String path) { return config.getValue(path); } },
@Override public ConfigValue getValue(String path) { return c.getValue(path); }
/** * Initialize the FlowCatalog * @param sysConfig that must contain the fully qualified path of the flow template catalog * @throws IOException */ public FSFlowCatalog(Config sysConfig) throws IOException { super(sysConfig.withValue(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY, sysConfig.getValue(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY))); }
/** * Check that every key-value in superConfig is in subConfig */ public static boolean verifySubset(Config superConfig, Config subConfig) { for (Map.Entry<String, ConfigValue> entry : subConfig.entrySet()) { if (!superConfig.hasPath(entry.getKey()) || !superConfig.getValue(entry.getKey()).unwrapped() .equals(entry.getValue().unwrapped())) { return false; } } return true; }
@SuppressWarnings("unchecked") private Config dbconf(final Config conf, final String type) { try { String dbtype = "databases." + type; ConfigValue value = conf.getValue(dbtype); if (value.valueType() == ConfigValueType.OBJECT) { return ((ConfigObject) value).toConfig(); } List<Config> list = (List<Config>) conf.getConfigList(dbtype); ClassLoader loader = getClass().getClassLoader(); return list.stream() .filter(it -> dataSourcePresent(loader, it.getString("dataSourceClassName"))) .findFirst() .orElse(list.get(0)); } catch (ConfigException.Missing | ConfigException.BadPath x) { return ConfigFactory.empty(); } }
ConfigValue raw = conf.getValue("com.graphaware.module"); List<Config> modules = new ArrayList<>(); if (raw.valueType() == ConfigValueType.LIST) {
Config templateCatalogCfg = config .withValue(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY, this.config.getValue(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY)); this.templateCatalog = Optional.of(new FSJobCatalog(templateCatalogCfg)); } else {
.withValue(GitFlowGraphMonitor.GIT_FLOWGRAPH_MONITOR_PREFIX + "." + ConfigurationKeys.ENCRYPT_KEY_LOC, config.getValue(ConfigurationKeys.ENCRYPT_KEY_LOC));
jobConfig.setProperty(ConfigurationKeys.JOB_NAME_KEY, addedSpec.getUri().toString()); jobConfig.setProperty(ConfigurationKeys.JOB_GROUP_KEY, flowSpec.getConfig().getValue(ConfigurationKeys.FLOW_GROUP_KEY).toString()); jobConfig.setProperty(ConfigurationKeys.FLOW_RUN_IMMEDIATELY, ConfigUtils.getString((flowSpec).getConfig(), ConfigurationKeys.FLOW_RUN_IMMEDIATELY, "false"));
configFromEnvVar = configFromEnvVar.withValue(SRV_NAME_KEY, config.getValue(SRV_NAME_KEY));
if (config.hasPath(ConfigurationKeys.TOPOLOGYSPEC_STORE_DIR_KEY)) { newConfig = config.withValue(ConfigurationKeys.SPECSTORE_FS_DIR_KEY, config.getValue(ConfigurationKeys.TOPOLOGYSPEC_STORE_DIR_KEY));
if (config.hasPath(ConfigurationKeys.FLOWSPEC_STORE_DIR_KEY)) { newConfig = config.withValue(ConfigurationKeys.SPECSTORE_FS_DIR_KEY, config.getValue(ConfigurationKeys.FLOWSPEC_STORE_DIR_KEY));
for (String propertyName : m_config) ConfigValue value = config.getValue(propertyName);
ConfigValue configValue = config.getValue(path); ConfigValueType valueType = configValue.valueType(); if (valueType.equals(ConfigValueType.OBJECT) && Map.class.isAssignableFrom(paramClass)) {
return config.getObject(configPropName); } else if (parameterClass == ConfigValue.class) { return config.getValue(configPropName); } else if (parameterClass == ConfigList.class) { return config.getList(configPropName);
overrideConfigMap = overrideConfigMap.put(Tuple.of(destinationKey, config.getValue(enabledProfileKey))); } else { ConfigValue newConfigValue = config.getValue(enabledProfileKey); if (!EqualityUtils.isEqual(previousOverrideValue.unwrapped(), newConfigValue.unwrapped())) { throw new RuntimeException("Found conflicting value for key " + destinationKey
@BeforeClass public void setUp() throws URISyntaxException, IOException, SpecNotFoundException, JobTemplate.TemplateException { // Create a FSFlowCatalog instance URI flowTemplateCatalogUri = this.getClass().getClassLoader().getResource("template_catalog").toURI(); Properties properties = new Properties(); properties.put(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY, flowTemplateCatalogUri.toString()); Config config = ConfigFactory.parseProperties(properties); Config templateCatalogCfg = config .withValue(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY, config.getValue(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY)); FSFlowCatalog catalog = new FSFlowCatalog(templateCatalogCfg); FlowTemplate flowTemplate = catalog.getFlowTemplate(new URI(TEST_TEMPLATE_URI)); this.jobTemplates = flowTemplate.getJobTemplates(); //Create a spec executor instance properties = new Properties(); properties.put("specStore.fs.dir", "/tmp/testSpecStoreDir"); properties.put("specExecInstance.capabilities", "source:destination"); Config specExecutorConfig = ConfigUtils.propertiesToConfig(properties); this.specExecutor = new InMemorySpecExecutor(specExecutorConfig); }
Config templateCatalogCfg = config .withValue(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY, config.getValue(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY)); FSFlowCatalog catalog = new FSFlowCatalog(templateCatalogCfg); Config edgeProps = ConfigUtils.propertiesToConfig(properties);
Config templateCatalogCfg = config .withValue(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY, config.getValue(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY)); this.flowCatalog = Optional.of(new FSFlowCatalog(templateCatalogCfg));