use of com.twitter.heron.eco.definition.EcoExecutionContext in project incubator-heron by apache.
the class Eco method submit.
public void submit(FileInputStream fileInputStream, FileInputStream propertiesFile, boolean envFilter) throws Exception {
EcoTopologyDefinition topologyDefinition = ecoParser.parseFromInputStream(fileInputStream, propertiesFile, envFilter);
String topologyName = topologyDefinition.getName();
Config topologyConfig = ecoBuilder.buildConfig(topologyDefinition);
EcoExecutionContext executionContext = new EcoExecutionContext(topologyDefinition, topologyConfig);
printTopologyInfo(executionContext);
ObjectBuilder objectBuilder = new ObjectBuilder();
objectBuilder.setBuilderUtility(new BuilderUtility());
TopologyBuilder builder = ecoBuilder.buildTopologyBuilder(executionContext, objectBuilder);
ecoSubmitter.submitTopology(topologyName, topologyConfig, builder.createTopology());
}
use of com.twitter.heron.eco.definition.EcoExecutionContext in project incubator-heron by apache.
the class EcoBuilderTest method testBuildTopologyBuilder_BuildsAsExpected.
@Test
public void testBuildTopologyBuilder_BuildsAsExpected() throws IllegalAccessException, ClassNotFoundException, InstantiationException, NoSuchFieldException, InvocationTargetException {
Config config = new Config();
EcoExecutionContext context = new EcoExecutionContext(ecoTopologyDefinition, config);
ObjectBuilder objectBuilder = new ObjectBuilder();
subject.buildTopologyBuilder(context, objectBuilder);
verify(mockSpoutBuilder).buildSpouts(same(context), any(TopologyBuilder.class), same(objectBuilder));
verify(mockBoltBuilder).buildBolts(same(context), same(objectBuilder));
verify(mockStreamBuilder).buildStreams(same(context), any(TopologyBuilder.class), same(objectBuilder));
verify(mockComponentBuilder).buildComponents(same(context), same(objectBuilder));
}
Aggregations