/** Creates a builder for the TopologySpec based on values in a topology properties config. */ public static TopologySpec.Builder builder(URI catalogURI, Properties topologyProps) { String name = topologyProps.getProperty(ConfigurationKeys.TOPOLOGY_NAME_KEY); String group = topologyProps.getProperty(ConfigurationKeys.TOPOLOGY_GROUP_KEY, "default"); try { URI topologyURI = new URI(catalogURI.getScheme(), catalogURI.getAuthority(), "/" + group + "/" + name, null); TopologySpec.Builder builder = new TopologySpec.Builder(topologyURI).withConfigAsProperties(topologyProps); String descr = topologyProps.getProperty(ConfigurationKeys.TOPOLOGY_DESCRIPTION_KEY, null); if (null != descr) { builder = builder.withDescription(descr); } return builder; } catch (URISyntaxException e) { throw new RuntimeException("Unable to create a TopologySpec URI: " + e, e); } }
.builder(topologyConfig.getString(ServiceConfigKeys.TOPOLOGYSPEC_URI_KEY)) .withConfig(topologyConfig) .withDescription(description) .withVersion(version) .withSpecExecutor(specExecutor);
.builder(topologySpecUri) .withConfig(topologyConfig) .withDescription("") .withVersion("1") .withSpecExecutor(specExecutor);
.builder(topologyConfig.getString(ServiceConfigKeys.TOPOLOGYSPEC_URI_KEY)) .withConfig(topologyConfig) .withDescription(description) .withVersion(version) .withSpecExecutor(specExecutor);
/** Creates a builder for the TopologySpec based on values in a topology properties config. */ public static TopologySpec.Builder builder(URI catalogURI, Properties topologyProps) { String name = topologyProps.getProperty(ConfigurationKeys.TOPOLOGY_NAME_KEY); String group = topologyProps.getProperty(ConfigurationKeys.TOPOLOGY_GROUP_KEY, "default"); try { URI topologyURI = new URI(catalogURI.getScheme(), catalogURI.getAuthority(), "/" + group + "/" + name, null); TopologySpec.Builder builder = new TopologySpec.Builder(topologyURI).withConfigAsProperties(topologyProps); String descr = topologyProps.getProperty(ConfigurationKeys.TOPOLOGY_DESCRIPTION_KEY, null); if (null != descr) { builder = builder.withDescription(descr); } return builder; } catch (URISyntaxException e) { throw new RuntimeException("Unable to create a TopologySpec URI: " + e, e); } }
private TopologySpec initTopologySpec(String storeDir, String ... args) { Properties properties = new Properties(); properties.put("specStore.fs.dir", storeDir); String capabilitiesString = ""; for(int i =0 ; i < args.length - 1 ; i ++ ) { capabilitiesString = capabilitiesString + ( args[i] + ":" + args[i+1] + ","); } Assert.assertEquals(capabilitiesString.charAt(capabilitiesString.length() - 1) , ','); capabilitiesString = capabilitiesString.substring(0, capabilitiesString.length() - 1 ); properties.put("specExecInstance.capabilities", capabilitiesString); properties.put("executorAttrs", new Properties()); Config config = ConfigUtils.propertiesToConfig(properties); SpecExecutor specExecutorInstance = new InMemorySpecExecutor(config); TopologySpec.Builder topologySpecBuilder = TopologySpec.builder( IdentityFlowToJobSpecCompilerTest.computeTopologySpecURI(SPEC_STORE_PARENT_DIR, storeDir)) .withConfig(config) .withDescription(SPEC_DESCRIPTION) .withVersion(SPEC_VERSION) .withSpecExecutor(specExecutorInstance); return topologySpecBuilder.build(); }
private TopologySpec initTopologySpec() { Properties properties = new Properties(); properties.put("specStore.fs.dir", TOPOLOGY_SPEC_STORE_DIR); properties.put("specExecInstance.capabilities", TEST_SOURCE_NAME + ":" + TEST_SINK_NAME); Config config = ConfigUtils.propertiesToConfig(properties); SpecExecutor specExecutorInstance = new InMemorySpecExecutor(config); TopologySpec.Builder topologySpecBuilder = TopologySpec.builder(computeTopologySpecURI(SPEC_STORE_PARENT_DIR, TOPOLOGY_SPEC_STORE_DIR)) .withConfig(config) .withDescription(SPEC_DESCRIPTION) .withVersion(SPEC_VERSION) .withSpecExecutor(specExecutorInstance); return topologySpecBuilder.build(); }
private TopologySpec initTopologySpec() { Properties properties = new Properties(); properties.put("specStore.fs.dir", SPEC_STORE_DIR); properties.put("specExecInstance.capabilities", "source:destination"); Config config = ConfigUtils.propertiesToConfig(properties); SpecExecutor specExecutorInstanceProducer = new InMemorySpecExecutor(config); TopologySpec.Builder topologySpecBuilder = TopologySpec.builder(computeTopologySpecURI()) .withConfig(config) .withDescription(SPEC_DESCRIPTION) .withVersion(SPEC_VERSION) .withSpecExecutor(specExecutorInstanceProducer); return topologySpecBuilder.build(); }
private TopologySpec initTopologySpec() { Properties properties = new Properties(); properties.put("specStore.fs.dir", TOPOLOGY_SPEC_STORE_DIR); properties.put("specExecInstance.capabilities", "source:destination"); Config config = ConfigUtils.propertiesToConfig(properties); SpecExecutor specExecutorInstance = new InMemorySpecExecutor(config); TopologySpec.Builder topologySpecBuilder = TopologySpec.builder(computeTopologySpecURI(SPEC_STORE_PARENT_DIR, TOPOLOGY_SPEC_STORE_DIR)) .withConfig(config) .withDescription(SPEC_DESCRIPTION) .withVersion(SPEC_VERSION) .withSpecExecutor(specExecutorInstance); return topologySpecBuilder.build(); }